Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/util/util.h

    r414 r740  
    2222#define _SAMBA_UTIL_H_
    2323
    24 #if _SAMBA_BUILD_ == 4
    25 #include "../lib/util/charset/charset.h"
    26 #endif
    27 #include "../lib/util/attr.h"
     24#include "lib/util/charset/charset.h"
     25#include "lib/util/attr.h"
    2826
    2927/* for TALLOC_CTX */
     
    4038extern const char *panic_action;
    4139
    42 #include "../lib/util/time.h"
    43 #include "../lib/util/data_blob.h"
    44 #include "../lib/util/xfile.h"
    45 #include "../lib/util/mutex.h"
    46 #include "../lib/util/byteorder.h"
    47 #include "../lib/util/talloc_stack.h"
     40#include "lib/util/time.h"
     41#include "lib/util/data_blob.h"
     42#include "lib/util/xfile.h"
     43#include "lib/util/byteorder.h"
     44#include "lib/util/talloc_stack.h"
    4845
    4946/**
     
    6158#endif
    6259
    63 #if _SAMBA_BUILD_ == 4
    64 #ifdef VALGRIND
    65 #define strlen(x) valgrind_strlen(x)
    66 size_t valgrind_strlen(const char *s);
    67 #endif
    68 #endif
    69 
    7060#ifndef ABS
    7161#define ABS(a) ((a)>0?(a):(-(a)))
    7262#endif
    7363
    74 #include "../lib/util/memory.h"
     64#include "lib/util/memory.h"
    7565
    7666/**
     
    8979**/
    9080_PUBLIC_ void fault_setup(const char *pname);
     81_PUBLIC_ void fault_setup_disable(void);
    9182#endif
    9283
     
    143134_PUBLIC_ pid_t sys_getpid(void);
    144135
     136_PUBLIC_ int sys_getpeereid( int s, uid_t *uid);
     137
     138struct sockaddr;
     139
     140_PUBLIC_ int sys_getnameinfo(const struct sockaddr *psa,
     141                             int salen,
     142                             char *host,
     143                             size_t hostlen,
     144                             char *service,
     145                             size_t servlen,
     146                             int flags);
     147_PUBLIC_ int sys_connect(int fd, const struct sockaddr * addr);
     148
    145149/* The following definitions come from lib/util/genrand.c  */
    146 
    147150/**
    148151 Copy any user given reseed data.
     
    177180**/
    178181_PUBLIC_ bool check_password_quality(const char *s);
     182
     183/**
     184 * Generate a random text password.
     185 */
     186_PUBLIC_ char *generate_random_password(TALLOC_CTX *mem_ctx, size_t min, size_t max);
    179187
    180188/**
     
    451459/**
    452460 * build a null terminated list of strings from an argv-like input string
    453  * Entries are seperated by spaces and can be enclosed by quotes.
     461 * Entries are separated by spaces and can be enclosed by quotes.
    454462 * Does NOT support escaping
    455463 */
     
    459467 * join a list back to one string
    460468 */
    461 _PUBLIC_ char *str_list_join(TALLOC_CTX *mem_ctx, const char **list, char seperator);
     469_PUBLIC_ char *str_list_join(TALLOC_CTX *mem_ctx, const char **list, char separator);
    462470
    463471/** join a list back to one (shell-like) string; entries
    464  * seperated by spaces, using quotes where necessary */
     472 * separated by spaces, using quotes where necessary */
    465473_PUBLIC_ char *str_list_join_shell(TALLOC_CTX *mem_ctx, const char **list, char sep);
    466474
     
    478486   Return true if all the elements of the list match exactly.
    479487 */
    480 _PUBLIC_ bool str_list_equal(const char **list1, const char **list2);
     488_PUBLIC_ bool str_list_equal(const char * const *list1, const char * const *list2);
    481489
    482490/**
     
    535543_PUBLIC_ const char **str_list_copy_const(TALLOC_CTX *mem_ctx,
    536544                                          const char **list);
     545
     546/**
     547 * Needed for making an "unconst" list "const"
     548 */
     549_PUBLIC_ const char **const_str_list(char **list);
    537550
    538551
     
    597610_PUBLIC_ bool large_file_support(const char *path);
    598611
     612/*
     613  compare two files, return true if the two files have the same content
     614 */
     615bool file_compare(const char *path1, const char *path2);
     616
    599617/* The following definitions come from lib/util/util.c  */
    600618
     
    641659 Sleep for a specified number of milliseconds.
    642660**/
    643 _PUBLIC_ void msleep(unsigned int t);
     661_PUBLIC_ void smb_msleep(unsigned int t);
    644662
    645663/**
     
    647665**/
    648666_PUBLIC_ char* get_myname(TALLOC_CTX *mem_ctx);
    649 
    650 /**
    651  Return true if a string could be a pure IP address.
    652 **/
    653 _PUBLIC_ bool is_ipaddress(const char *str);
    654 
    655 /**
    656  Interpret an internet address or name into an IP address in 4 byte form.
    657 **/
    658 _PUBLIC_ uint32_t interpret_addr(const char *str);
    659 
    660 /**
    661  A convenient addition to interpret_addr().
    662 **/
    663 _PUBLIC_ struct in_addr interpret_addr2(const char *str);
    664 
    665 /**
    666  Check if an IP is the 0.0.0.0.
    667 **/
    668 _PUBLIC_ bool is_zero_ip_v4(struct in_addr ip);
    669 
    670 /**
    671  Are two IPs on the same subnet?
    672 **/
    673 _PUBLIC_ bool same_net_v4(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
    674 
    675 _PUBLIC_ bool is_ipaddress_v4(const char *str);
    676667
    677668/**
     
    687678
    688679/**
     680 * Write dump of binary data to a callback
     681 */
     682void dump_data_cb(const uint8_t *buf, int len,
     683                  bool omit_zero_bytes,
     684                  void (*cb)(const char *buf, void *private_data),
     685                  void *private_data);
     686
     687/**
    689688 * Write dump of binary data to the log file.
    690689 *
     
    697696 *
    698697 * The data is only written if the log level is at least level.
    699  * 16 zero bytes in a row are ommited
     698 * 16 zero bytes in a row are omitted
    700699 */
    701700_PUBLIC_ void dump_data_skip_zeros(int level, const uint8_t *buf, int len);
     
    784783#endif
    785784
    786 /* The following definitions come from lib/util/mutex.c  */
    787 
    788 
    789 /**
    790   register a set of mutex/rwlock handlers.
    791   Should only be called once in the execution of smbd.
    792 */
    793 _PUBLIC_ bool register_mutex_handlers(const char *name, struct mutex_ops *ops);
    794 
    795785/* The following definitions come from lib/util/idtree.c  */
    796786
     
    840830 Become a daemon, discarding the controlling terminal.
    841831**/
    842 _PUBLIC_ void become_daemon(bool do_fork, bool no_process_group);
     832_PUBLIC_ void become_daemon(bool do_fork, bool no_process_group, bool log_stdout);
    843833
    844834/**
     
    853843
    854844void print_asc(int level, const uint8_t *buf,int len);
     845void print_asc_cb(const uint8_t *buf, int len,
     846                  void (*cb)(const char *buf, void *private_data),
     847                  void *private_data);
    855848
    856849/**
     
    862855
    863856bool add_uid_to_array_unique(TALLOC_CTX *mem_ctx, uid_t uid,
    864                              uid_t **uids, size_t *num_uids);
     857                             uid_t **uids, uint32_t *num_uids);
    865858bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid,
    866                              gid_t **gids, size_t *num_gids);
    867 
     859                             gid_t **gids, uint32_t *num_gids);
     860
     861/**
     862 * Allocate anonymous shared memory of the given size
     863 */
     864void *anonymous_shared_allocate(size_t bufsz);
     865void anonymous_shared_free(void *ptr);
     866
     867/*
     868  run a command as a child process, with a timeout.
     869
     870  any stdout/stderr from the child will appear in the Samba logs with
     871  the specified log levels
     872
     873  If callback is set then the callback is called on completion
     874  with the return code from the command
     875 */
     876struct tevent_context;
     877struct tevent_req;
     878struct tevent_req *samba_runcmd_send(TALLOC_CTX *mem_ctx,
     879                                     struct tevent_context *ev,
     880                                     struct timeval endtime,
     881                                     int stdout_log_level,
     882                                     int stderr_log_level,
     883                                     const char * const *argv0, ...);
     884int samba_runcmd_recv(struct tevent_req *req, int *perrno);
     885
     886#ifdef DEVELOPER
     887void samba_start_debugger(void);
     888#endif
    868889
    869890#endif /* _SAMBA_UTIL_H_ */
Note: See TracChangeset for help on using the changeset viewer.