32 Commits
Author SHA1 Message Date
Ryan 0d780fe6b8 Free pointer with delete, since created with new 2009-06-10 15:24:14 +02:00
Ryan b260a9108b Add errno constants. Move all constants to node.constants namespace. 2009-05-26 19:48:49 +02:00
Ryan 3bdd042a6e Rename fatal_exception to FatalException 2009-05-26 18:18:17 +02:00
Ryan c326614c8d More docs. Add rmdir and unlink. 2009-05-26 12:11:31 +02:00
Ryan a9f29cd18d File I/O documentation. Remove necessity of class="sh_javascript". 2009-05-26 11:39:40 +02:00
Ryan d1b0ce6d37 Large refactor of file code.
All the c++ code is now reduced to simple wrappers. The node.fs.File object
is defined entirely in javascript now. As is the actionQueue methods.

This makes the boundaries much cleaner. There is still some thought that
needs to go into how exactly the API should behave but this simplification
is a first step.
2009-05-26 03:30:51 +02:00
Ryan 5c2389fada Remove error codes from file on_completion callbacks. Use file.onError.
The error codes still remain for the two general file system operations:
rename and stat.

Additionally I've removed the actionQueue for file system operations. They
are sent directly into the thread pool.
2009-05-25 13:17:35 +02:00
Ryan 58c13e5192 Namespace File stuff in node.fs 2009-05-21 12:49:41 +02:00
Ryan 6244f77822 Beginnings of file i/o docs. Finish up timers. 2009-05-21 12:33:57 +02:00
Ryan baed9d514d Inform V8 of external allocations.
This is sloppy: after each ObjectWrap allocation the user needs to
call ObjectWrap::InformV8ofAllocation(). In addition each class deriving
from  ObjectWrap needs to implement the virtual method size() which should
return the size of the derived class. If I was better at C++ I could
possibly make this less ugly. For now this is how it is.

Memory usage looks much better after this commit.
2009-05-15 16:28:10 +02:00
Ryan 427e3f5dcb Introduce NODE_SET_PROTOTYPE_METHOD which properly sets the signature. 2009-05-14 13:16:45 +02:00
Ryan ba17940551 Add accessor File#encoding 2009-05-07 16:15:07 +02:00
Ryan cfd61622ae Reference counting. Network bugs.
Connections were being garbage collected while they were still in progress
since the object would leave scope. This commit adds ObjectWrap::Attach()
and ObjectWrap::Detach() to tell v8 that an object is currently on the event
loop and will be needed in the future.

Other changes to oi_socket.c and net.cc are to fix bugs encountered while
running the HTTP server.
2009-05-05 18:15:59 +02:00
Ryan fd392d0a50 Remove if (pointer == NULL) after allocations with new.
I'm still learning C++.
2009-04-29 14:05:25 +02:00
Ryan 064c8f0252 Use ObjectWrap base class for File, Socket, Server. 2009-04-29 01:07:19 +02:00
Ryan cf1c58063e Create a node namespace
Part of general reorganization.
2009-04-28 23:09:56 +02:00
Ryan 0ea7577a72 sign error on file position argument 2009-04-23 15:07:54 +02:00
Ryan 0b1e3240be add position arguments to File#read and File#write 2009-04-23 12:10:57 +02:00
Ryan d996b59d9c fix some errors/memleaks 2009-04-22 15:48:29 +02:00
Ryan 47fad676b4 Rename JS_ to NODE_ for method macros. add marcos to timers.cc 2009-04-21 15:55:11 +02:00
Ryan 102c6399ac rename NewFile to File::New 2009-04-18 14:34:56 +02:00
Ryan e7dd20dc6e add File.stat File.exists File.strerror 2009-04-18 10:58:41 +02:00
Ryan 5207226da3 fix a bug with eio polling. 2009-04-18 02:01:23 +02:00
Ryan dd691decd2 file system methods to be queued. 2009-04-17 18:54:29 +02:00
Ryan c8e20fbf81 add file.read only. raw encoding right now. 2009-04-16 21:05:41 +02:00
Ryan 12d31dd0b7 file operations are queued. 2009-04-16 20:09:55 +02:00
Ryan e303d950d9 add stdout stderr global file objects. remove node.blocking.print 2009-04-16 13:58:10 +02:00
Ryan c0b90ca763 only store fd in javascript (not in c++) 2009-04-16 13:42:34 +02:00
Ryan 470c6342cc Change symantics of file.open. Now takes a callback argument. 2009-04-16 13:20:35 +02:00
Ryan 7e1350f6e4 add file.write() 2009-04-16 11:37:44 +02:00
Ryan e8ce6ef790 add file open/close 2009-04-15 21:23:10 +02:00
Ryan 63a9cd3897 everything is changed. i've waited much too long to commit.
this is awful. i'm sorry for being so messy.
2009-04-15 10:08:28 +02:00