1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

r7422: Create a ejs object to wrap a smbcli_transport pointer.

(This used to be commit a55e40651d)
This commit is contained in:
Tim Potter 2005-06-09 07:28:21 +00:00 committed by Gerald (Jerry) Carter
parent 7931aed30d
commit 0b119901d8

View File

@ -24,6 +24,20 @@
#include "lib/ejs/ejs.h"
#include "librpc/gen_ndr/ndr_nbt.h"
static struct MprVar mprTransport(struct smbcli_transport *transport)
{
struct MprVar res, val;
res = mprCreateObjVar("transport", MPR_DEFAULT_HASH_SIZE);
val = mprCreateStringVar(talloc_get_name(transport), 1);
mprCreateProperty(&res, "name", &val);
/* TODO: Create a C pointer "value" property */
return res;
}
/* Connect to a server */
static int ejs_cli_connect(MprVarHandle eid, int argc, char **argv)
@ -77,6 +91,10 @@ static int ejs_cli_connect(MprVarHandle eid, int argc, char **argv)
return 0;
}
/* Return a socket object */
ejsSetReturnValue(eid, mprTransport(transport));
return 0;
}