diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/kerberos/krb5_init_context.c | 2 | ||||
-rw-r--r-- | source4/lib/charset/charcnv.c | 32 | ||||
-rw-r--r-- | source4/lib/crypto/hmacmd5.c | 10 | ||||
-rw-r--r-- | source4/lib/crypto/md4.c | 6 | ||||
-rw-r--r-- | source4/lib/events/events.c | 2 | ||||
-rw-r--r-- | source4/lib/netif/interface.c | 16 | ||||
-rw-r--r-- | source4/lib/util/substitute.c | 30 | ||||
-rw-r--r-- | source4/lib/util/system.c | 6 | ||||
-rw-r--r-- | source4/libcli/nbt/namequery.c | 25 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_misc.c | 31 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_string.c | 40 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 6 |
12 files changed, 107 insertions, 99 deletions
diff --git a/source4/auth/kerberos/krb5_init_context.c b/source4/auth/kerberos/krb5_init_context.c index 830c803524..ccc824d969 100644 --- a/source4/auth/kerberos/krb5_init_context.c +++ b/source4/auth/kerberos/krb5_init_context.c @@ -371,7 +371,7 @@ static void smb_krb5_send_and_recv_close_func(krb5_context context, void *data) } - krb5_error_code smb_krb5_init_context(void *parent_ctx, +_PUBLIC_ krb5_error_code smb_krb5_init_context(void *parent_ctx, struct smb_krb5_context **smb_krb5_context) { krb5_error_code ret; diff --git a/source4/lib/charset/charcnv.c b/source4/lib/charset/charcnv.c index 6f07d78fb1..a10a336fd2 100644 --- a/source4/lib/charset/charcnv.c +++ b/source4/lib/charset/charcnv.c @@ -61,7 +61,7 @@ static smb_iconv_t conv_handles[NUM_CHARSETS][NUM_CHARSETS]; /** re-initialize iconv conversion descriptors **/ -void init_iconv(void) +_PUBLIC_ void init_iconv(void) { charset_t c1, c2; for (c1=0;c1<NUM_CHARSETS;c1++) { @@ -138,7 +138,7 @@ static smb_iconv_t get_conv_handle(charset_t from, charset_t to) * @param destlen maximal length allowed for string * @returns the number of bytes occupied in the destination **/ -ssize_t convert_string(charset_t from, charset_t to, +_PUBLIC_ ssize_t convert_string(charset_t from, charset_t to, void const *src, size_t srclen, void *dest, size_t destlen) { @@ -201,7 +201,7 @@ ssize_t convert_string(charset_t from, charset_t to, * @returns Size in bytes of the converted string; or -1 in case of error. **/ -ssize_t convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to, +_PUBLIC_ ssize_t convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to, void const *src, size_t srclen, void **dest) { size_t i_len, o_len, destlen; @@ -287,7 +287,7 @@ convert: * @param dest_len the maximum length in bytes allowed in the * destination. If @p dest_len is -1 then no maximum is used. **/ -ssize_t push_ascii(void *dest, const char *src, size_t dest_len, int flags) +_PUBLIC_ ssize_t push_ascii(void *dest, const char *src, size_t dest_len, int flags) { size_t src_len; ssize_t ret; @@ -319,7 +319,7 @@ ssize_t push_ascii(void *dest, const char *src, size_t dest_len, int flags) * @returns The number of bytes occupied by the string in the destination * or -1 in case of error. **/ -ssize_t push_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src) +_PUBLIC_ ssize_t push_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src) { size_t src_len = strlen(src)+1; @@ -343,7 +343,7 @@ ssize_t push_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src) * @param src_len is the length of the source area in bytes. * @returns the number of bytes occupied by the string in @p src. **/ -ssize_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, int flags) +_PUBLIC_ ssize_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, int flags) { size_t ret; @@ -382,7 +382,7 @@ ssize_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, * @param dest_len is the maximum length allowed in the * destination. If dest_len is -1 then no maxiumum is used. **/ -ssize_t push_ucs2(void *dest, const char *src, size_t dest_len, int flags) +_PUBLIC_ ssize_t push_ucs2(void *dest, const char *src, size_t dest_len, int flags) { size_t len=0; size_t src_len = strlen(src); @@ -431,7 +431,7 @@ ssize_t push_ucs2(void *dest, const char *src, size_t dest_len, int flags) * @returns The number of bytes occupied by the string in the destination * or -1 in case of error. **/ -ssize_t push_ucs2_talloc(TALLOC_CTX *ctx, void **dest, const char *src) +_PUBLIC_ ssize_t push_ucs2_talloc(TALLOC_CTX *ctx, void **dest, const char *src) { size_t src_len = strlen(src)+1; *dest = NULL; @@ -447,7 +447,7 @@ ssize_t push_ucs2_talloc(TALLOC_CTX *ctx, void **dest, const char *src) * @returns The number of bytes occupied by the string in the destination **/ -ssize_t push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src) +_PUBLIC_ ssize_t push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src) { size_t src_len = strlen(src)+1; @@ -466,7 +466,7 @@ ssize_t push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src) The resulting string in "dest" is always null terminated. **/ -size_t pull_ucs2(char *dest, const void *src, size_t dest_len, size_t src_len, int flags) +_PUBLIC_ size_t pull_ucs2(char *dest, const void *src, size_t dest_len, size_t src_len, int flags) { size_t ret; @@ -503,7 +503,7 @@ size_t pull_ucs2(char *dest, const void *src, size_t dest_len, size_t src_len, i * @returns The number of bytes occupied by the string in the destination **/ -ssize_t pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const void *src) +_PUBLIC_ ssize_t pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const void *src) { size_t src_len = utf16_len(src); *dest = NULL; @@ -518,7 +518,7 @@ ssize_t pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const void *src) * @returns The number of bytes occupied by the string in the destination **/ -ssize_t pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src) +_PUBLIC_ ssize_t pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src) { size_t src_len = strlen(src)+1; *dest = NULL; @@ -539,7 +539,7 @@ ssize_t pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src) is -1 then no maxiumum is used. **/ -ssize_t push_string(void *dest, const char *src, size_t dest_len, int flags) +_PUBLIC_ ssize_t push_string(void *dest, const char *src, size_t dest_len, int flags) { if (flags & STR_ASCII) { return push_ascii(dest, src, dest_len, flags); @@ -566,7 +566,7 @@ ssize_t push_string(void *dest, const char *src, size_t dest_len, int flags) The resulting string in "dest" is always null terminated. **/ -ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_t src_len, int flags) +_PUBLIC_ ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_t src_len, int flags) { if (flags & STR_ASCII) { return pull_ascii(dest, src, dest_len, src_len, flags); @@ -588,7 +588,7 @@ ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_t src_len return INVALID_CODEPOINT if the next character cannot be converted */ -codepoint_t next_codepoint(const char *str, size_t *size) +_PUBLIC_ codepoint_t next_codepoint(const char *str, size_t *size) { /* it cannot occupy more than 4 bytes in UTF16 format */ uint8_t buf[4]; @@ -660,7 +660,7 @@ codepoint_t next_codepoint(const char *str, size_t *size) return the number of bytes occupied by the CH_UNIX character, or -1 on failure */ -ssize_t push_codepoint(char *str, codepoint_t c) +_PUBLIC_ ssize_t push_codepoint(char *str, codepoint_t c) { smb_iconv_t descriptor; uint8_t buf[4]; diff --git a/source4/lib/crypto/hmacmd5.c b/source4/lib/crypto/hmacmd5.c index 2045f9a9d7..7635bf6a82 100644 --- a/source4/lib/crypto/hmacmd5.c +++ b/source4/lib/crypto/hmacmd5.c @@ -29,7 +29,7 @@ /*********************************************************************** the rfc 2104 version of hmac_md5 initialisation. ***********************************************************************/ -void hmac_md5_init_rfc2104(const uint8_t *key, int key_len, HMACMD5Context *ctx) +_PUBLIC_ void hmac_md5_init_rfc2104(const uint8_t *key, int key_len, HMACMD5Context *ctx) { int i; @@ -67,7 +67,7 @@ void hmac_md5_init_rfc2104(const uint8_t *key, int key_len, HMACMD5Context *ctx) /*********************************************************************** the microsoft version of hmac_md5 initialisation. ***********************************************************************/ -void hmac_md5_init_limK_to_64(const uint8_t *key, int key_len, +_PUBLIC_ void hmac_md5_init_limK_to_64(const uint8_t *key, int key_len, HMACMD5Context *ctx) { /* if key is longer than 64 bytes truncate it */ @@ -82,7 +82,7 @@ void hmac_md5_init_limK_to_64(const uint8_t *key, int key_len, /*********************************************************************** update hmac_md5 "inner" buffer ***********************************************************************/ -void hmac_md5_update(const uint8_t *text, int text_len, HMACMD5Context *ctx) +_PUBLIC_ void hmac_md5_update(const uint8_t *text, int text_len, HMACMD5Context *ctx) { MD5Update(&ctx->ctx, text, text_len); /* then text of datagram */ } @@ -90,7 +90,7 @@ void hmac_md5_update(const uint8_t *text, int text_len, HMACMD5Context *ctx) /*********************************************************************** finish off hmac_md5 "inner" buffer and generate outer one. ***********************************************************************/ -void hmac_md5_final(uint8_t *digest, HMACMD5Context *ctx) +_PUBLIC_ void hmac_md5_final(uint8_t *digest, HMACMD5Context *ctx) { struct MD5Context ctx_o; @@ -106,7 +106,7 @@ void hmac_md5_final(uint8_t *digest, HMACMD5Context *ctx) single function to calculate an HMAC MD5 digest from data. use the microsoft hmacmd5 init method because the key is 16 bytes. ************************************************************/ -void hmac_md5(const uint8_t key[16], const uint8_t *data, int data_len, uint8_t *digest) +_PUBLIC_ void hmac_md5(const uint8_t key[16], const uint8_t *data, int data_len, uint8_t *digest) { HMACMD5Context ctx; hmac_md5_init_limK_to_64(key, 16, &ctx); diff --git a/source4/lib/crypto/md4.c b/source4/lib/crypto/md4.c index 98fcabf224..5b57c57dbb 100644 --- a/source4/lib/crypto/md4.c +++ b/source4/lib/crypto/md4.c @@ -124,8 +124,10 @@ static void copy4(uint8_t *out, uint32_t x) out[3] = (x>>24)&0xFF; } -/* produce a md4 message digest from data of length n bytes */ -void mdfour(uint8_t *out, const uint8_t *in, int n) +/** + * produce a md4 message digest from data of length n bytes + */ +_PUBLIC_ void mdfour(uint8_t *out, const uint8_t *in, int n) { uint8_t buf[128]; uint32_t M[16]; diff --git a/source4/lib/events/events.c b/source4/lib/events/events.c index 7aa8d680fc..585fcb3112 100644 --- a/source4/lib/events/events.c +++ b/source4/lib/events/events.c @@ -143,7 +143,7 @@ struct timed_event *event_add_timed(struct event_context *ev, TALLOC_CTX *mem_ct /* do a single event loop using the events defined in ev */ -int event_loop_once(struct event_context *ev) +_PUBLIC_ int event_loop_once(struct event_context *ev) { return ev->ops->loop_once(ev); } diff --git a/source4/lib/netif/interface.c b/source4/lib/netif/interface.c index 222e63b92e..8d738f6c41 100644 --- a/source4/lib/netif/interface.c +++ b/source4/lib/netif/interface.c @@ -233,7 +233,7 @@ static void load_interfaces(void) /* unload the interfaces list, so it can be reloaded when needed */ -void unload_interfaces(void) +_PUBLIC_ void unload_interfaces(void) { talloc_free(local_interfaces); local_interfaces = NULL; @@ -242,7 +242,7 @@ void unload_interfaces(void) /**************************************************************************** how many interfaces do we have **************************************************************************/ -int iface_count(void) +_PUBLIC_ int iface_count(void) { int ret = 0; struct interface *i; @@ -257,7 +257,7 @@ int iface_count(void) /**************************************************************************** return IP of the Nth interface **************************************************************************/ -const char *iface_n_ip(int n) +_PUBLIC_ const char *iface_n_ip(int n) { struct interface *i; @@ -275,7 +275,7 @@ const char *iface_n_ip(int n) /**************************************************************************** return bcast of the Nth interface **************************************************************************/ -const char *iface_n_bcast(int n) +_PUBLIC_ const char *iface_n_bcast(int n) { struct interface *i; @@ -293,7 +293,7 @@ const char *iface_n_bcast(int n) /**************************************************************************** return netmask of the Nth interface **************************************************************************/ -const char *iface_n_netmask(int n) +_PUBLIC_ const char *iface_n_netmask(int n) { struct interface *i; @@ -312,7 +312,7 @@ const char *iface_n_netmask(int n) return the local IP address that best matches a destination IP, or our first interface if none match */ -const char *iface_best_ip(const char *dest) +_PUBLIC_ const char *iface_best_ip(const char *dest) { struct interface *iface; struct in_addr ip; @@ -330,7 +330,7 @@ const char *iface_best_ip(const char *dest) /* return True if an IP is one one of our local networks */ -BOOL iface_is_local(const char *dest) +_PUBLIC_ BOOL iface_is_local(const char *dest) { struct in_addr ip; @@ -346,7 +346,7 @@ BOOL iface_is_local(const char *dest) /* return True if a IP matches a IP/netmask pair */ -BOOL iface_same_net(const char *ip1, const char *ip2, const char *netmask) +_PUBLIC_ BOOL iface_same_net(const char *ip1, const char *ip2, const char *netmask) { return same_net(interpret_addr2(ip1), interpret_addr2(ip2), diff --git a/source4/lib/util/substitute.c b/source4/lib/util/substitute.c index d461cedf4c..2e55a7befb 100644 --- a/source4/lib/util/substitute.c +++ b/source4/lib/util/substitute.c @@ -32,7 +32,7 @@ argument this is needed */ static struct substitute_context *sub; -void sub_set_context(struct substitute_context *subptr) +_PUBLIC_ void sub_set_context(struct substitute_context *subptr) { sub = subptr; } @@ -59,13 +59,13 @@ static void setup_string(char **dest, const char *str) (*dest) = s; } -void sub_set_remote_proto(const char *str) +_PUBLIC_ void sub_set_remote_proto(const char *str) { if (!sub) return; setup_string(&sub->remote_proto, str); } -void sub_set_remote_arch(const char *str) +_PUBLIC_ void sub_set_remote_arch(const char *str) { if (!sub) return; setup_string(&sub->remote_arch, str); @@ -74,7 +74,7 @@ void sub_set_remote_arch(const char *str) /** setup the string used by %U substitution */ -void sub_set_user_name(const char *name) +_PUBLIC_ void sub_set_user_name(const char *name) { if (!sub) return; setup_string(&sub->user_name, name); @@ -83,7 +83,7 @@ void sub_set_user_name(const char *name) /** FIXME **/ -void standard_sub_basic(char *str,size_t len) +_PUBLIC_ void standard_sub_basic(char *str,size_t len) { } @@ -91,12 +91,12 @@ void standard_sub_basic(char *str,size_t len) Do some standard substitutions in a string. This function will return an allocated string that have to be freed. **/ -char *talloc_sub_basic(TALLOC_CTX *mem_ctx, const char *smb_name, const char *str) +_PUBLIC_ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, const char *smb_name, const char *str) { return talloc_strdup(mem_ctx, str); } -char *alloc_sub_basic(const char *smb_name, const char *str) +_PUBLIC_ char *alloc_sub_basic(const char *smb_name, const char *str) { return strdup(str); } @@ -106,7 +106,7 @@ char *alloc_sub_basic(const char *smb_name, const char *str) This function will return an allocated string that have to be freed. **/ -char *talloc_sub_specified(TALLOC_CTX *mem_ctx, +_PUBLIC_ char *talloc_sub_specified(TALLOC_CTX *mem_ctx, const char *input_string, const char *username, const char *domain, @@ -116,7 +116,7 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx, return talloc_strdup(mem_ctx, input_string); } -char *alloc_sub_specified(const char *input_string, +_PUBLIC_ char *alloc_sub_specified(const char *input_string, const char *username, const char *domain, uid_t uid, @@ -125,7 +125,7 @@ char *alloc_sub_specified(const char *input_string, return strdup(input_string); } -char *talloc_sub_advanced(TALLOC_CTX *mem_ctx, +_PUBLIC_ char *talloc_sub_advanced(TALLOC_CTX *mem_ctx, int snum, const char *user, const char *connectpath, @@ -136,7 +136,7 @@ char *talloc_sub_advanced(TALLOC_CTX *mem_ctx, return talloc_strdup(mem_ctx, str); } -char *alloc_sub_advanced(int snum, const char *user, +_PUBLIC_ char *alloc_sub_advanced(int snum, const char *user, const char *connectpath, gid_t gid, const char *smb_name, char *str) { @@ -147,16 +147,16 @@ char *alloc_sub_advanced(int snum, const char *user, Do some standard substitutions in a string. **/ -void standard_sub_tcon(struct smbsrv_tcon *tcon, char *str, size_t len) +_PUBLIC_ void standard_sub_tcon(struct smbsrv_tcon *tcon, char *str, size_t len) { } -char *talloc_sub_tcon(TALLOC_CTX *mem_ctx, struct smbsrv_tcon *tcon, char *str) +_PUBLIC_ char *talloc_sub_tcon(TALLOC_CTX *mem_ctx, struct smbsrv_tcon *tcon, char *str) { return talloc_strdup(mem_ctx, str); } -char *alloc_sub_tcon(struct smbsrv_tcon *tcon, char *str) +_PUBLIC_ char *alloc_sub_tcon(struct smbsrv_tcon *tcon, char *str) { return strdup(str); } @@ -165,6 +165,6 @@ char *alloc_sub_tcon(struct smbsrv_tcon *tcon, char *str) Like standard_sub but by snum. FIXME **/ -void standard_sub_snum(int snum, char *str, size_t len) +_PUBLIC_ void standard_sub_snum(int snum, char *str, size_t len) { } diff --git a/source4/lib/util/system.c b/source4/lib/util/system.c index 655b4a1054..5f8db9ef63 100644 --- a/source4/lib/util/system.c +++ b/source4/lib/util/system.c @@ -44,7 +44,7 @@ in the root domain, which can cause dial-on-demand links to come up for no apparent reason. ****************************************************************************/ -struct hostent *sys_gethostbyname(const char *name) +_PUBLIC_ struct hostent *sys_gethostbyname(const char *name) { #ifdef REDUCE_ROOT_DNS_LOOKUPS char query[256], hostname[256]; @@ -80,14 +80,14 @@ struct hostent *sys_gethostbyname(const char *name) #endif /* REDUCE_ROOT_DNS_LOOKUPS */ } -const char *sys_inet_ntoa(struct ipv4_addr in) +_PUBLIC_ const char *sys_inet_ntoa(struct ipv4_addr in) { struct in_addr in2; in2.s_addr = in.addr; return inet_ntoa(in2); } -struct ipv4_addr sys_inet_makeaddr(int net, int host) +_PUBLIC_ struct ipv4_addr sys_inet_makeaddr(int net, int host) { struct in_addr in; struct ipv4_addr in2; diff --git a/source4/libcli/nbt/namequery.c b/source4/libcli/nbt/namequery.c index 6566e48a5a..cb3c9e158c 100644 --- a/source4/libcli/nbt/namequery.c +++ b/source4/libcli/nbt/namequery.c @@ -23,10 +23,11 @@ #include "includes.h" #include "libcli/nbt/libnbt.h" #include "lib/socket/socket.h" -/* + +/** send a nbt name query */ -struct nbt_name_request *nbt_name_query_send(struct nbt_name_socket *nbtsock, +_PUBLIC_ struct nbt_name_request *nbt_name_query_send(struct nbt_name_socket *nbtsock, struct nbt_name_query *io) { struct nbt_name_request *req; @@ -67,10 +68,10 @@ failed: return NULL; } -/* +/** wait for a name query reply */ -NTSTATUS nbt_name_query_recv(struct nbt_name_request *req, +_PUBLIC_ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req, TALLOC_CTX *mem_ctx, struct nbt_name_query *io) { NTSTATUS status; @@ -122,10 +123,10 @@ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req, return NT_STATUS_OK; } -/* +/** wait for a name query reply */ -NTSTATUS nbt_name_query(struct nbt_name_socket *nbtsock, +_PUBLIC_ NTSTATUS nbt_name_query(struct nbt_name_socket *nbtsock, TALLOC_CTX *mem_ctx, struct nbt_name_query *io) { struct nbt_name_request *req = nbt_name_query_send(nbtsock, io); @@ -133,10 +134,10 @@ NTSTATUS nbt_name_query(struct nbt_name_socket *nbtsock, } -/* +/** send a nbt name status */ -struct nbt_name_request *nbt_name_status_send(struct nbt_name_socket *nbtsock, +_PUBLIC_ struct nbt_name_request *nbt_name_status_send(struct nbt_name_socket *nbtsock, struct nbt_name_status *io) { struct nbt_name_request *req; @@ -171,10 +172,10 @@ failed: return NULL; } -/* +/** wait for a name status reply */ -NTSTATUS nbt_name_status_recv(struct nbt_name_request *req, +_PUBLIC_ NTSTATUS nbt_name_status_recv(struct nbt_name_request *req, TALLOC_CTX *mem_ctx, struct nbt_name_status *io) { NTSTATUS status; @@ -220,10 +221,10 @@ NTSTATUS nbt_name_status_recv(struct nbt_name_request *req, return NT_STATUS_OK; } -/* +/** wait for a name status reply */ -NTSTATUS nbt_name_status(struct nbt_name_socket *nbtsock, +_PUBLIC_ NTSTATUS nbt_name_status(struct nbt_name_socket *nbtsock, TALLOC_CTX *mem_ctx, struct nbt_name_status *io) { struct nbt_name_request *req = nbt_name_status_send(nbtsock, io); diff --git a/source4/librpc/ndr/ndr_misc.c b/source4/librpc/ndr/ndr_misc.c index 189d2afffb..5cffd33b46 100644 --- a/source4/librpc/ndr/ndr_misc.c +++ b/source4/librpc/ndr/ndr_misc.c @@ -26,7 +26,7 @@ #include "includes.h" #include "system/network.h" -void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct ipv4_addr *_ip) +_PUBLIC_ void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct ipv4_addr *_ip) { struct ipv4_addr ip; @@ -35,10 +35,10 @@ void ndr_print_ipv4_addr(struct ndr_print *ndr, const char *name, const struct i ndr->print(ndr, "%-25s: %s", name, sys_inet_ntoa(ip)); } -/* +/** build a GUID from a string */ -NTSTATUS GUID_from_string(const char *s, struct GUID *guid) +_PUBLIC_ NTSTATUS GUID_from_string(const char *s, struct GUID *guid) { NTSTATUS status = NT_STATUS_INVALID_PARAMETER; uint32_t time_low; @@ -79,7 +79,9 @@ NTSTATUS GUID_from_string(const char *s, struct GUID *guid) return NT_STATUS_OK; } -/* generate a random GUID */ +/** + * generate a random GUID + */ struct GUID GUID_random(void) { struct GUID guid; @@ -91,8 +93,10 @@ struct GUID GUID_random(void) return guid; } -/* generate a random GUID */ -struct GUID GUID_zero(void) +/** + * generate an empty GUID + */ +_PUBLIC_ struct GUID GUID_zero(void) { struct GUID guid; @@ -101,7 +105,7 @@ struct GUID GUID_zero(void) return guid; } -BOOL GUID_all_zero(const struct GUID *u) +_PUBLIC_ BOOL GUID_all_zero(const struct GUID *u) { if (u->time_low != 0 || u->time_mid != 0 || @@ -114,7 +118,7 @@ BOOL GUID_all_zero(const struct GUID *u) return True; } -BOOL GUID_equal(const struct GUID *u1, const struct GUID *u2) +_PUBLIC_ BOOL GUID_equal(const struct GUID *u1, const struct GUID *u2) { if (u1->time_low != u2->time_low || u1->time_mid != u2->time_mid || @@ -127,10 +131,10 @@ BOOL GUID_equal(const struct GUID *u1, const struct GUID *u2) return True; } -/* +/** its useful to be able to display these in debugging messages */ -char *GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid) +_PUBLIC_ char *GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid) { return talloc_asprintf(mem_ctx, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", @@ -143,7 +147,7 @@ char *GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid) guid->node[4], guid->node[5]); } -char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid) +_PUBLIC_ char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid) { char *ret, *s = GUID_string(mem_ctx, guid); ret = talloc_asprintf(mem_ctx, "{%s}", s); @@ -151,13 +155,12 @@ char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid) return ret; } - -void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid) +_PUBLIC_ void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid) { ndr->print(ndr, "%-25s: %s", name, GUID_string(ndr, guid)); } -BOOL policy_handle_empty(struct policy_handle *h) +_PUBLIC_ BOOL policy_handle_empty(struct policy_handle *h) { return (h->handle_type == 0 && GUID_all_zero(&h->uuid)); } diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c index 9eb26c2c83..164c6d4a03 100644 --- a/source4/librpc/ndr/ndr_string.c +++ b/source4/librpc/ndr/ndr_string.c @@ -22,10 +22,10 @@ #include "includes.h" -/* +/** pull a general string from the wire */ -NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s) +_PUBLIC_ NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s) { char *as=NULL; uint32_t len1, ofs, len2; @@ -281,10 +281,10 @@ NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s) } -/* +/** push a general string onto the wire */ -NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s) +_PUBLIC_ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s) { ssize_t s_len, c_len, d_len; int ret; @@ -461,10 +461,10 @@ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s) return NT_STATUS_OK; } -/* +/** push a general string onto the wire */ -size_t ndr_string_array_size(struct ndr_push *ndr, const char *s) +_PUBLIC_ size_t ndr_string_array_size(struct ndr_push *ndr, const char *s) { size_t c_len; unsigned flags = ndr->flags; @@ -497,7 +497,7 @@ size_t ndr_string_array_size(struct ndr_push *ndr, const char *s) return c_len; } -void ndr_print_string(struct ndr_print *ndr, const char *name, const char *s) +_PUBLIC_ void ndr_print_string(struct ndr_print *ndr, const char *name, const char *s) { if (s) { ndr->print(ndr, "%-25s: '%s'", name, s); @@ -506,17 +506,17 @@ void ndr_print_string(struct ndr_print *ndr, const char *name, const char *s) } } -uint32_t ndr_size_string(int ret, const char * const* string, int flags) +_PUBLIC_ uint32_t ndr_size_string(int ret, const char * const* string, int flags) { /* FIXME: Is this correct for all strings ? */ if(!(*string)) return ret; return ret+strlen(*string)+1; } -/* +/** pull a general string array from the wire */ -NTSTATUS ndr_pull_string_array(struct ndr_pull *ndr, int ndr_flags, const char ***_a) +_PUBLIC_ NTSTATUS ndr_pull_string_array(struct ndr_pull *ndr, int ndr_flags, const char ***_a) { const char **a = *_a; uint32_t count; @@ -549,10 +549,10 @@ NTSTATUS ndr_pull_string_array(struct ndr_pull *ndr, int ndr_flags, const char * return NT_STATUS_OK; } -/* +/** push a general string array onto the wire */ -NTSTATUS ndr_push_string_array(struct ndr_push *ndr, int ndr_flags, const char **a) +_PUBLIC_ NTSTATUS ndr_push_string_array(struct ndr_push *ndr, int ndr_flags, const char **a) { uint32_t count; @@ -569,7 +569,7 @@ NTSTATUS ndr_push_string_array(struct ndr_push *ndr, int ndr_flags, const char * return NT_STATUS_OK; } -void ndr_print_string_array(struct ndr_print *ndr, const char *name, const char **a) +_PUBLIC_ void ndr_print_string_array(struct ndr_print *ndr, const char *name, const char **a) { uint32_t count; uint32_t i; @@ -589,8 +589,10 @@ void ndr_print_string_array(struct ndr_print *ndr, const char *name, const char ndr->depth--; } -/* Return number of elements in a string including the last (zeroed) element */ -uint32_t ndr_string_length(const void *_var, uint32_t element_size) +/** + * Return number of elements in a string including the last (zeroed) element + */ +_PUBLIC_ uint32_t ndr_string_length(const void *_var, uint32_t element_size) { uint32_t i; uint8_t zero[4] = {0,0,0,0}; @@ -601,7 +603,7 @@ uint32_t ndr_string_length(const void *_var, uint32_t element_size) return i+1; } -NTSTATUS ndr_check_string_terminator(struct ndr_pull *ndr, uint32_t count, uint32_t element_size) +_PUBLIC_ NTSTATUS ndr_check_string_terminator(struct ndr_pull *ndr, uint32_t count, uint32_t element_size) { uint32_t i; struct ndr_pull_save save_offset; @@ -623,7 +625,7 @@ NTSTATUS ndr_check_string_terminator(struct ndr_pull *ndr, uint32_t count, uint3 return NT_STATUS_OK; } -NTSTATUS ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, int chset) +_PUBLIC_ NTSTATUS ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, int chset) { int ret; if (length == 0) { @@ -647,7 +649,7 @@ NTSTATUS ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const char **var, return NT_STATUS_OK; } -NTSTATUS ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, uint32_t length, uint8_t byte_mul, int chset) +_PUBLIC_ NTSTATUS ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, uint32_t length, uint8_t byte_mul, int chset) { ssize_t ret, required; @@ -673,7 +675,7 @@ NTSTATUS ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, } /* Return number of elements in a string in the specified charset */ -uint32_t ndr_charset_length(const void *var, int chset) +_PUBLIC_ uint32_t ndr_charset_length(const void *var, int chset) { /* FIXME: Treat special chars special here, taking chset into account */ /* Also include 0 byte */ diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 5d01531eb7..efcb0f6ea4 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -199,7 +199,7 @@ sub fn_declare($$) if (has_property($fn, "public")) { pidl_hdr "$decl;"; - pidl "$decl"; + pidl "_PUBLIC_ $decl"; } else { pidl "static $decl"; } @@ -1867,7 +1867,7 @@ sub ParseTypedefPrint($) my $args = $typefamily{$e->{DATA}->{TYPE}}->{DECL}->($e,"print"); - pidl "void ndr_print_$e->{NAME}(struct ndr_print *ndr, const char *name, $args)"; + pidl "_PUBLIC_ void ndr_print_$e->{NAME}(struct ndr_print *ndr, const char *name, $args)"; pidl_hdr "void ndr_print_$e->{NAME}(struct ndr_print *ndr, const char *name, $args);"; pidl "{"; indent; @@ -1904,7 +1904,7 @@ sub ParseFunctionPrint($) return if has_property($fn, "noprint"); - pidl "void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, const struct $fn->{NAME} *r)"; + pidl "_PUBLIC_ void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, const struct $fn->{NAME} *r)"; pidl_hdr "void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, const struct $fn->{NAME} *r);"; pidl "{"; indent; |