summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-07 07:42:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:18 -0500
commit74ac1686d5d0fcadbdacc8ff1bf9ab200e748737 (patch)
treebb6bedae728fa077f5bc6b589097494213770b43 /source4/scripting
parent3605d2d7abba2bf5476b5b8d2c22af90cfbc2a6c (diff)
downloadsamba-74ac1686d5d0fcadbdacc8ff1bf9ab200e748737.tar.gz
samba-74ac1686d5d0fcadbdacc8ff1bf9ab200e748737.tar.bz2
samba-74ac1686d5d0fcadbdacc8ff1bf9ab200e748737.zip
r8195: - fixed handling of simple arrays. To keep the logic simple, I moved to making all push
functions taking a constant pointer to the type rather than having a different calling convention for scalars and pointers - fixed the setting of the 'length' element in arrays (This used to be commit 431b4b6888434daa8d1306f0e98bae7b2fe0fddd)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/ejs/ejsrpc.c24
-rw-r--r--source4/scripting/ejs/ejsrpc.h10
2 files changed, 17 insertions, 17 deletions
diff --git a/source4/scripting/ejs/ejsrpc.c b/source4/scripting/ejs/ejsrpc.c
index 242d748b36..4984518c7f 100644
--- a/source4/scripting/ejs/ejsrpc.c
+++ b/source4/scripting/ejs/ejsrpc.c
@@ -138,9 +138,9 @@ NTSTATUS ejs_pull_uint8(struct ejs_rpc *ejs,
}
NTSTATUS ejs_push_uint8(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, uint8_t r)
+ struct MprVar *v, const char *name, const uint8_t *r)
{
- return mprSetVar(v, name, mprCreateIntegerVar(r));
+ return mprSetVar(v, name, mprCreateIntegerVar(*r));
}
/*
@@ -160,9 +160,9 @@ NTSTATUS ejs_pull_uint16(struct ejs_rpc *ejs,
}
NTSTATUS ejs_push_uint16(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, uint16_t r)
+ struct MprVar *v, const char *name, const uint16_t *r)
{
- return mprSetVar(v, name, mprCreateIntegerVar(r));
+ return mprSetVar(v, name, mprCreateIntegerVar(*r));
}
/*
@@ -181,9 +181,9 @@ NTSTATUS ejs_pull_uint32(struct ejs_rpc *ejs,
}
NTSTATUS ejs_push_uint32(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, uint32_t r)
+ struct MprVar *v, const char *name, const uint32_t *r)
{
- return mprSetVar(v, name, mprCreateIntegerVar(r));
+ return mprSetVar(v, name, mprCreateIntegerVar(*r));
}
NTSTATUS ejs_pull_hyper(struct ejs_rpc *ejs,
@@ -199,9 +199,9 @@ NTSTATUS ejs_pull_hyper(struct ejs_rpc *ejs,
}
NTSTATUS ejs_push_hyper(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, uint64_t r)
+ struct MprVar *v, const char *name, const uint64_t *r)
{
- return mprSetVar(v, name, mprCreateIntegerVar(r));
+ return mprSetVar(v, name, mprCreateIntegerVar(*r));
}
@@ -223,9 +223,9 @@ NTSTATUS ejs_pull_enum(struct ejs_rpc *ejs,
}
NTSTATUS ejs_push_enum(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, unsigned r)
+ struct MprVar *v, const char *name, const unsigned *r)
{
- return mprSetVar(v, name, mprCreateIntegerVar(r));
+ return mprSetVar(v, name, mprCreateIntegerVar(*r));
}
@@ -252,7 +252,7 @@ NTSTATUS ejs_pull_array(struct ejs_rpc *ejs,
NDR_CHECK(ejs_pull(ejs, v, id, (i*elsize)+data));
talloc_free(id);
}
- return mprSetVar(v, "length", mprCreateIntegerVar(i));
+ return NT_STATUS_OK;
}
@@ -276,6 +276,6 @@ NTSTATUS ejs_push_array(struct ejs_rpc *ejs,
NDR_CHECK(ejs_push(ejs, v, id, (i*elsize)+data));
talloc_free(id);
}
- return NT_STATUS_OK;
+ return mprSetVar(v, "length", mprCreateIntegerVar(i));
}
diff --git a/source4/scripting/ejs/ejsrpc.h b/source4/scripting/ejs/ejsrpc.h
index 8ddd6a394e..1febb90ad6 100644
--- a/source4/scripting/ejs/ejsrpc.h
+++ b/source4/scripting/ejs/ejsrpc.h
@@ -40,23 +40,23 @@ NTSTATUS ejs_push_struct_start(struct ejs_rpc *ejs, struct MprVar **v, const cha
NTSTATUS ejs_pull_uint8(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint8_t *r);
NTSTATUS ejs_push_uint8(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, uint8_t r);
+ struct MprVar *v, const char *name, const uint8_t *r);
NTSTATUS ejs_pull_uint16(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint16_t *r);
NTSTATUS ejs_push_uint16(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, uint16_t r);
+ struct MprVar *v, const char *name, const uint16_t *r);
NTSTATUS ejs_pull_uint32(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint32_t *r);
NTSTATUS ejs_push_uint32(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, uint32_t r);
+ struct MprVar *v, const char *name, const uint32_t *r);
NTSTATUS ejs_pull_hyper(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint64_t *r);
NTSTATUS ejs_push_hyper(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, uint64_t r);
+ struct MprVar *v, const char *name, const uint64_t *r);
NTSTATUS ejs_pull_enum(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, unsigned *r);
NTSTATUS ejs_push_enum(struct ejs_rpc *ejs,
- struct MprVar *v, const char *name, unsigned r);
+ struct MprVar *v, const char *name, const unsigned *r);
NTSTATUS ejs_pull_array(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint32_t length,
size_t elsize, void **r, ejs_pull_t ejs_pull);