summaryrefslogtreecommitdiff
path: root/librpc/ndr
diff options
context:
space:
mode:
authorBrad Hards <bradh@frogmouth.net>2009-06-01 16:26:43 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-06-02 18:05:42 +0200
commit00bfe9c286b7156f30a5cad4ee6d42557f3c7835 (patch)
tree23da334a49e7e1a5bfc2937a34cc37c7e3dbcb01 /librpc/ndr
parent688efbbc687bf96c6801afe55deb55a7002a9bf3 (diff)
downloadsamba-00bfe9c286b7156f30a5cad4ee6d42557f3c7835.tar.gz
samba-00bfe9c286b7156f30a5cad4ee6d42557f3c7835.tar.bz2
samba-00bfe9c286b7156f30a5cad4ee6d42557f3c7835.zip
Add support for double type in pidl.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/ndr_basic.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index b6cc44cc32..d46590f0cb 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -126,6 +126,18 @@ _PUBLIC_ enum ndr_err_code ndr_pull_uint32(struct ndr_pull *ndr, int ndr_flags,
}
/*
+ parse a double
+*/
+_PUBLIC_ enum ndr_err_code ndr_pull_double(struct ndr_pull *ndr, int ndr_flags, double *v)
+{
+ NDR_PULL_ALIGN(ndr, 8);
+ NDR_PULL_NEED_BYTES(ndr, 8);
+ memcpy(v, ndr->data+ndr->offset, 8);
+ ndr->offset += 8;
+ return NDR_ERR_SUCCESS;
+}
+
+/*
parse a pointer referent identifier
*/
_PUBLIC_ enum ndr_err_code ndr_pull_generic_ptr(struct ndr_pull *ndr, uint32_t *v)
@@ -389,6 +401,18 @@ _PUBLIC_ enum ndr_err_code ndr_push_hyper(struct ndr_push *ndr, int ndr_flags, u
}
/*
+ push a double
+*/
+_PUBLIC_ enum ndr_err_code ndr_push_double(struct ndr_push *ndr, int ndr_flags, double v)
+{
+ NDR_PUSH_ALIGN(ndr, 8);
+ NDR_PUSH_NEED_BYTES(ndr, 8);
+ memcpy(ndr->data+ndr->offset, &v, 8);
+ ndr->offset += 8;
+ return NDR_ERR_SUCCESS;
+}
+
+/*
push a pointer
*/
_PUBLIC_ enum ndr_err_code ndr_push_pointer(struct ndr_push *ndr, int ndr_flags, void* v)
@@ -506,7 +530,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_NTTIME(struct ndr_pull *ndr, int ndr_flags,
}
/*
- push a NTTIME
+ push a NTTIME_1sec
*/
_PUBLIC_ enum ndr_err_code ndr_push_NTTIME_1sec(struct ndr_push *ndr, int ndr_flags, NTTIME t)
{
@@ -679,6 +703,11 @@ _PUBLIC_ void ndr_print_dlong(struct ndr_print *ndr, const char *name, int64_t v
ndr->print(ndr, "%-25s: 0x%016llx (%lld)", name, (unsigned long long)v, (long long)v);
}
+_PUBLIC_ void ndr_print_double(struct ndr_print *ndr, const char *name, double v)
+{
+ ndr->print(ndr, "%-25s: %f", name, v);
+}
+
_PUBLIC_ void ndr_print_hyper(struct ndr_print *ndr, const char *name, uint64_t v)
{
ndr_print_dlong(ndr, name, v);