From: Stefan Metzmacher Date: Tue, 13 Nov 2007 10:31:27 +0000 (+0100) Subject: libndr: add some stubs for push functions X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=00337fc84a82970f3480dabf897bfbfce9beaa5b;p=metze%2Fsamba%2Fwb-ndr.git libndr: add some stubs for push functions metze --- diff --git a/source/lib/ndr/config.mk b/source/lib/ndr/config.mk index 5798a29e7af..03c014e6fb3 100644 --- a/source/lib/ndr/config.mk +++ b/source/lib/ndr/config.mk @@ -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 \ diff --git a/source/lib/ndr/libndr.h b/source/lib/ndr/libndr.h index e86257f8781..b511afa01d5 100644 --- a/source/lib/ndr/libndr.h +++ b/source/lib/ndr/libndr.h @@ -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 index 00000000000..347bb5e4f49 --- /dev/null +++ b/source/lib/ndr/ndr_push.c @@ -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 . +*/ + +#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; +}