extern int do_smb_browse(void); /* mDNS browsing */
extern bool override_logfile;
-extern char tar_type;
static int port = 0;
static char *service;
main program
****************************************************************************/
- int main(int argc,char *argv[])
+int main(int argc,char *argv[])
{
const char **const_argv = discard_const_p(const char *, argv);
char *base_directory = NULL;
int rc = 0;
bool tar_opt = false;
bool service_opt = false;
+ extern struct tar tar_ctx;
+
struct poptOption long_options[] = {
POPT_AUTOHELP
* position of the -T option in the raw argv[]. */
{
int i;
- extern struct tar tar_ctx;
for (i = 1; i < argc; i++) {
if (strncmp("-T", argv[i],2)==0)
if(new_name_resolve_order)
lp_set_cmdline("name resolve order", new_name_resolve_order);
- if (!tar_type && !query_host && !service && !message) {
+ if (!tar_to_process(&tar_ctx) && !query_host && !service && !message) {
poptPrintUsage(pc, stderr, 0);
exit(1);
}
max_protocol = lp_client_max_protocol();
- if (tar_type) {
+ if (!tar_to_process(&tar_ctx)) {
if (cmdstr)
process_command_string(cmdstr);
rc = do_tar_op(base_directory);
#define LEN(x) (sizeof(x)/sizeof((x)[0]))
#define TAR_MAX_BLOCK_SIZE 65535
-/*
- * XXX: used in client.c, we have to export it for now.
- * corresponds to the transfer operation. Can be '\0', 'c' or 'x'
- */
-char tar_type = 0;
enum tar_operation {
TAR_NO_OPERATION,
};
struct tar {
+ bool to_process;
+
/* flags */
struct tar_mode {
enum tar_operation operation; /* create, extract */
XSET(TAR_EXCLUDE),
};
+ XBOOL(t->to_process);
XTABLE(t->mode.operation, op);
XTABLE(t->mode.selection, sel);
XINT(t->mode.blocksize);
return 1;
}
+bool tar_to_process (struct tar *t)
+{
+ return t->to_process;
+}
+
/**
* cmd_block - interactive command to change tar blocksize
*
t->mode.operation = TAR_NO_OPERATION;
t->mode.selection = TAR_NO_SELECTION;
t->mode.dry = false;
+ t->to_process = false;
while (*flag) {
switch(*flag++) {
}
}
+ t->to_process = true;
tar_dump(t);
return 1;
}