summaryrefslogtreecommitdiff
path: root/src/tty_wrap.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-09-22 19:55:15 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-09-27 13:03:28 -0700
commite1dc6e6d73eeb43c3f5366e0f316c91a32e513f9 (patch)
treeef5a829a4dd2d5c00f202a4661cce0347fd02450 /src/tty_wrap.cc
parent1de156abb10e646c05485d95dfce6d1805514822 (diff)
downloadandroid-node-v8-e1dc6e6d73eeb43c3f5366e0f316c91a32e513f9.tar.gz
android-node-v8-e1dc6e6d73eeb43c3f5366e0f316c91a32e513f9.tar.bz2
android-node-v8-e1dc6e6d73eeb43c3f5366e0f316c91a32e513f9.zip
Bind uv_tty_get_winsize
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r--src/tty_wrap.cc30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc
index 0d3e037068..9eceb82528 100644
--- a/src/tty_wrap.cc
+++ b/src/tty_wrap.cc
@@ -6,16 +6,6 @@
namespace node {
-#define UNWRAP \
- assert(!args.Holder().IsEmpty()); \
- assert(args.Holder()->InternalFieldCount() > 0); \
- TTYWrap* wrap = \
- static_cast<TTYWrap*>(args.Holder()->GetPointerFromInternalField(0)); \
- if (!wrap) { \
- SetErrno(UV_EBADF); \
- return scope.Close(Integer::New(-1)); \
- }
-
using v8::Object;
using v8::Handle;
using v8::Local;
@@ -31,6 +21,16 @@ using v8::Arguments;
using v8::Integer;
using v8::Undefined;
+#define UNWRAP \
+ assert(!args.Holder().IsEmpty()); \
+ assert(args.Holder()->InternalFieldCount() > 0); \
+ TTYWrap* wrap = \
+ static_cast<TTYWrap*>(args.Holder()->GetPointerFromInternalField(0)); \
+ if (!wrap) { \
+ SetErrno(UV_EBADF); \
+ return scope.Close(Integer::New(-1)); \
+ }
+
class TTYWrap : StreamWrap {
public:
@@ -115,15 +115,7 @@ class TTYWrap : StreamWrap {
static Handle<Value> SetRawMode(const Arguments& args) {
HandleScope scope;
- assert(!args.Holder().IsEmpty());
- assert(args.Holder()->InternalFieldCount() > 0);
- TTYWrap* wrap =
- static_cast<TTYWrap*>(args.Holder()->GetPointerFromInternalField(0));
-
- if (!wrap) {
- SetErrno(UV_EBADF);
- return scope.Close(Integer::New(-1));
- }
+ UNWRAP
int r = uv_tty_set_mode(&wrap->handle_, args[0]->IsTrue());