diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-10-20 18:59:51 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-20 18:59:51 +0200 |
commit | 87ec1d2532eb17dfd7f98431bdfa4071be57f683 (patch) | |
tree | 7543ac112a660083d05c1b4734ffb7fdc169d656 /lib/util | |
parent | 01a902f59978cebdab22aaee7d9e0c9bb78bc649 (diff) | |
download | samba-87ec1d2532eb17dfd7f98431bdfa4071be57f683.tar.gz samba-87ec1d2532eb17dfd7f98431bdfa4071be57f683.tar.xz samba-87ec1d2532eb17dfd7f98431bdfa4071be57f683.zip |
Make sure prototypes are always included, make some functions static and
remove some unused functions.
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/debug.h | 4 | ||||
-rw-r--r-- | lib/util/time.h | 7 | ||||
-rw-r--r-- | lib/util/unix_privs.c | 1 | ||||
-rw-r--r-- | lib/util/util.c | 1 | ||||
-rw-r--r-- | lib/util/util.h | 11 | ||||
-rw-r--r-- | lib/util/xfile.h | 2 |
6 files changed, 24 insertions, 2 deletions
diff --git a/lib/util/debug.h b/lib/util/debug.h index 8f4fa2a8fcf..8c634f910a9 100644 --- a/lib/util/debug.h +++ b/lib/util/debug.h @@ -80,6 +80,8 @@ enum debug_logtype {DEBUG_STDOUT = 0, DEBUG_FILE = 1, DEBUG_STDERR = 2}; */ _PUBLIC_ void dbghdr(int level, const char *location, const char *func); +_PUBLIC_ void dbghdrclass(int level, int class, const char *location, const char *func); + /** reopen the log file (usually called because the log file name might have changed) */ @@ -127,3 +129,5 @@ _PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops); macro instead. */ _PUBLIC_ void dbgtext(const char *format, ...) PRINTF_ATTRIBUTE(1,2); + +extern XFILE *dbf; diff --git a/lib/util/time.h b/lib/util/time.h index 1a1fcc999c0..42644a3954d 100644 --- a/lib/util/time.h +++ b/lib/util/time.h @@ -231,7 +231,12 @@ bool nt_time_equal(NTTIME *t1, NTTIME *t2); void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *hour,int *minute,int *second); - struct timespec nt_time_to_unix_timespec(NTTIME *nt); +time_t convert_timespec_to_time_t(struct timespec ts); + +struct timespec convert_time_t_to_timespec(time_t t); + +bool null_timespec(struct timespec ts); + #endif /* _SAMBA_TIME_H_ */ diff --git a/lib/util/unix_privs.c b/lib/util/unix_privs.c index 47c172dcfa5..f55e739a9bb 100644 --- a/lib/util/unix_privs.c +++ b/lib/util/unix_privs.c @@ -21,6 +21,7 @@ #include "includes.h" #include "system/filesys.h" +#include "../lib/util/unix_privs.h" /** * @file diff --git a/lib/util/util.c b/lib/util/util.c index 1e7991dbf13..4e2a5aab098 100644 --- a/lib/util/util.c +++ b/lib/util/util.c @@ -283,7 +283,6 @@ _PUBLIC_ bool fcntl_lock(int fd, int op, off_t offset, off_t count, int type) return true; } - void print_asc(int level, const uint8_t *buf,int len) { int i; diff --git a/lib/util/util.h b/lib/util/util.h index 110286dbc86..fc651d58af2 100644 --- a/lib/util/util.h +++ b/lib/util/util.h @@ -431,6 +431,9 @@ load a file into memory from a fd. **/ _PUBLIC_ char *fd_load(int fd, size_t *size, size_t maxsize, TALLOC_CTX *mem_ctx); + +char **file_lines_parse(char *p, size_t size, int *numlines, TALLOC_CTX *mem_ctx); + /** load a file into memory **/ @@ -585,6 +588,8 @@ _PUBLIC_ void *smb_xmemdup(const void *p, size_t size); **/ _PUBLIC_ char *smb_xstrdup(const char *s); +char *smb_xstrndup(const char *s, size_t n); + /** Like strdup but for memory. **/ @@ -609,6 +614,8 @@ _PUBLIC_ bool all_zero(const uint8_t *ptr, size_t size); */ _PUBLIC_ void *realloc_array(void *ptr, size_t el_size, unsigned count, bool free_on_fail); +void *malloc_array(size_t el_size, unsigned int count); + /* The following definitions come from lib/util/fsusage.c */ @@ -715,4 +722,8 @@ _PUBLIC_ void *talloc_check_name_abort(const void *ptr, const char *name); #define talloc_get_type_abort(ptr, type) \ (type *)talloc_check_name_abort(ptr, #type) +bool unmap_file(void *start, size_t size); + +void print_asc(int level, const uint8_t *buf,int len); + #endif /* _SAMBA_UTIL_H_ */ diff --git a/lib/util/xfile.h b/lib/util/xfile.h index aa14b7c30a5..af90f3f55c6 100644 --- a/lib/util/xfile.h +++ b/lib/util/xfile.h @@ -96,4 +96,6 @@ char *x_fgets(char *s, int size, XFILE *stream) ; * set then an error is returned */ off_t x_tseek(XFILE *f, off_t offset, int whence); +XFILE *x_fdup(const XFILE *f); + #endif /* _XFILE_H_ */ |