2 * Prototypes for lib directory of Bacula
5 Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of
10 the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public
18 License along with this program; if not, write to the Free
19 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 void base64_init __PROTO((void));
26 int to_base64 __PROTO((intmax_t value, char *where));
27 int from_base64 __PROTO((intmax_t *value, char *where));
28 void encode_stat __PROTO((char *buf, struct stat *statp));
29 void decode_stat __PROTO((char *buf, struct stat *statp));
30 int bin_to_base64 __PROTO((char *buf, char *bin, int len));
33 void *b_malloc (char *file, int line, size_t size);
35 void *bmalloc (size_t size);
37 void *brealloc (void *buf, size_t size);
38 void *bcalloc (size_t size1, size_t size2);
39 int bsnprintf (char *str, size_t size, const char *format, ...);
40 int bvsnprintf (char *str, size_t size, const char *format, va_list ap);
41 int pool_sprintf (char *pool_buf, char *fmt, ...);
42 int create_pid_file (char *dir, char *progname, int port, char *errmsg);
43 int delete_pid_file (char *dir, char *progname, int port);
46 int32_t bnet_recv __PROTO((BSOCK *bsock));
47 int bnet_send __PROTO((BSOCK *bsock));
48 int bnet_fsend (BSOCK *bs, char *fmt, ...);
49 int bnet_set_buffer_size (BSOCK *bs, uint32_t size, int rw);
50 int bnet_sig (BSOCK *bs, int sig);
51 BSOCK * bnet_connect (void *jcr, int retry_interval,
52 int max_retry_time, char *name, char *host, char *service,
53 int port, int verbose);
54 int bnet_wait_data (BSOCK *bsock, int sec);
55 void bnet_close __PROTO((BSOCK *bsock));
56 BSOCK * init_bsock __PROTO((int sockfd, char *who, char *ip, int port));
57 BSOCK * dup_bsock __PROTO((BSOCK *bsock));
58 void term_bsock __PROTO((BSOCK *bsock));
59 char * bnet_strerror __PROTO((BSOCK *bsock));
60 char * bnet_sig_to_ascii __PROTO((BSOCK *bsock));
61 int bnet_wait_data __PROTO((BSOCK *bsock, int sec));
65 int cram_md5_get_auth(BSOCK *bs, char *password);
66 int cram_md5_auth(BSOCK *bs, char *password);
67 void hmac_md5(uint8_t* text, int text_len, uint8_t* key,
68 int key_len, uint8_t *hmac);
71 int create_file(void *jcr, char *fname, char *ofile, char *lname,
72 int type, struct stat *statp, int *ofd);
73 int set_statp(void *jcr, char *fname, char *ofile, char *lname, int type,
78 uint32_t bcrc32(uint8_t *buf, int len);
81 void daemon_start __PROTO(());
84 LEX * lex_close_file __PROTO((LEX *lf));
85 LEX * lex_open_file __PROTO((LEX *lf, char *fname));
86 int lex_get_char __PROTO((LEX *lf));
87 void lex_unget_char __PROTO((LEX *lf));
88 char * lex_tok_to_str __PROTO((int token));
89 int lex_get_token __PROTO((LEX *lf));
99 int preserve_existing,
100 char *verbose_fmt_string);
104 void my_name_is __PROTO((int argc, char *argv[], char *name));
105 void init_msg __PROTO((void *jcr));
106 void term_msg __PROTO((void));
107 void close_msg __PROTO((void *jcr));
108 void add_msg_dest __PROTO((int dest, int type, char *where, char *dest_code));
109 void rem_msg_dest __PROTO((int dest, int type, char *where));
110 void Jmsg (void *jcr, int type, int level, char *fmt, ...);
111 void dispatch_message __PROTO((void *jcr, int type, int level, char *buf));
112 void init_console_msg __PROTO((char *wd));
116 void bnet_thread_server(int port, int max_clients, workq_t *client_wq,
117 void handle_client_request(void *bsock));
118 void bnet_server __PROTO((int port, void handle_client_request(BSOCK *bsock)));
119 int net_connect __PROTO((int port));
120 BSOCK * bnet_bind __PROTO((int port));
121 BSOCK * bnet_accept __PROTO((BSOCK *bsock, char *who));
124 void init_signals __PROTO((void terminate(int sig)));
125 void init_stack_dump (void);
128 void lcase __PROTO((char *str));
129 void bash_spaces __PROTO((char *str));
130 void unbash_spaces __PROTO((char *str));
131 void strip_trailing_junk __PROTO((char *str));
132 void strip_trailing_slashes __PROTO((char *dir));
133 int skip_spaces __PROTO((char **msg));
134 int skip_nonspaces __PROTO((char **msg));
135 int fstrsch __PROTO((char *a, char *b));
136 char * encode_time __PROTO((time_t time, char *buf));
137 char * encode_mode __PROTO((mode_t mode, char *buf));
138 char * edit_uint_with_commas __PROTO((uint64_t val, char *buf));
139 char * add_commas __PROTO((char *val, char *buf));
140 char * edit_uint (uint64_t val, char *buf);
141 int do_shell_expansion (char *name);
142 int is_a_number (const char *num);
146 *void print_ls_output __PROTO((char *fname, char *lname, int type, struct stat *statp));
150 int init_watchdog(void);
151 int term_watchdog(void);