diff options
| author | Igor Pashev <pashev.igor@gmail.com> | 2012-04-25 18:39:18 +0400 |
|---|---|---|
| committer | Igor Pashev <pashev.igor@gmail.com> | 2012-04-25 18:39:18 +0400 |
| commit | c37f95899f4c409cee9b68efd6dd8a792d0b20df (patch) | |
| tree | 9116a5c89202c8739db0d4f08246e1e565beaca4 | |
| parent | 60ac3874f814654dbe882b7b2f582c0dd45c34ff (diff) | |
| download | node-augeas-c37f95899f4c409cee9b68efd6dd8a792d0b20df.tar.gz | |
Renamed heracles() to createAugeas()
| -rw-r--r-- | examples/heracles.js | 3 | ||||
| -rw-r--r-- | libaugeas.cc | 19 |
2 files changed, 11 insertions, 11 deletions
diff --git a/examples/heracles.js b/examples/heracles.js index 2df4e67..476a114 100644 --- a/examples/heracles.js +++ b/examples/heracles.js @@ -1,7 +1,6 @@ var aug = require('../build/Release/libaugeas'); -var heracles = aug.heracles; -heracles(function(aug) { +aug.createAugeas(function(aug) { if (!aug.error()) { console.log(aug.get('/files/etc/hosts/1/ipaddr')); } else { diff --git a/libaugeas.cc b/libaugeas.cc index 1b738db..76424e8 100644 --- a/libaugeas.cc +++ b/libaugeas.cc @@ -548,7 +548,7 @@ LibAugeas::~LibAugeas() } -struct HeraclesUV { +struct CreateAugeasUV { uv_work_t request; Persistent<Function> callback; std::string lens; // TODO: maybe array @@ -562,11 +562,11 @@ struct HeraclesUV { * This function should immediately return if any call to augeas API fails. * The caller should check aug_error() before doing anything. */ -void heraclesWork(uv_work_t *req) +void createAugeasWork(uv_work_t *req) { int rc = AUG_NOERROR; - HeraclesUV *her = static_cast<HeraclesUV*>(req->data); + CreateAugeasUV *her = static_cast<CreateAugeasUV*>(req->data); unsigned int flags = AUG_NO_ERR_CLOSE; @@ -622,10 +622,10 @@ void heraclesWork(uv_work_t *req) } } -void heraclesAfter(uv_work_t* req) +void createAugeasAfter(uv_work_t* req) { HandleScope scope; - HeraclesUV *her = static_cast<HeraclesUV*>(req->data); + CreateAugeasUV *her = static_cast<CreateAugeasUV*>(req->data); if (AUG_NOERROR == aug_error(her->aug)) { Local<Value> argv[] = {LibAugeas::New(her->aug)}; @@ -640,7 +640,7 @@ void heraclesAfter(uv_work_t* req) delete her; } -Handle<Value> heracles(const Arguments& args) +Handle<Value> createAugeas(const Arguments& args) { HandleScope scope; Local<Function> callback; @@ -653,12 +653,12 @@ Handle<Value> heracles(const Arguments& args) callback = Local<Function>::Cast(args[0]); } - HeraclesUV *her = new HeraclesUV(); + CreateAugeasUV *her = new CreateAugeasUV(); her->request.data = her; her->callback = Persistent<Function>::New(callback); uv_queue_work(uv_default_loop(), &her->request, - heraclesWork, heraclesAfter); + createAugeasWork, createAugeasAfter); return scope.Close(Undefined()); } @@ -669,7 +669,8 @@ void init(Handle<Object> target) { LibAugeas::Init(target); - target->Set(String::NewSymbol("heracles"), FunctionTemplate::New(heracles)->GetFunction()); + target->Set(String::NewSymbol("createAugeas"), + FunctionTemplate::New(createAugeas)->GetFunction()); } NODE_MODULE(libaugeas, init) |
