wiki api docs

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

wiki api docs

Ian Martins
work is closed for snow so I had some time today.  I wrote an app to
pull the api docs from the wiki and update the comments in my local
source tree.  now chxdoc can have the latest api!

attached is a patch. I skipped the flash, php, and js directories since
they're documented elsewhere.

by the way, in case somebody likes metrics, I went through 886 classes,
fields, and methods.  Of these, 52% are undocumented.

-Ian

? makedocs
? wiki_doc.diff
Index: EReg.hx
===================================================================
RCS file: /cvsroot/haxe/std/EReg.hx,v
retrieving revision 1.34
diff -u -r1.34 EReg.hx
--- EReg.hx 7 Oct 2008 10:54:52 -0000 1.34
+++ EReg.hx 28 Jan 2009 21:01:47 -0000
@@ -135,8 +135,7 @@
  }
 
  /**
- Returns the part of the string that was as the left of
- of the matched substring.
+ Returns the part of the string that was as the left of the matched substring.
  **/
  public function matchedLeft() : String {
  #if neko
@@ -161,8 +160,7 @@
  }
 
  /**
- Returns the part of the string that was at the right of
- of the matched substring.
+ Returns the part of the string that was as the right of of the matched substring.
  **/
  public function matchedRight() : String {
  #if neko
Index: Hash.hx
===================================================================
RCS file: /cvsroot/haxe/std/Hash.hx,v
retrieving revision 1.33
diff -u -r1.33 Hash.hx
--- Hash.hx 7 Oct 2008 10:54:52 -0000 1.33
+++ Hash.hx 28 Jan 2009 21:01:47 -0000
@@ -89,9 +89,8 @@
  }
 
  /**
- Tells if a value exists for the given key.
- In particular, it's useful to tells if a key has
- a [null] value versus no value.
+ Tells if a value exists for the given key. In particular, it's useful to tell if
+ a key has a [null] value versus no value.
  **/
  public function exists( key : String ) : Bool {
  #if flash9
@@ -214,7 +213,6 @@
  /**
  Returns an displayable representation of the hashtable content.
  **/
-
  public function toString() {
  var s = new StringBuf();
  s.add("{");
Index: IntHash.hx
===================================================================
RCS file: /cvsroot/haxe/std/IntHash.hx,v
retrieving revision 1.13
diff -u -r1.13 IntHash.hx
--- IntHash.hx 7 Oct 2008 10:54:52 -0000 1.13
+++ IntHash.hx 28 Jan 2009 21:01:47 -0000
@@ -200,7 +200,6 @@
  /**
  Returns an displayable representation of the hashtable content.
  **/
-
  public function toString() {
  var s = new StringBuf();
  s.add("{");
Index: Lambda.hx
===================================================================
RCS file: /cvsroot/haxe/std/Lambda.hx,v
retrieving revision 1.7
diff -u -r1.7 Lambda.hx
--- Lambda.hx 16 Apr 2007 08:05:41 -0000 1.7
+++ Lambda.hx 28 Jan 2009 21:01:47 -0000
@@ -50,8 +50,8 @@
  }
 
  /**
- Creates a new [Iterable] by appling the function 'f' to all
- elements of the iterator 'it'.
+ Creates a new [List] by appling the function 'f' to all elements of the iterable
+ 'it'.
  **/
  public static function map<A,B>( it : Iterable<A>, f : A -> B ) : List<B> {
  var l = new List<B>();
Index: Reflect.hx
===================================================================
RCS file: /cvsroot/haxe/std/Reflect.hx,v
retrieving revision 1.74
diff -u -r1.74 Reflect.hx
--- Reflect.hx 3 Jan 2009 15:50:27 -0000 1.74
+++ Reflect.hx 28 Jan 2009 21:01:48 -0000
@@ -22,7 +22,6 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  * DAMAGE.
  */
-
 /**
  The Reflect API is a way to manipulate values dynamicly through an
  abstract interface in an untyped manner. Use with care.
@@ -94,7 +93,9 @@
  }
 
  /**
- Call a method with the given object and arguments.
+ Call a method with the given object and arguments.  For example, to call the "foo"
+ method with no arguments on the object "obj" use: [Reflect.callMethod(obj, Reflect.field(obj,
+ "foo"), [])].
  **/
  public #if !php inline #end static function callMethod( o : Dynamic, func : Dynamic, args : Array<Dynamic> ) : Dynamic untyped {
  #if flash9
@@ -208,7 +209,9 @@
  }
 
  /**
- Generic comparison function, does not work for methods, see [compareMethods]
+ Generic comparison function, does not work for methods, see [compareMethods.]  Can
+ only be used with objects that implement [__compare(other):Int] method.  Returns
+ null if the parameters cannot be compared.
  **/
  public static function compare<T>( a : T, b : T ) : Int {
  #if neko
@@ -220,7 +223,6 @@
 
  /**
  Compare two methods closures. Returns true if it's the same method of the same instance.
- Does not work on Neko platform.
  **/
  public static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {
  #if !neko
@@ -250,7 +252,6 @@
 
  /**
  Tells if a value is an object or not.
-
  **/
  public static function isObject( v : Dynamic ) : Bool untyped {
  #if neko
Index: String.hx
===================================================================
RCS file: /cvsroot/haxe/std/String.hx,v
retrieving revision 1.17
diff -u -r1.17 String.hx
--- String.hx 23 May 2008 14:37:16 -0000 1.17
+++ String.hx 28 Jan 2009 21:01:48 -0000
@@ -61,10 +61,9 @@
  function charCodeAt( index : Int) : Null<Int>;
 
  /**
- Returns the index of first occurence of [value]
- Returns [1-1] if [value] is not found.
- The optional [startIndex] parameter allows you to specify at which character to start searching.
- The position returned is still relative to the beginning of the string.
+ Returns the index of first occurence of [value] Returns [-1] if [value] is not found.
+ The optional [startIndex] parameter allows you to specify at which character to start
+ searching. The position returned is still relative to the beginning of the string.
  **/
  function indexOf( value : String, ?startIndex : Int ) : Int;
 
Index: haxe/FastList.hx
===================================================================
RCS file: /cvsroot/haxe/std/haxe/FastList.hx,v
retrieving revision 1.2
diff -u -r1.2 FastList.hx
--- haxe/FastList.hx 3 Apr 2008 16:15:07 -0000 1.2
+++ haxe/FastList.hx 28 Jan 2009 21:01:48 -0000
@@ -27,6 +27,9 @@
 class FastCell<T> #if flash9 implements haxe.rtti.Generic #end {
  public var elt : T;
  public var next : FastCell<T>;
+ /**
+ Creates a new empty list.
+ **/
  public function new(elt,next) { this.elt = elt; this.next = next; }
 }
 
Index: haxe/Http.hx
===================================================================
RCS file: /cvsroot/haxe/std/haxe/Http.hx,v
retrieving revision 1.43
diff -u -r1.43 Http.hx
--- haxe/Http.hx 18 Nov 2008 17:36:26 -0000 1.43
+++ haxe/Http.hx 28 Jan 2009 21:01:48 -0000
@@ -84,6 +84,10 @@
  headers.set(header,value);
  }
 
+ /**
+ Sets a parameter to be sent in the request.  Multiple parameters can be set by making
+ multiple [setParameter] calls.
+ **/
  public function setParameter( param : String, value : String ) {
  params.set(param,value);
  }
@@ -94,6 +98,9 @@
  }
  #end
 
+ /**
+ Make a request and return the server's response.
+ **/
  public function request( post : Bool ) : Void {
  var me = this;
  #if js
@@ -597,19 +604,34 @@
 
 #end
 
+ /**
+ Should be replaced with code to handle the server's response.
+ **/
  public dynamic function onData( data : String ) {
  }
 
+ /**
+ Should be replaced with error handling code.
+ **/
  public dynamic function onError( msg : String ) {
  }
 
+ /**
+ Should be replaced with status change handling code.
+ **/
  public dynamic function onStatus( status : Int ) {
  }
 
 #if !flash
  #if php
+ /**
+ Make a request and return the server's response.
+ **/
  public static function requestUrl( url : String ) : String {
  #else
+ /**
+ Make a request and return the server's response.
+ **/
  public static function request( url : String ) : String {
  #end
  var h = new Http(url);
Index: haxe/Timer.hx
===================================================================
RCS file: /cvsroot/haxe/std/haxe/Timer.hx,v
retrieving revision 1.23
diff -u -r1.23 Timer.hx
--- haxe/Timer.hx 21 Jul 2008 11:01:52 -0000 1.23
+++ haxe/Timer.hx 28 Jan 2009 21:01:48 -0000
@@ -24,6 +24,10 @@
  */
 package haxe;
 
+/**
+ Executes a function repeatedly, waiting a set amount of time between calls.  To use
+ a timer, create it and set the [run] method.
+**/
 class Timer {
  #if (neko || php)
  #else
@@ -35,6 +39,9 @@
  private var timerId : Int;
  #end
 
+ /**
+ Create a new timer that calls [run] every [time_ms] milliseconds.
+ **/
  public function new( time_ms : Int ){
  #if flash9
  var me = this;
@@ -49,6 +56,9 @@
  #end
  }
 
+ /**
+ Stops the timer.
+ **/
  public function stop() {
  if( id == null )
  return;
@@ -70,9 +80,15 @@
  id = null;
  }
 
+ /**
+ The function that the timer calls.  The timer starts when [run] is set.
+ **/
  public dynamic function run() {
  }
 
+ /**
+ Calls a function once after the specified delay.
+ **/
  public static function delay( f : Void -> Void, time_ms : Int ) {
  var t = new haxe.Timer(time_ms);
  t.run = function() {
Index: haxe/io/Output.hx
===================================================================
RCS file: /cvsroot/haxe/std/haxe/io/Output.hx,v
retrieving revision 1.9
diff -u -r1.9 Output.hx
--- haxe/io/Output.hx 28 Oct 2008 16:58:49 -0000 1.9
+++ haxe/io/Output.hx 28 Jan 2009 21:01:48 -0000
@@ -25,13 +25,15 @@
 package haxe.io;
 
 /**
- An Output is an abstract write. A specific output implementation will only
- have to override the [writeChar] and maybe the [write], [flush] and [close]
- methods. See [File.write] and [String.write] for two ways of creating an
- Output.
+ An Output is an abstract write. A specific output implementation will only have to
+ override the [writeByte] and maybe the [write], [flush] and [close] methods. See
+ [File.write] and [String.write] for two ways of creating an Output.
 **/
 class Output {
 
+ /**
+ If true, output is written in big endian format.  Default is false.
+ **/
  public var bigEndian(default,setEndian) : Bool;
 
  public function writeByte( c : Int ) : Void {
Index: haxe/xml/Fast.hx
===================================================================
RCS file: /cvsroot/haxe/std/haxe/xml/Fast.hx,v
retrieving revision 1.8
diff -u -r1.8 Fast.hx
--- haxe/xml/Fast.hx 16 May 2008 11:06:03 -0000 1.8
+++ haxe/xml/Fast.hx 28 Jan 2009 21:01:49 -0000
@@ -109,6 +109,10 @@
 
 }
 
+/**
+ See the tutorial <a href="/doc/advanced/xml_fast" class="intern">Using haxe.xml.Fast</a>
+ for complete documentation of this class.
+**/
 class Fast {
 
  public var x(default,null) : Xml;
Index: haxe/xml/Proxy.hx
===================================================================
RCS file: /cvsroot/haxe/std/haxe/xml/Proxy.hx,v
retrieving revision 1.3
diff -u -r1.3 Proxy.hx
--- haxe/xml/Proxy.hx 16 May 2008 11:06:03 -0000 1.3
+++ haxe/xml/Proxy.hx 28 Jan 2009 21:01:49 -0000
@@ -23,24 +23,20 @@
  * DAMAGE.
  */
 package haxe.xml;
-
 /**
- This proxy can be inherited with an XML file name parameter.
- It will only allow access to fields which corresponds to an "id" attribute
- value in the XML file :
-
- [
- class MyXml extends haxe.xml.Proxy<"my.xml",MyStructure> {
- }
- ...
- var h = new Hash<MyStructure>();
- // ... fill h with "my.xml" content
- var m = new MyXml(h.get);
- trace(m.myNode.structField);
- // access to "myNode" is only possible
- // if you have an id="myNode" attribute
- // in your XML, and completion works as well
- ]
+ This proxy can be inherited with an XML file name parameter. It will only allow access
+ to fields which corresponds to an "id" attribute value in the XML file.
+ [[
+ class MyXml extends haxe.xml.Proxy<"my.xml", MyStructure> { }
+
+ // ... fill h with "my.xml" content
+ var h = new Hash<MyStructure>();
+ var m = new MyXml(h.get);
+
+ // access to "myNode" is only possible if you have
+ // an id="myNode" attribute in your XML, and completion works as well
+ trace(m.myNode.structField);
+ ]]
 **/
 class Proxy<Const,T> {
 
Index: neko/FileSystem.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/FileSystem.hx,v
retrieving revision 1.8
diff -u -r1.8 FileSystem.hx
--- neko/FileSystem.hx 27 Jan 2007 11:44:12 -0000 1.8
+++ neko/FileSystem.hx 28 Jan 2009 21:01:49 -0000
@@ -44,16 +44,28 @@
  kother( k : String );
 }
 
+/**
+ Contains a collection of static functions for working with files and directories.
+**/
 class FileSystem {
 
+ /**
+ Returns true if a file or directory exists at the given path.
+ **/
  public static function exists( path : String ) : Bool {
  return sys_exists(untyped path.__s);
  }
 
+ /**
+ Renames a file or directory.
+ **/
  public static function rename( path : String, newpath : String ) {
  untyped sys_rename(path.__s,newpath.__s);
  }
 
+ /**
+ Gets file info such as its size, owner, timestamps, etc.
+ **/
  public static function stat( path : String ) : FileStat {
  var s : FileStat = sys_stat(untyped path.__s);
  s.atime = untyped Date.new1(s.atime);
@@ -62,10 +74,16 @@
  return s;
  }
 
+ /**
+ Returns the absolute path for the given relative path.
+ **/
  public static function fullPath( relpath : String ) : String {
  return new String(file_full_path(untyped relpath.__s));
  }
 
+ /**
+ Tells if the given path points to a file, directory, or other.
+ **/
  public static function kind( path : String ) : FileKind {
  var k = new String(sys_file_type(untyped path.__s));
  return switch(k) {
@@ -75,22 +93,38 @@
  }
  }
 
+ /**
+ Returns true if the given path points to a directory.
+ **/
  public static function isDirectory( path : String ) : Bool {
  return kind(path) == kdir;
  }
 
+ /**
+ Create a directory at the given path.  Fails if the new directory's parent doesn't
+ exist.
+ **/
  public static function createDirectory( path : String ) {
  sys_create_dir( untyped path.__s, 493 );
  }
 
+ /**
+ Delete the file at the given path.
+ **/
  public static function deleteFile( path : String ) {
  file_delete(untyped path.__s);
  }
 
+ /**
+ Delete the directory at the given path.  Fails if the directory is not empty.
+ **/
  public static function deleteDirectory( path : String ) {
  sys_remove_dir(untyped path.__s);
  }
 
+ /**
+ Gets the list of files and subdirectories in the given directory.
+ **/
  public static function readDirectory( path : String ) : Array<String> {
  var l : Array<Dynamic> = sys_read_dir(untyped path.__s);
  var a = new Array();
Index: neko/Lib.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/Lib.hx,v
retrieving revision 1.18
diff -u -r1.18 Lib.hx
--- neko/Lib.hx 22 Jun 2008 15:46:11 -0000 1.18
+++ neko/Lib.hx 28 Jan 2009 21:01:49 -0000
@@ -125,7 +125,8 @@
  }
 
  /**
- Converts a Neko value to its haXe equivalent. Used to unwrap String and Arrays Objects into raw Neko values.
+ Converts a haXe value to its Neko equivalent. Used to unwrap String and Arrays Objects
+ into raw Neko values.
  **/
  public static function haxeToNeko( v : Dynamic ) : Dynamic untyped {
  switch( __dollar__typeof(v) ) {
Index: neko/Sys.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/Sys.hx,v
retrieving revision 1.8
diff -u -r1.8 Sys.hx
--- neko/Sys.hx 31 Jan 2008 14:02:30 -0000 1.8
+++ neko/Sys.hx 28 Jan 2009 21:01:49 -0000
@@ -41,6 +41,9 @@
  return r;
  }
 
+ /**
+ Returns the given environment string.
+ **/
  public static function getEnv( s : String ) {
  var v = get_env(untyped s.__s);
  if( v == null )
@@ -60,14 +63,23 @@
  return set_time_locale(untyped loc.__s);
  }
 
+ /**
+ Returns the current working directory of the main neko process.
+ **/
  public static function getCwd() : String {
  return new String(get_cwd());
  }
 
+ /**
+ Sets the current working directory of the main neko process.
+ **/
  public static function setCwd( s : String ) {
  set_cwd(untyped s.__s);
  }
 
+ /**
+ Returns the name of the current platform.
+ **/
  public static function systemName() : String {
  return new String(sys_string());
  }
@@ -111,6 +123,9 @@
  return new String(sys_exe_path());
  }
 
+ /**
+ Returns a Hash table containing system's environment variables.
+ **/
  public static function environment() : Hash<String> {
  var l : Array<Dynamic> = sys_env();
  var h = new Hash();
Index: neko/Web.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/Web.hx,v
retrieving revision 1.24
diff -u -r1.24 Web.hx
--- neko/Web.hx 21 Jul 2008 07:18:50 -0000 1.24
+++ neko/Web.hx 28 Jan 2009 21:01:49 -0000
@@ -46,9 +46,9 @@
  }
 
  /**
- Returns an Array of Strings built using GET / POST values.
- If you have in your URL the parameters [a[]=foo;a[]=hello;a[5]=bar;a[3]=baz] then
- [neko.Web.getParamValues("a")] will return [["foo","hello",null,"baz",null,"bar"]]
+ Returns an Array of Strings built using GET / POST values. If you have in your URL
+ the parameters [a=foo; a=hello;a[[5]]=bar; a[[3]]=baz] then [neko.Web.getParamValues("a")]
+ will return [["foo","hello",null,"baz",null,"bar"]]
  **/
  public static function getParamValues( param : String ) : Array<String> {
  var reg = new EReg("^"+param+"(\\[|%5B)([0-9]*?)(\\]|%5D)=(.*?)$", "");
Index: neko/db/Sqlite.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/db/Sqlite.hx,v
retrieving revision 1.10
diff -u -r1.10 Sqlite.hx
--- neko/db/Sqlite.hx 3 Nov 2007 13:25:53 -0000 1.10
+++ neko/db/Sqlite.hx 28 Jan 2009 21:01:49 -0000
@@ -181,8 +181,17 @@
 
 }
 
+/**
+ SQLite is a very lightweight SQL database that stores its content into a single file
+ on the hard drive. It means that it's perfectly suited for desktop application or
+ when developing a website.
+**/
 class Sqlite {
 
+ /**
+ Opens a database file to read and write. If file does not exist it creates a new
+ one. Once the database is either opened or created, a Connection object is returned.
+ **/
  public static function open( file : String ) : Connection {
  return new SqliteConnection(file);
  }
Index: neko/io/File.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/io/File.hx,v
retrieving revision 1.5
diff -u -r1.5 File.hx
--- neko/io/File.hx 21 May 2008 10:30:31 -0000 1.5
+++ neko/io/File.hx 28 Jan 2009 21:01:49 -0000
@@ -38,26 +38,44 @@
 **/
 class File {
 
+ /**
+ Read the specified file, return its content as a [String].
+ **/
  public static function getContent( path : String ) {
  return new String(file_contents(untyped path.__s));
  }
 
+ /**
+ Read the specified file, return its content as a [Bytes] object.
+ **/
  public static function getBytes( path : String ) {
  return neko.Lib.bytesReference(getContent(path));
  }
 
+ /**
+ Open a File for reading.
+ **/
  public static function read( path : String, binary : Bool ) {
  return new FileInput(untyped file_open(path.__s,(if( binary ) "rb" else "r").__s));
  }
 
+ /**
+ Open a file for writing.
+ **/
  public static function write( path : String, binary : Bool ) {
  return new FileOutput(untyped file_open(path.__s,(if( binary ) "wb" else "w").__s));
  }
 
+ /**
+ Open a file to append to it.
+ **/
  public static function append( path : String, binary : Bool ) {
  return new FileOutput(untyped file_open(path.__s,(if( binary ) "ab" else "a").__s));
  }
 
+ /**
+ Copies the file at [src] to a file named [dst].  If [dst] exists it will be overwritten.
+ **/
  public static function copy( src : String, dst : String ) {
  var s = read(src,true);
  var d = write(dst,true);
@@ -66,18 +84,30 @@
  d.close();
  }
 
+ /**
+ The current program's stdin stream.
+ **/
  public static function stdin() {
  return new FileInput(file_stdin());
  }
 
+ /**
+ The current program's stdout stream.
+ **/
  public static function stdout() {
  return new FileOutput(file_stdout());
  }
 
+ /**
+ The current program's stderr output stream.
+ **/
  public static function stderr() {
  return new FileOutput(file_stderr());
  }
 
+ /**
+ Reads a character from the console.  Can be used to cause a program to wait for input.
+ **/
  public static function getChar( echo : Bool ) : Int {
  return getch(echo);
  }
Index: neko/io/FileInput.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/io/FileInput.hx,v
retrieving revision 1.8
diff -u -r1.8 FileInput.hx
--- neko/io/FileInput.hx 26 Jan 2009 07:36:50 -0000 1.8
+++ neko/io/FileInput.hx 28 Jan 2009 21:01:49 -0000
@@ -63,10 +63,16 @@
  file_close(__f);
  }
 
+ /**
+ Move the read position to the specified place.
+ **/
  public function seek( p : Int, pos : FileSeek ) {
  file_seek(__f,p,switch( pos ) { case SeekBegin: 0; case SeekCur: 1; case SeekEnd: 2; });
  }
 
+ /**
+ Returns the current position in the file.
+ **/
  public function tell() : Int {
  return file_tell(__f);
  }
Index: neko/io/FileOutput.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/io/FileOutput.hx,v
retrieving revision 1.5
diff -u -r1.5 FileOutput.hx
--- neko/io/FileOutput.hx 26 Jan 2009 07:36:54 -0000 1.5
+++ neko/io/FileOutput.hx 28 Jan 2009 21:01:49 -0000
@@ -53,10 +53,16 @@
  file_close(__f);
  }
 
+ /**
+ Move the current position in the file to the specified place.
+ **/
  public function seek( p : Int, pos : FileSeek ) {
  file_seek(__f,p,switch( pos ) { case SeekBegin: 0; case SeekCur: 1; case SeekEnd: 2; });
  }
 
+ /**
+ Returns the current position in the file.
+ **/
  public function tell() : Int {
  return file_tell(__f);
  }
Index: neko/io/Process.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/io/Process.hx,v
retrieving revision 1.5
diff -u -r1.5 Process.hx
--- neko/io/Process.hx 29 Sep 2008 10:22:31 -0000 1.5
+++ neko/io/Process.hx 28 Jan 2009 21:01:49 -0000
@@ -88,13 +88,28 @@
 
 }
 
+/**
+ Similar to [neko.Sys.command], but allows more control.
+**/
 class Process {
 
  var p : Void;
+ /**
+ The process' stdout stream.
+ **/
  public var stdout(default,null) : haxe.io.Input;
+ /**
+ The process' stderr stream.
+ **/
  public var stderr(default,null) : haxe.io.Input;
+ /**
+ The process' stdin stream.  Call [close] to send the EOT.
+ **/
  public var stdin(default,null) : haxe.io.Output;
 
+ /**
+ Creates the new process, passes in the given args.  [args] must not be [null].
+ **/
  public function new( cmd : String, args : Array<String> ) {
  p = try _run(untyped cmd.__s,neko.Lib.haxeToNeko(args)) catch( e : Dynamic ) throw "Process creation failure : "+cmd;
  stdin = new Stdin(p);
@@ -102,14 +117,23 @@
  stderr = new Stdout(p,false);
  }
 
+ /**
+ Returns the process' pid.
+ **/
  public function getPid() : Int {
  return _pid(p);
  }
 
+ /**
+ Returns the process' exit code.  This blocks until the process completes.
+ **/
  public function exitCode() : Int {
  return _exit(p);
  }
 
+ /**
+ Closes the process I/O.
+ **/
  public function close() {
  _close(p);
  }
Index: neko/net/Host.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/net/Host.hx,v
retrieving revision 1.4
diff -u -r1.4 Host.hx
--- neko/net/Host.hx 16 May 2008 17:31:26 -0000 1.4
+++ neko/net/Host.hx 28 Jan 2009 21:01:49 -0000
@@ -28,16 +28,28 @@
 
 class Host {
 
+ /**
+ IP Address stored as an Int32.
+ **/
  public var ip(default,null) : haxe.Int32;
 
+ /**
+ Resolve the given host string into an IP address.
+ **/
  public function new( name : String ) {
  ip = host_resolve(untyped name.__s);
  }
 
+ /**
+ Return a string representation of the IP address.
+ **/
  public function toString() : String {
  return new String(host_to_string(ip));
  }
 
+ /**
+ Reverse the DNS of the given IP address.
+ **/
  public function reverse() {
  return new String(host_reverse(ip));
  }
Index: neko/net/Poll.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/net/Poll.hx,v
retrieving revision 1.2
diff -u -r1.2 Poll.hx
--- neko/net/Poll.hx 30 Jan 2008 17:11:51 -0000 1.2
+++ neko/net/Poll.hx 28 Jan 2009 21:01:49 -0000
@@ -24,6 +24,9 @@
  */
 package neko.net;
 
+/**
+ Polls multiple non-blocking sockets with a single thread.
+**/
 class Poll {
 
  var d : Void;
@@ -35,6 +38,9 @@
  readIndexes = writeIndexes = untyped __dollar__array(-1);
  }
 
+ /**
+ Prepare a poll for scanning events on sets of sockets.
+ **/
  public function prepare( read : Array<Socket>, write : Array<Socket> ) {
  untyped {
  var r = __dollar__amake(read.length);
@@ -57,10 +63,18 @@
  }
  }
 
+ /**
+ Update the read/write flags arrays that were created with [prepare].
+ **/
  public function events( ?t : Float ) {
  socket_poll_events(d,t);
  }
 
+ /**
+ Perform a polling for data available over a given set of sockets. This is similar
+ to [socket_select] except that [socket_select] is limited to a given number of simultaneous
+ sockets to check.
+ **/
  public function poll( a : Array<Socket>, ?t : Float ) : Array<Socket> {
  untyped {
  var c = __dollar__hnew(16);
Index: neko/net/Socket.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/net/Socket.hx,v
retrieving revision 1.7
diff -u -r1.7 Socket.hx
--- neko/net/Socket.hx 23 Jun 2007 14:59:19 -0000 1.7
+++ neko/net/Socket.hx 28 Jan 2009 21:01:49 -0000
@@ -29,19 +29,35 @@
 enum SocketHandle {
 }
 
+/**
+ Sockets are used for networking communication.
+**/
 class Socket {
 
  private var __s : SocketHandle;
+ /**
+ Used for reading from a connected socket.
+ **/
  public var input(default,null) : SocketInput;
+ /**
+ Used for writing to a connected socket.
+ **/
  public var output(default,null) : SocketOutput;
  public var custom : Dynamic;
 
+ /**
+ Create a new TCP socket.  If [s] is specified, the new socket object will use the
+ native socket associated with the given handle.
+ **/
  public function new( ?s ) {
  __s = if( s == null ) socket_new(false) else s;
  input = new SocketInput(__s);
  output = new SocketOutput(__s);
  }
 
+ /**
+ Close a socket. Any subsequent operation on this socket will fail.
+ **/
  public function close() : Void {
  socket_close(__s);
  untyped {
@@ -52,14 +68,24 @@
  output.close();
  }
 
+ /**
+ Read the whole content of a the data available from a socket until the connection
+ close. If the socket hasn't been close by the other side, the function might block.
+ **/
  public function read() : String {
  return socket_read(__s);
  }
 
+ /**
+ Send the whole content of a string over a connected socket.
+ **/
  public function write( content : String ) {
  socket_write(__s, untyped content.__s);
  }
 
+ /**
+ Connect the socket the given [host] and [port].
+ **/
  public function connect(host : Host, port : Int) {
  try {
  socket_connect(__s, host.ip, port);
@@ -71,22 +97,37 @@
  }
  }
 
+ /**
+ Listen for a number of connections.
+ **/
  public function listen(connections : Int) {
  socket_listen(__s, connections);
  }
 
+ /**
+ Prevent the socket from further reading or writing or both.
+ **/
  public function shutdown( read : Bool, write : Bool ){
  socket_shutdown(__s,read,write);
  }
 
+ /**
+ Bind the socket for server usage on the given host and port.
+ **/
  public function bind(host : Host, port : Int) {
  socket_bind(__s, host.ip, port);
  }
 
+ /**
+ Accept an incoming connection request.
+ **/
  public function accept() : Socket {
  return new Socket(socket_accept(__s));
  }
 
+ /**
+ Return the socket connected peer address composed of an (host,port) array.
+ **/
  public function peer() : { host : Host, port : Int } {
  var a : Dynamic = socket_peer(__s);
  var h = new Host("127.0.0.1");
@@ -94,6 +135,9 @@
  return { host : h, port : a[1] };
  }
 
+ /**
+ Return the socket local address composed of an (host,port) array.
+ **/
  public function host() : { host : Host, port : Int } {
  var a : Dynamic = socket_host(__s);
  var h = new Host("127.0.0.1");
@@ -101,6 +145,9 @@
  return { host : h, port : a[1] };
  }
 
+ /**
+ Set the socket send and recv timeout in seconds to the given value (or null for blocking).
+ **/
  public function setTimeout( timeout : Float ) {
  socket_set_timeout(__s, timeout);
  }
@@ -109,10 +156,16 @@
  select([this],null,null,null);
  }
 
+ /**
+ Turn on/off the socket blocking mode.
+ **/
  public function setBlocking( b : Bool ) {
  socket_set_blocking(__s,b);
  }
 
+ /**
+ Create a new UDP socket.
+ **/
  public static function newUdpSocket() {
  return new Socket(socket_new(true));
  }
Index: neko/net/ThreadServer.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/net/ThreadServer.hx,v
retrieving revision 1.12
diff -u -r1.12 ThreadServer.hx
--- neko/net/ThreadServer.hx 20 May 2008 13:52:47 -0000 1.12
+++ neko/net/ThreadServer.hx 28 Jan 2009 21:01:49 -0000
@@ -39,6 +39,12 @@
  var bufpos : Int;
 }
 
+/**
+ The ThreadServer can be used to easily create a multithreaded server where each thread
+ polls multiple connections.  To use it, at a minimum you must override or rebind
+ [clientConnected], [readClientMessage], and [clientMessage] and you must define your
+ [Client] and [Message].
+**/
 class ThreadServer<Client,Message> {
 
  var threads : Array<ThreadInfos>;
@@ -55,6 +61,9 @@
  public var updateTime : Float;
  public var maxSockPerThread : Int;
 
+ /**
+ Creates a ThreadServer.
+ **/
  public function new() {
  threads = new Array();
  nthreads = if( neko.Sys.systemName() == "Windows" ) 150 else 10;
@@ -155,6 +164,9 @@
  }
  }
 
+ /**
+ Internally used to delegate something to the worker thread.
+ **/
  public function work( f : Void -> Void ) {
  worker.sendMessage(f);
  }
@@ -202,11 +214,17 @@
  }
  }
 
+ /**
+ Called when the server gets a new connection.
+ **/
  public function addSocket( s : neko.net.Socket ) {
  s.setBlocking(false);
  work(callback(addClient,s));
  }
 
+ /**
+ Start the server at the specified host and port.
+ **/
  public function run( host, port ) {
  sock = new neko.net.Socket();
  sock.bind(new neko.net.Host(host),port);
@@ -221,6 +239,9 @@
  }
  }
 
+ /**
+ Sends data to a client.
+ **/
  public function sendData( s : neko.net.Socket, data : String ) {
  try {
  s.write(data);
@@ -229,6 +250,9 @@
  }
  }
 
+ /**
+ Shutdown a client's connection and remove them from the server.
+ **/
  public function stopClient( s : neko.net.Socket ) {
  var infos : ClientInfos<Client> = s.custom;
  try s.shutdown(true,true) catch( e : Dynamic ) { };
@@ -237,19 +261,34 @@
 
  // --- CUSTOMIZABLE API ---
 
+ /**
+ Called when an error has occurred.
+ **/
  public dynamic function onError( e : Dynamic, stack ) {
  var estr = try Std.string(e) catch( e2 : Dynamic ) "???" + try "["+Std.string(e2)+"]" catch( e : Dynamic ) "";
  errorOutput.writeString( estr + "\n" + haxe.Stack.toString(stack) );
  errorOutput.flush();
  }
 
+ /**
+ Called when a client connects.  Returns a client object.
+ **/
  public dynamic function clientConnected( s : neko.net.Socket ) : Client {
  return null;
  }
 
+ /**
+ Called when a client disconnects or an error forces the connection to close.
+ **/
  public dynamic function clientDisconnected( c : Client ) {
  }
 
+ /**
+ Called when data has been read from a socket.  This method should try to extract
+ a message from the buffer.  The available data resides in [buf,] starts at [pos,]
+ and is [len] bytes wide.  Return the new message and the number of bytes read from
+ the buffer.  If no message could be read, return [null].
+ **/
  public dynamic function readClientMessage( c : Client, buf : haxe.io.Bytes, pos : Int, len : Int ) : { msg : Message, bytes : Int } {
  return {
  msg : null,
@@ -257,12 +296,22 @@
  };
  }
 
+ /**
+ Called when a message has been received.  Message handling code should go here.
+ **/
  public dynamic function clientMessage( c : Client, msg : Message ) {
  }
 
+ /**
+ This method is called periodically.  It can be used to do server maintenance.
+ **/
  public dynamic function update() {
  }
 
+ /**
+ Called after a client connects, disconnects, a message is received, or an update
+ is performed.
+ **/
  public dynamic function afterEvent() {
  }
 
Index: neko/vm/Deque.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/vm/Deque.hx,v
retrieving revision 1.1
diff -u -r1.1 Deque.hx
--- neko/vm/Deque.hx 28 Jul 2008 07:33:28 -0000 1.1
+++ neko/vm/Deque.hx 28 Jan 2009 21:01:49 -0000
@@ -24,17 +24,32 @@
  */
 package neko.vm;
 
+/**
+ A double ended queue.  Elements can be added to either end.  The deque is thread
+ safe.
+**/
 class Deque<T> {
  var q : Void;
  public function new() {
  q = deque_create();
  }
+ /**
+ Add and element to the end of the deque.
+ **/
  public function add( i : T ) {
  deque_add(q,i);
  }
+ /**
+ Push an element into the beginning of the deque.
+ **/
  public function push( i : T ) {
  deque_push(q,i);
  }
+ /**
+ Removes the first element and returns it.  If [block] is true and the deque is empty,
+ the function blocks until a function is added.  If [block] is false and the deque
+ is empty, the function returns [null] immediately.
+ **/
  public function pop( block : Bool ) : T {
  return deque_pop(q,block);
  }
Index: neko/vm/Loader.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/vm/Loader.hx,v
retrieving revision 1.3
diff -u -r1.3 Loader.hx
--- neko/vm/Loader.hx 31 Jul 2008 15:37:29 -0000 1.3
+++ neko/vm/Loader.hx 28 Jan 2009 21:01:49 -0000
@@ -23,7 +23,6 @@
  * DAMAGE.
  */
 package neko.vm;
-
 /**
  The Neko object that implements the loader.
 **/
@@ -33,17 +32,14 @@
 /**
  Loaders can be used to dynamicly load Neko primitives stored in NDLL libraries.
 
-
- Loaders can be used to dynamicly load other Neko modules (.n bytecode files).
- Modules are referenced by names. To lookup the corresponding bytecode file, the
- default loader first look in its cache, then eventually adds the .n extension
- to the name and lookup the bytecode in its path.
-
-
- Loaders can be used for sandbox security. When a Module is loaded with a given
- Loader, this loader can manager the module security by filtering which
- primitives can be loaded by this module or by rewrapping them at loading-time
- with custom securized versions. Loaders are inherited in loaded submodules.
+ Loaders can be used to dynamicly load other Neko modules (.n bytecode files). Modules
+ are referenced by names. To lookup the corresponding bytecode file, the default loader
+ first look in its cache, then eventually adds the .n extension to the name and lookup
+ the bytecode in its path.
+
+ Loaders can be used for sandbox security. When a Module is loaded with a given Loader, this
+ loader can filter which primitives can be loaded by this module or can rewrap them at
+ loading-time with custom securized versions. Loaders are inherited in loaded submodules.
 **/
 class Loader {
 
Index: neko/vm/Lock.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/vm/Lock.hx,v
retrieving revision 1.1
diff -u -r1.1 Lock.hx
--- neko/vm/Lock.hx 6 Nov 2006 16:35:36 -0000 1.1
+++ neko/vm/Lock.hx 28 Jan 2009 21:01:49 -0000
@@ -26,12 +26,23 @@
 
 class Lock {
  var l : Void;
+ /**
+ Creates a lock which is initially locked.
+ **/
  public function new() {
  l = lock_create();
  }
+ /**
+ Waits for a lock to be released and acquire it. If [timeout] (in seconds) is
+ not null and expires then the returned value is false.
+ **/
  public function wait( ?timeout : Float ) : Bool {
  return lock_wait(l,timeout);
  }
+ /**
+ Release a lock. The thread does not need to own the lock to be able to release
+ it. If a lock is released several times, it can be acquired as many times.
+ **/
  public function release() {
  lock_release(l);
  }
Index: neko/vm/Module.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/vm/Module.hx,v
retrieving revision 1.4
diff -u -r1.4 Module.hx
--- neko/vm/Module.hx 15 Sep 2008 15:30:11 -0000 1.4
+++ neko/vm/Module.hx 28 Jan 2009 21:01:49 -0000
@@ -40,6 +40,10 @@
  The abstract handle.
  **/
  public var m : ModuleHandle;
+ /**
+ Returns the Module name. This is the name that the Module was loaded with by the
+ Loader.
+ **/
  public var name(getName,setName) : String;
 
  public function new( m ) {
Index: neko/vm/Mutex.hx
===================================================================
RCS file: /cvsroot/haxe/std/neko/vm/Mutex.hx,v
retrieving revision 1.1
diff -u -r1.1 Mutex.hx
--- neko/vm/Mutex.hx 25 Jul 2008 09:00:14 -0000 1.1
+++ neko/vm/Mutex.hx 28 Jan 2009 21:01:49 -0000
@@ -24,17 +24,35 @@
  */
 package neko.vm;
 
+/**
+ A mutex can be used to allow only one thread at a time to execute a block of code.
+ Usually that code operates on shared data.
+**/
 class Mutex {
  var m : Void;
  public function new() {
  m = mutex_create();
  }
+ /**
+ The calling thread locks the mutex.  If another thread has already locked the mutex,
+ the calling thread will block until it is released.  A thread can acquire a mutex
+ it already has, but will have to release it twice as well.
+ **/
  public function acquire() {
  mutex_acquire(m);
  }
+ /**
+ If the mutex is not locked, the calling thread locks it and returns true.  If the
+ mutex is locked, the calling thread returns false immediately.
+ **/
  public function tryAcquire() : Bool {
  return mutex_try(m);
  }
+ /**
+ The calling thread releases its lock on the mutex, allowing  another thread to acquire
+ it.  If there are multiple threads blocking, only one will acquire the lock; the
+ others will continue blocking.
+ **/
  public function release() {
  mutex_release(m);
  }

--
haXe - an open source web programming language
http://haxe.org