libndr: add some stubs for push functions
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Nov 2007 10:31:27 +0000 (11:31 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 15 Sep 2008 12:25:11 +0000 (14:25 +0200)
metze

source/lib/ndr/config.mk
source/lib/ndr/libndr.h
source/lib/ndr/ndr_push.c [new file with mode: 0644]

index 5798a29e7af63157c9f88110f1e5141143e03035..03c014e6fb34be066106b49b6f507fe4b3700cb8 100644 (file)
@@ -7,6 +7,7 @@ DESCRIPTION = Network Data Representation Core Library
 PUBLIC_HEADERS = libndr.h
 PRIVATE_PROTO_HEADER = ndr_proto.h
 OBJ_FILES = \
+               ndr_push.o \
                ndr_static.o \
                ndr_error.o \
                ndr_int_types.o \
index e86257f8781f58e9eaed0e019f7ae7e2ec1ffb34..b511afa01d5076275f2682c32d7435e2fd002719 100644 (file)
@@ -178,7 +178,6 @@ struct ndr_interface_list {
 #define ndr_pull_restore(a,b)
 #define ndr_token_retrieve_cmp_fn(a,b,c,d,e) NDR_ERR_FOOBAR
 
-#define ndr_push_bytes(a,b,c) NDR_ERR_FOOBAR
 #define ndr_pull_bytes(a,b,c) NDR_ERR_FOOBAR
 #define ndr_push_struct_blob(a,b,c,d) NDR_ERR_FOOBAR
 #define ndr_pull_struct_blob(a,b,c,d) NDR_ERR_FOOBAR
@@ -236,14 +235,10 @@ size_t ndr_size_dom_sid28(const struct dom_sid *r, int flags);
 #define ndr_pull_setup_relative_base_offset2(a,b)      NDR_ERR_FOOBAR
 #define        ndr_pull_restore_relative_base_offset(a,b)
 
-#define ndr_push_init_ctx(a) NULL
-#define ndr_push_blob(a) data_blob_const(NULL,0)
 #define ndr_pull_init_blob(a,b) NULL
 
 
-#define ndr_push_zero(a,b)                     NDR_ERR_FOOBAR
 
-#define ndr_push_align(a,b)                    NDR_ERR_FOOBAR
 #define ndr_push_ref_ptr(a)                    NDR_ERR_FOOBAR
 #define ndr_push_full_ptr(a,b)                 NDR_ERR_FOOBAR
 #define        ndr_push_unique_ptr(a,b)                NDR_ERR_FOOBAR
diff --git a/source/lib/ndr/ndr_push.c b/source/lib/ndr/ndr_push.c
new file mode 100644 (file)
index 0000000..347bb5e
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+   NDR library used by pidl bindings
+
+   Copyright (C) Stefan Metzmacher 2007
+
+     ** NOTE! The following LGPL license applies to the ndr
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h" /* TODO: remove this! */
+
+#include "libndr.h"
+
+struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx)
+{
+       return talloc_zero(mem_ctx, struct ndr_push);
+}
+
+DATA_BLOB ndr_push_blob(struct ndr_push *push)
+{
+       return data_blob_const(push->data, push->offset);
+}
+
+enum ndr_err_code ndr_push_zero(struct ndr_push *push, size_t len)
+{
+       return NDR_ERR_FOOBAR;
+}
+
+enum ndr_err_code ndr_push_align(struct ndr_push *push, size_t len)
+{
+       return NDR_ERR_FOOBAR;
+}
+
+enum ndr_err_code ndr_push_bytes(struct ndr_push *push, const uint8_t *data, size_t len)
+{
+       return NDR_ERR_FOOBAR;
+}