diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-03-05 17:44:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:52:15 -0500 |
commit | c71c86c52458eefae8a34774ec186c2837f473af (patch) | |
tree | caeda5cdb47d5f6fefb4eabb50e66187823e5ac4 /source4/lib | |
parent | af30a32b6924b0f2b701186e435defbca2ebd1aa (diff) | |
download | samba-c71c86c52458eefae8a34774ec186c2837f473af.tar.gz samba-c71c86c52458eefae8a34774ec186c2837f473af.tar.bz2 samba-c71c86c52458eefae8a34774ec186c2837f473af.zip |
r13842: Make some more functions public.
(This used to be commit aac1b99b362993352d80692afa55c38fc851c016)
Diffstat (limited to 'source4/lib')
-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 |
7 files changed, 52 insertions, 50 deletions
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; |