static void baculaFree(bpContext *ctx, const char *file, int line, void *mem);
static bRC baculaAddExclude(bpContext *ctx, const char *file);
static bRC baculaAddInclude(bpContext *ctx, const char *file);
-static bRC baculaAddIncludeOptions(bpContext *ctx, const char *opts);
-static bRC baculaAddRegexToInclude(bpContext *ctx, const char *item, int type);
-static bRC baculaAddWildToInclude(bpContext *ctx, const char *item, int type);
+static bRC baculaAddOptions(bpContext *ctx, const char *opts);
+static bRC baculaAddRegex(bpContext *ctx, const char *item, int type);
+static bRC baculaAddWild(bpContext *ctx, const char *item, int type);
+static bRC baculaNewOptions(bpContext *ctx);
+static bRC baculaNewInclude(bpContext *ctx);
static bool is_plugin_compatible(Plugin *plugin);
/*
baculaFree,
baculaAddExclude,
baculaAddInclude,
- baculaAddIncludeOptions,
- baculaAddRegexToInclude,
- baculaAddWildToInclude
+ baculaAddOptions,
+ baculaAddRegex,
+ baculaAddWild,
+ baculaNewOptions,
+ baculaNewInclude
};
/*
return bRC_OK;
}
-static bRC baculaAddIncludeOptions(bpContext *ctx, const char *opts)
+static bRC baculaAddOptions(bpContext *ctx, const char *opts)
{
JCR *jcr;
bacula_ctx *bctx;
return bRC_OK;
}
-static bRC baculaAddRegexToInclude(bpContext *ctx, const char *item, int type)
+static bRC baculaAddRegex(bpContext *ctx, const char *item, int type)
{
JCR *jcr;
bacula_ctx *bctx;
return bRC_OK;
}
-static bRC baculaAddWildToInclude(bpContext *ctx, const char *item, int type)
+static bRC baculaAddWild(bpContext *ctx, const char *item, int type)
{
JCR *jcr;
bacula_ctx *bctx;
return bRC_OK;
}
+static bRC baculaNewOptions(bpContext *ctx)
+{
+ JCR *jcr;
+ bacula_ctx *bctx;
+ if (!is_ctx_good(ctx, jcr, bctx)) {
+ return bRC_Error;
+ }
+ (void)new_options(jcr, NULL);
+ return bRC_OK;
+}
-
+static bRC baculaNewInclude(bpContext *ctx)
+{
+ JCR *jcr;
+ bacula_ctx *bctx;
+ if (!is_ctx_good(ctx, jcr, bctx)) {
+ return bRC_Error;
+ }
+ (void)new_include(jcr);
+ return bRC_OK;
+}
#ifdef TEST_PROGRAM
void (*baculaFree)(bpContext *ctx, const char *file, int line, void *mem);
bRC (*AddExclude)(bpContext *ctx, const char *file);
bRC (*AddInclude)(bpContext *ctx, const char *file);
- bRC (*AddIncludeOptions)(bpContext *ctx, const char *opts);
- bRC (*AddRegexToInclude)(bpContext *ctx, const char *item, int type);
- bRC (*AddWildToInclude)(bpContext *ctx, const char *item, int type);
+ bRC (*AddOptions)(bpContext *ctx, const char *opts);
+ bRC (*AddRegex)(bpContext *ctx, const char *item, int type);
+ bRC (*AddWild)(bpContext *ctx, const char *item, int type);
+ bRC (*NewOptions)(bpContext *ctx);
+ bRC (*NewInclude)(bpContext *ctx);
} bFuncs;
*/
void new_options(JCR *jcr, findINCEXE *incexe)
{
+ if (!incexe) {
+ incexe = jcr->ff->fileset->incexe;
+ }
findFOPTS *fo = (findFOPTS *)malloc(sizeof(findFOPTS));
memset(fo, 0, sizeof(findFOPTS));
fo->regex.init(1, true);
fo->fstype.init(1, true);
fo->drivetype.init(1, true);
incexe->current_opts = fo;
- incexe->opts_list.append(fo);
+ incexe->opts_list.prepend(fo);
jcr->ff->fileset->state = state_options;
}
break;
case 'R': /* Resource forks and Finder Info */
fo->flags |= FO_HFSPLUS;
+ break;
case 'r': /* read fifo */
fo->flags |= FO_READFIFO;
break;
int add_options_to_fileset(JCR *jcr, const char *item);
int add_wild_to_fileset(JCR *jcr, const char *item, int type);
int add_regex_to_fileset(JCR *jcr, const char *item, int type);
+findINCEXE *new_include(JCR *jcr);
break;
/* End of Dir FileSet commands, now we can add excludes */
case bEventEndFileSet:
- bfuncs->AddWildToInclude(ctx, "*.c", ' ');
- bfuncs->AddWildToInclude(ctx, "*.cpp", ' ');
- bfuncs->AddIncludeOptions(ctx, "ei"); /* exclude, ignore case */
+ bfuncs->NewOptions(ctx);
+ bfuncs->AddWild(ctx, "*.c", ' ');
+ bfuncs->AddWild(ctx, "*.cpp", ' ');
+ bfuncs->AddOptions(ctx, "ei"); /* exclude, ignore case */
+ bfuncs->AddExclude(ctx, "/home/kern/bacula/regress/README");
break;
case bEventStartBackupJob:
- bfuncs->AddExclude(ctx, "/home/kern/bacula/regress/README");
break;
case bEventRestoreObject:
printf("Plugin RestoreObject\n");