From c71c86c52458eefae8a34774ec186c2837f473af Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 5 Mar 2006 17:44:16 +0000 Subject: r13842: Make some more functions public. (This used to be commit aac1b99b362993352d80692afa55c38fc851c016) --- source4/lib/charset/charcnv.c | 32 ++++++++++++++++---------------- source4/lib/crypto/hmacmd5.c | 10 +++++----- source4/lib/crypto/md4.c | 6 ++++-- source4/lib/events/events.c | 2 +- source4/lib/netif/interface.c | 16 ++++++++-------- source4/lib/util/substitute.c | 30 +++++++++++++++--------------- source4/lib/util/system.c | 6 +++--- 7 files changed, 52 insertions(+), 50 deletions(-) (limited to 'source4/lib') 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;c1ctx, 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; -- cgit