2 * Includes specific to the Director User Agent Server
4 * Kern Sibbald, August MMI
7 Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of
12 the License, or (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public
20 License along with this program; if not, write to the Free
21 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
28 typedef struct s_ua_context {
34 char *cmd; /* return command/name buffer */
35 char *args; /* command line arguments */
36 char *argk[MAX_ARGS]; /* argument keywords */
37 char *argv[MAX_ARGS]; /* argument values */
38 int argc; /* number of arguments */
39 char **prompt; /* list of prompts */
40 int max_prompts; /* max size of list */
41 int num_prompts; /* current number in list */
42 int auto_display_messages; /* if set, display messages */
43 int user_notified_msg_pending; /* set when user notified */
44 int automount; /* if set, mount after label */
48 int do_a_command(UAContext *ua, char *cmd);
49 int do_a_dot_command(UAContext *ua, char *cmd);
50 int qmessagescmd(UAContext *ua, char *cmd);
51 int open_db(UAContext *ua);
52 void close_db(UAContext *ua);
55 char *next_arg(char **s);
56 int get_cmd(UAContext *ua, char *prompt);
57 void parse_command_args(UAContext *ua);
60 void prtit(void *ctx, char *msg);
63 void bsendmsg(void *sock, char *fmt, ...);
66 STORE *select_storage_resource(UAContext *ua);
67 JOB *select_job_resource(UAContext *ua);
68 int select_pool_dbr(UAContext *ua, POOL_DBR *pr);
69 CLIENT *select_client_resource(UAContext *ua);
70 FILESET *select_fs_resource(UAContext *ua);
71 int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
73 void start_prompt(UAContext *ua, char *msg);
74 void add_prompt(UAContext *ua, char *prompt);
75 int do_prompt(UAContext *ua, char *msg, char *prompt);
76 CAT *get_catalog_resource(UAContext *ua);
77 STORE *get_storage_resource(UAContext *ua, char *cmd);
78 int get_media_type(UAContext *ua, char *MediaType);
79 int get_pool_dbr(UAContext *ua, POOL_DBR *pr);
80 POOL *get_pool_resource(UAContext *ua);
81 CLIENT *get_client_resource(UAContext *ua);
82 int get_job_dbr(UAContext *ua, JOB_DBR *jr);
84 int find_arg_keyword(UAContext *ua, char **list);
85 int do_keyword_prompt(UAContext *ua, char *msg, char **list);