2 Patch to allow more natural input of time durations.
3 Permitted form is "1 day 2 hours 5 sec" with and without
4 spaces. The different duration specifications (day, hour, ...)
6 Apply to version 1.34.6 with:
9 patch -p0 <1.34.6-duration.patch
13 Index: src/dird/ua_cmds.c
14 ===================================================================
15 RCS file: /cvsroot/bacula/bacula/src/dird/ua_cmds.c,v
16 retrieving revision 1.112
17 diff -u -r1.112 ua_cmds.c
18 --- src/dird/ua_cmds.c 8 Jun 2004 08:44:04 -0000 1.112
19 +++ src/dird/ua_cmds.c 5 Aug 2004 19:58:51 -0000
22 static void update_volretention(UAContext *ua, char *val, MEDIA_DBR *mr)
27 if (!duration_to_utime(val, &mr->VolRetention)) {
28 bsendmsg(ua, _("Invalid retention period specified: %s\n"), val);
30 if (!db_sql_query(ua->db, query, NULL, NULL)) {
31 bsendmsg(ua, "%s", db_strerror(ua->db));
33 - bsendmsg(ua, _("New retention seconds is: %s\n"),
34 + bsendmsg(ua, _("New retention period is: %s\n"),
35 edit_utime(mr->VolRetention, ed1));
37 free_pool_memory(query);
40 static void update_voluseduration(UAContext *ua, char *val, MEDIA_DBR *mr)
46 if (!duration_to_utime(val, &mr->VolUseDuration)) {
55 N_("VolStatus"), /* 0 */
57 update_volstatus(ua, ua->cmd, &mr);
59 case 1: /* Retention */
60 - bsendmsg(ua, _("Current retention seconds is: %s\n"),
61 + bsendmsg(ua, _("Current retention period is: %s\n"),
62 edit_utime(mr.VolRetention, ed1));
63 if (!get_cmd(ua, _("Enter Volume Retention period: "))) {
65 Index: src/dird/ua_select.c
66 ===================================================================
67 RCS file: /cvsroot/bacula/bacula/src/dird/ua_select.c,v
68 retrieving revision 1.50
69 diff -u -r1.50 ua_select.c
70 --- src/dird/ua_select.c 5 Jun 2004 10:15:55 -0000 1.50
71 +++ src/dird/ua_select.c 5 Aug 2004 19:58:52 -0000
74 int confirm_retention(UAContext *ua, utime_t *ret, char *msg)
80 bsendmsg(ua, _("The current %s retention period is: %s\n"),
82 ===================================================================
83 RCS file: /cvsroot/bacula/bacula/src/lib/edit.c,v
84 retrieving revision 1.17
86 --- src/lib/edit.c 10 Jun 2004 09:45:41 -0000 1.17
87 +++ src/lib/edit.c 5 Aug 2004 19:58:54 -0000
90 * Kern Sibbald, December MMII
103 * Edit an integer number with commas, the supplied buffer
104 * must be at least 27 bytes long. The incoming number
107 char *edit_uint64_with_commas(uint64_t val, char *buf)
109 - sprintf(buf, "%" llu, val);
111 + * Replacement for sprintf(buf, "%" llu, val)
114 + mbuf[sizeof(mbuf)-1] = 0;
115 + int i = sizeof(mbuf)-2; /* edit backward */
120 + mbuf[i--] = "0123456789"[val%10];
124 + strcpy(buf, &mbuf[i+1]);
125 return add_commas(buf, buf);
130 char *edit_uint64(uint64_t val, char *buf)
132 - sprintf(buf, "%" llu, val);
134 + * Replacement for sprintf(buf, "%" llu, val)
137 + mbuf[sizeof(mbuf)-1] = 0;
138 + int i = sizeof(mbuf)-2; /* edit backward */
143 + mbuf[i--] = "0123456789"[val%10];
147 + strcpy(buf, &mbuf[i+1]);
152 * Given a string "str", separate the integer part into
153 * str, and the modifier into mod.
155 -static bool get_modifier(char *str, char *mod, int mod_len)
156 +static bool get_modifier(char *str, char *num, int num_len, char *mod, int mod_len)
159 + int i, len, num_begin, num_end, mod_begin, mod_end;
162 * Look for modifier by walking back looking for the first
164 @@ -114,36 +142,50 @@
165 strip_trailing_junk(str);
168 - /* Find beginning of the modifier */
169 - for (i=len; i > 0; i--) {
170 - if (!B_ISALPHA(str[i-1])) {
171 + for (i=0; i<len; i++) {
172 + if (!B_ISSPACE(str[i])) {
178 - /* If nothing found, error */
180 - Dmsg2(200, "error i=%d len=%d\n", i, len);
181 + /* Walk through integer part */
182 + for ( ; i<len; i++) {
183 + if (!B_ISDIGIT(str[i])) {
188 + if (num_len > (num_end - num_begin + 1)) {
189 + num_len = num_end - num_begin + 1;
191 + if (num_len == 0) {
195 - /* Move modifier to its location */
196 - bstrncpy(mod, &str[i], mod_len);
197 - Dmsg2(200, "in=%s mod=%s:\n", str, mod);
199 - /* Backup over any spaces in front of modifier */
200 - for ( ; i > 0; i--) {
201 - if (B_ISSPACE(str[i-1])) {
203 + for ( ; i<len; i++) {
204 + if (!B_ISSPACE(str[i])) {
209 + for ( ; i<len; i++) {
210 + if (!B_ISALPHA(str[i])) {
216 - /* The remainder (beginning) should be our number */
217 - if (!is_a_number(str)) {
218 - Dmsg0(200, "input not a number\n");
220 + if (mod_len > (mod_end - mod_begin + 1)) {
221 + mod_len = mod_end - mod_begin + 1;
223 + Dmsg5(900, "str=%s: num_beg=%d num_end=%d mod_beg=%d mod_end=%d\n",
224 + str, num_begin, num_end, mod_begin, mod_end);
225 + bstrncpy(num, &str[num_begin], num_len);
226 + bstrncpy(mod, &str[mod_begin], mod_len);
227 + if (!is_a_number(num)) {
230 + bstrncpy(str, &str[mod_end], len);
236 int duration_to_utime(char *str, utime_t *value)
240 + double val, total = 0.0;
244 * The "n" = mins and months appears before minutes so that m maps
245 * to months. These "kludges" make it compatible with pre 1.31
246 @@ -167,26 +210,33 @@
247 static const int32_t mult[] = {60, 1, 60*60*24*30, 60,
248 60*60, 60*60*24, 60*60*24*7, 60*60*24*91, 60*60*24*365};
250 - if (!get_modifier(str, mod_str, sizeof(mod_str))) {
253 - /* Now find the multiplier corresponding to the modifier */
254 - mod_len = strlen(mod_str);
255 - for (i=0; mod[i]; i++) {
256 - if (strncasecmp(mod_str, mod[i], mod_len) == 0) {
259 + if (!get_modifier(str, num_str, sizeof(num_str), mod_str, sizeof(mod_str))) {
262 + /* Now find the multiplier corresponding to the modifier */
263 + mod_len = strlen(mod_str);
264 + if (mod_len == 0) {
265 + i = 1; /* assume seconds */
267 + for (i=0; mod[i]; i++) {
268 + if (strncasecmp(mod_str, mod[i], mod_len) == 0) {
272 + if (mod[i] == NULL) {
273 + i = 1; /* no modifier, assume secs */
276 + Dmsg2(900, "str=%s: mult=%d\n", num_str, mult[i]);
278 + val = strtod(num_str, NULL);
279 + if (errno != 0 || val < 0) {
282 + total += val * mult[i];
284 - if (mod[i] == NULL) {
285 - i = 1; /* no modifier, assume 1 */
287 - Dmsg2(200, "str=%s: mult=%d\n", str, mult[i]);
289 - val = strtod(str, NULL);
290 - if (errno != 0 || val < 0) {
293 - *value = (utime_t)(val * mult[i]);
294 + *value = (utime_t)total;
298 @@ -195,32 +245,33 @@
300 char *edit_utime(utime_t val, char *buf)
304 static const int32_t mult[] = {60*60*24*365, 60*60*24*30, 60*60*24, 60*60, 60};
305 static const char *mod[] = {"year", "month", "day", "hour", "min"};
311 for (i=0; i<5; i++) {
312 times = (uint32_t)(val / mult[i]);
314 val = val - (utime_t)times * mult[i];
315 - sprintf(mybuf, "%d %s%s ", times, mod[i], times>1?"s":"");
316 - strcat(buf, mybuf);
317 + bsnprintf(mybuf, sizeof(mybuf), "%d %s%s ", times, mod[i], times>1?"s":"");
318 + bstrncat(buf, mybuf, buf_len);
321 if (val == 0 && strlen(buf) == 0) {
322 - strcat(buf, "0 secs");
323 + bstrncat(buf, "0 secs", buf_len);
324 } else if (val != 0) {
325 - sprintf(mybuf, "%d sec%s", (uint32_t)val, val>1?"s":"");
326 - strcat(buf, mybuf);
327 + bsnprintf(mybuf, sizeof(mybuf), "%d sec%s", (uint32_t)val, val>1?"s":"");
328 + bstrncat(buf, mybuf, buf_len);
334 - * Convert a size size in bytes to uint64_t
335 + * Convert a size in bytes to uint64_t
336 * Returns 0: if error
337 1: if OK, and value stored in value
344 static const char *mod[] = {"*", "k", "kb", "m", "mb", "g", "gb", NULL}; /* first item * not used */
345 const int64_t mult[] = {1, /* byte */
348 1073741824, /* gigabyte */
349 1000000000}; /* gb gigabyte */
351 - if (!get_modifier(str, mod_str, sizeof(mod_str))) {
352 + if (!get_modifier(str, num_str, sizeof(num_str), mod_str, sizeof(mod_str))) {
355 /* Now find the multiplier corresponding to the modifier */
357 if (mod[i] == NULL) {
358 i = 0; /* no modifier found, assume 1 */
360 - Dmsg2(200, "str=%s: mult=%d\n", str, mult[i]);
361 + Dmsg2(900, "str=%s: mult=%d\n", str, mult[i]);
363 - val = strtod(str, NULL);
364 + val = strtod(num_str, NULL);
365 if (errno != 0 || val < 0) {
369 * Check if specified string is a number or not.
370 * Taken from SQLite, cool, thanks.
372 -int is_a_number(const char *n)
373 +bool is_a_number(const char *n)
375 bool digit_seen = false;
379 * Check if the specified string is an integer
381 -int is_an_integer(const char *n)
382 +bool is_an_integer(const char *n)
384 bool digit_seen = false;
385 while (B_ISDIGIT(*n)) {
386 Index: src/lib/protos.h
387 ===================================================================
388 RCS file: /cvsroot/bacula/bacula/src/lib/protos.h,v
389 retrieving revision 1.77
390 diff -u -r1.77 protos.h
391 --- src/lib/protos.h 12 Jun 2004 07:51:26 -0000 1.77
392 +++ src/lib/protos.h 5 Aug 2004 19:58:54 -0000
398 -void free_attr(ATTR *attr);
399 -int unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, ATTR *attr);
400 -void build_attr_output_fnames(JCR *jcr, ATTR *attr);
401 -void print_ls_output(JCR *jcr, ATTR *attr);
403 +void free_attr(ATTR *attr);
404 +int unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, ATTR *attr);
405 +void build_attr_output_fnames(JCR *jcr, ATTR *attr);
406 +void print_ls_output(JCR *jcr, ATTR *attr);
409 -void base64_init (void);
410 -int to_base64 (intmax_t value, char *where);
411 -int from_base64 (intmax_t *value, char *where);
412 -int bin_to_base64 (char *buf, char *bin, int len);
413 +void base64_init (void);
414 +int to_base64 (intmax_t value, char *where);
415 +int from_base64 (intmax_t *value, char *where);
416 +int bin_to_base64 (char *buf, char *bin, int len);
419 -char *bstrncpy (char *dest, const char *src, int maxlen);
420 -char *bstrncat (char *dest, const char *src, int maxlen);
421 -void *b_malloc (const char *file, int line, size_t size);
422 +char *bstrncpy (char *dest, const char *src, int maxlen);
423 +char *bstrncat (char *dest, const char *src, int maxlen);
424 +void *b_malloc (const char *file, int line, size_t size);
426 -void *bmalloc (size_t size);
427 +void *bmalloc (size_t size);
429 -void *brealloc (void *buf, size_t size);
430 -void *bcalloc (size_t size1, size_t size2);
431 -int bsnprintf (char *str, int32_t size, const char *format, ...);
432 -int bvsnprintf (char *str, int32_t size, const char *format, va_list ap);
433 -int pool_sprintf (char *pool_buf, const char *fmt, ...);
434 -void create_pid_file (char *dir, const char *progname, int port);
435 -int delete_pid_file (char *dir, const char *progname, int port);
436 -void drop (char *uid, char *gid);
437 -int bmicrosleep (time_t sec, long usec);
438 -char *bfgets (char *s, int size, FILE *fd);
439 -void make_unique_filename (POOLMEM **name, int Id, char *what);
440 +void *brealloc (void *buf, size_t size);
441 +void *bcalloc (size_t size1, size_t size2);
442 +int bsnprintf (char *str, int32_t size, const char *format, ...);
443 +int bvsnprintf (char *str, int32_t size, const char *format, va_list ap);
444 +int pool_sprintf (char *pool_buf, const char *fmt, ...);
445 +void create_pid_file (char *dir, const char *progname, int port);
446 +int delete_pid_file (char *dir, const char *progname, int port);
447 +void drop (char *uid, char *gid);
448 +int bmicrosleep (time_t sec, long usec);
449 +char *bfgets (char *s, int size, FILE *fd);
450 +void make_unique_filename (POOLMEM **name, int Id, char *what);
452 -long long int strtoll (const char *ptr, char **endptr, int base);
453 +long long int strtoll (const char *ptr, char **endptr, int base);
455 void read_state_file(char *dir, const char *progname, int port);
458 -int32_t bnet_recv (BSOCK *bsock);
459 -int bnet_send (BSOCK *bsock);
460 -int bnet_fsend (BSOCK *bs, const char *fmt, ...);
461 -int bnet_set_buffer_size (BSOCK *bs, uint32_t size, int rw);
462 -int bnet_sig (BSOCK *bs, int sig);
463 -int bnet_ssl_server (BSOCK *bsock, char *password, int ssl_need, int ssl_has);
464 -int bnet_ssl_client (BSOCK *bsock, char *password, int ssl_need);
465 -BSOCK * bnet_connect (JCR *jcr, int retry_interval,
466 - int max_retry_time, const char *name, char *host, char *service,
467 - int port, int verbose);
468 -void bnet_close (BSOCK *bsock);
469 -BSOCK * init_bsock (JCR *jcr, int sockfd, const char *who, char *ip,
470 - int port, struct sockaddr_in *client_addr);
471 -BSOCK * dup_bsock (BSOCK *bsock);
472 -void term_bsock (BSOCK *bsock);
473 -char * bnet_strerror (BSOCK *bsock);
474 -char * bnet_sig_to_ascii (BSOCK *bsock);
475 -int bnet_wait_data (BSOCK *bsock, int sec);
476 -int bnet_wait_data_intr (BSOCK *bsock, int sec);
477 -int bnet_despool_to_bsock (BSOCK *bsock, void update(ssize_t size), ssize_t size);
478 -int is_bnet_stop (BSOCK *bsock);
479 -int is_bnet_error (BSOCK *bsock);
480 -void bnet_suppress_error_messages(BSOCK *bsock, bool flag);
481 +int32_t bnet_recv (BSOCK *bsock);
482 +int bnet_send (BSOCK *bsock);
483 +int bnet_fsend (BSOCK *bs, const char *fmt, ...);
484 +int bnet_set_buffer_size (BSOCK *bs, uint32_t size, int rw);
485 +int bnet_sig (BSOCK *bs, int sig);
486 +int bnet_ssl_server (BSOCK *bsock, char *password, int ssl_need, int ssl_has);
487 +int bnet_ssl_client (BSOCK *bsock, char *password, int ssl_need);
488 +BSOCK * bnet_connect (JCR *jcr, int retry_interval,
489 + int max_retry_time, const char *name, char *host, char *service,
490 + int port, int verbose);
491 +void bnet_close (BSOCK *bsock);
492 +BSOCK * init_bsock (JCR *jcr, int sockfd, const char *who, char *ip,
493 + int port, struct sockaddr_in *client_addr);
494 +BSOCK * dup_bsock (BSOCK *bsock);
495 +void term_bsock (BSOCK *bsock);
496 +char * bnet_strerror (BSOCK *bsock);
497 +char * bnet_sig_to_ascii (BSOCK *bsock);
498 +int bnet_wait_data (BSOCK *bsock, int sec);
499 +int bnet_wait_data_intr (BSOCK *bsock, int sec);
500 +int bnet_despool_to_bsock (BSOCK *bsock, void update(ssize_t size), ssize_t size);
501 +int is_bnet_stop (BSOCK *bsock);
502 +int is_bnet_error (BSOCK *bsock);
503 +void bnet_suppress_error_messages(BSOCK *bsock, bool flag);
506 -int bget_msg(BSOCK *sock);
507 +int bget_msg(BSOCK *sock);
510 -BPIPE * open_bpipe(char *prog, int wait, const char *mode);
511 -int close_wpipe(BPIPE *bpipe);
512 -int close_bpipe(BPIPE *bpipe);
513 +BPIPE * open_bpipe(char *prog, int wait, const char *mode);
514 +int close_wpipe(BPIPE *bpipe);
515 +int close_bpipe(BPIPE *bpipe);
518 int cram_md5_get_auth(BSOCK *bs, char *password, int ssl_need);
519 int cram_md5_auth(BSOCK *bs, char *password, int ssl_need);
520 void hmac_md5(uint8_t* text, int text_len, uint8_t* key,
521 - int key_len, uint8_t *hmac);
522 + int key_len, uint8_t *hmac);
526 uint32_t bcrc32(uint8_t *buf, int len);
529 -void daemon_start ();
530 +void daemon_start ();
533 -uint64_t str_to_uint64(char *str);
534 -int64_t str_to_int64(char *str);
535 -char * edit_uint64_with_commas (uint64_t val, char *buf);
536 -char * add_commas (char *val, char *buf);
537 -char * edit_uint64 (uint64_t val, char *buf);
538 -int duration_to_utime (char *str, utime_t *value);
539 -int size_to_uint64(char *str, int str_len, uint64_t *rtn_value);
540 -char *edit_utime (utime_t val, char *buf);
541 -int is_a_number (const char *num);
542 -int is_an_integer (const char *n);
543 -bool is_name_valid (char *name, POOLMEM **msg);
544 +uint64_t str_to_uint64(char *str);
545 +int64_t str_to_int64(char *str);
546 +char * edit_uint64_with_commas (uint64_t val, char *buf);
547 +char * add_commas (char *val, char *buf);
548 +char * edit_uint64 (uint64_t val, char *buf);
549 +int duration_to_utime (char *str, utime_t *value);
550 +int size_to_uint64(char *str, int str_len, uint64_t *rtn_value);
551 +char *edit_utime (utime_t val, char *buf);
552 +bool is_a_number (const char *num);
553 +bool is_an_integer (const char *n);
554 +bool is_name_valid (char *name, POOLMEM **msg);
556 /* jcr.c (most definitions are in src/jcr.h) */
557 void init_last_jobs_list();
558 @@ -132,36 +132,36 @@
562 -LEX * lex_close_file (LEX *lf);
563 -LEX * lex_open_file (LEX *lf, const char *fname, LEX_ERROR_HANDLER *scan_error);
564 -int lex_get_char (LEX *lf);
565 -void lex_unget_char (LEX *lf);
566 -const char * lex_tok_to_str (int token);
567 -int lex_get_token (LEX *lf, int expect);
568 +LEX * lex_close_file (LEX *lf);
569 +LEX * lex_open_file (LEX *lf, const char *fname, LEX_ERROR_HANDLER *scan_error);
570 +int lex_get_char (LEX *lf);
571 +void lex_unget_char (LEX *lf);
572 +const char * lex_tok_to_str (int token);
573 +int lex_get_token (LEX *lf, int expect);
576 -void my_name_is (int argc, char *argv[], const char *name);
577 -void init_msg (JCR *jcr, MSGS *msg);
578 -void term_msg (void);
579 -void close_msg (JCR *jcr);
580 -void add_msg_dest (MSGS *msg, int dest, int type, char *where, char *dest_code);
581 -void rem_msg_dest (MSGS *msg, int dest, int type, char *where);
582 -void Jmsg (JCR *jcr, int type, int level, const char *fmt, ...);
583 -void dispatch_message (JCR *jcr, int type, int level, char *buf);
584 -void init_console_msg (char *wd);
585 -void free_msgs_res (MSGS *msgs);
586 -void dequeue_messages (JCR *jcr);
587 -void set_trace (int trace_flag);
588 -void set_exit_on_error (int value);
589 +void my_name_is (int argc, char *argv[], const char *name);
590 +void init_msg (JCR *jcr, MSGS *msg);
591 +void term_msg (void);
592 +void close_msg (JCR *jcr);
593 +void add_msg_dest (MSGS *msg, int dest, int type, char *where, char *dest_code);
594 +void rem_msg_dest (MSGS *msg, int dest, int type, char *where);
595 +void Jmsg (JCR *jcr, int type, int level, const char *fmt, ...);
596 +void dispatch_message (JCR *jcr, int type, int level, char *buf);
597 +void init_console_msg (char *wd);
598 +void free_msgs_res (MSGS *msgs);
599 +void dequeue_messages (JCR *jcr);
600 +void set_trace (int trace_flag);
601 +void set_exit_on_error (int value);
604 -void bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_wq,
605 - void *handle_client_request(void *bsock));
606 -void bnet_stop_thread_server(pthread_t tid);
607 -void bnet_server (int port, void handle_client_request(BSOCK *bsock));
608 -int net_connect (int port);
609 -BSOCK * bnet_bind (int port);
610 -BSOCK * bnet_accept (BSOCK *bsock, char *who);
611 +void bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_wq,
612 + void *handle_client_request(void *bsock));
613 +void bnet_stop_thread_server(pthread_t tid);
614 +void bnet_server (int port, void handle_client_request(BSOCK *bsock));
615 +int net_connect (int port);
616 +BSOCK * bnet_bind (int port);
617 +BSOCK * bnet_accept (BSOCK *bsock, char *who);
620 char *getuser(uid_t uid);
621 @@ -171,41 +171,41 @@
625 -void init_signals (void terminate(int sig));
626 -void init_stack_dump (void);
627 +void init_signals (void terminate(int sig));
628 +void init_stack_dump (void);
631 -void strip_trailing_junk (char *str);
632 -void strip_trailing_slashes (char *dir);
633 -bool skip_spaces (char **msg);
634 -bool skip_nonspaces (char **msg);
635 -int fstrsch (char *a, char *b);
636 -char *next_arg(char **s);
637 -int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc,
638 - char **argk, char **argv, int max_args);
639 -void split_path_and_filename(const char *fname, POOLMEM **path,
640 - int *pnl, POOLMEM **file, int *fnl);
641 -int bsscanf(const char *buf, const char *fmt, ...);
642 +void strip_trailing_junk (char *str);
643 +void strip_trailing_slashes (char *dir);
644 +bool skip_spaces (char **msg);
645 +bool skip_nonspaces (char **msg);
646 +int fstrsch (char *a, char *b);
647 +char *next_arg(char **s);
648 +int parse_args(POOLMEM *cmd, POOLMEM **args, int *argc,
649 + char **argk, char **argv, int max_args);
650 +void split_path_and_filename(const char *fname, POOLMEM **path,
651 + int *pnl, POOLMEM **file, int *fnl);
652 +int bsscanf(const char *buf, const char *fmt, ...);
656 -int is_buf_zero (char *buf, int len);
657 -void lcase (char *str);
658 -void bash_spaces (char *str);
659 -void unbash_spaces (char *str);
660 -char * encode_time (time_t time, char *buf);
661 -char * encode_mode (mode_t mode, char *buf);
662 -int do_shell_expansion (char *name, int name_len);
663 -void jobstatus_to_ascii (int JobStatus, char *msg, int maxlen);
664 -int pm_strcat (POOLMEM **pm, const char *str);
665 -int pm_strcpy (POOLMEM **pm, const char *str);
666 -int run_program (char *prog, int wait, POOLMEM *results);
667 -char * job_type_to_str (int type);
668 -char * job_status_to_str (int stat);
669 -char * job_level_to_str (int level);
670 -void make_session_key (char *key, char *seed, int mode);
671 -POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to);
672 -void set_working_directory(char *wd);
673 +int is_buf_zero (char *buf, int len);
674 +void lcase (char *str);
675 +void bash_spaces (char *str);
676 +void unbash_spaces (char *str);
677 +char * encode_time (time_t time, char *buf);
678 +char * encode_mode (mode_t mode, char *buf);
679 +int do_shell_expansion (char *name, int name_len);
680 +void jobstatus_to_ascii (int JobStatus, char *msg, int maxlen);
681 +int pm_strcat (POOLMEM **pm, const char *str);
682 +int pm_strcpy (POOLMEM **pm, const char *str);
683 +int run_program (char *prog, int wait, POOLMEM *results);
684 +char * job_type_to_str (int type);
685 +char * job_status_to_str (int stat);
686 +char * job_level_to_str (int level);
687 +void make_session_key (char *key, char *seed, int mode);
688 +POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to);
689 +void set_working_directory(char *wd);