Skip to content

Commit

Permalink
zwischenstand, lmdb baut noch nicht
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Jan 2, 2018
1 parent a5ce59c commit c17ca65
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 66 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -391,8 +391,8 @@ endif()



set(lmdb "${ndmp}" )
set(ndmp "${lmdb}" )
set(ndmp "${ndmp}" )
set(lmdb "${lmdb}" )
set(build_client_only "${client-only}" )
set(build_dird "${build-dird}" )
set(build_stored "${build-stored}" )
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -21,13 +21,17 @@ IF(NOT client-only)
add_subdirectory(tools)
add_subdirectory(tests)
add_subdirectory(cats)
IF(NOT ${HAVE_WIN32})
add_subdirectory(ndmp)
ENDIF()
add_subdirectory(dird)
add_subdirectory(stored)
ENDIF()

add_subdirectory(console)
IF(${HAVE_LMDB})
add_subdirectory(lmdb)
ENDIF()
add_subdirectory(lib)
add_subdirectory(findlib)
add_subdirectory(filed)
Expand Down
15 changes: 12 additions & 3 deletions src/dird/CMakeLists.txt
Expand Up @@ -43,15 +43,24 @@ set(TSTFNDSRCS testfind.cc dird_conf.cc ua_acl.cc ua_audit.cc run_conf.cc inc_co
set(DIRD_RESTYPES catalog client console counter director fileset job jobdefs messages pool profile schedule storage)

add_executable(bareos-dir ${SVRSRCS})
target_link_libraries(bareos-dir bareos
set(BAREOS_DIR_LIBRARIES
bareos
bareoscats
bareoscfg bareossql
bareosfind bareosndmp ${LMDB_LIBS})
bareosfind
${LMDB_LIBS}
)
IF(HAVE_LMDB)
LIST(APPEND BAREOS_DIR_LIBRARIES
bareosndmp
)
ENDIF()
target_link_libraries(bareos-dir ${BAREOS_DIR_LIBRARIES})


add_executable(bareos-dbcheck ${DBCHKSRCS})
target_link_libraries(bareos-dbcheck
bareossql bareos bareosfind bareoscfg
bareossql bareos bareosfind bareoscfg bareosstatic
bareoscats
)

Expand Down
16 changes: 8 additions & 8 deletions src/findlib/protos.h
Expand Up @@ -40,13 +40,13 @@ int select_data_stream(FF_PKT *ff_pkt, bool compatible);
int create_file(JCR *jcr, ATTR *attr, BFILE *ofd, int replace);

/* find.c */
FF_PKT *init_find_files();
DLL_IMP_EXP FF_PKT *init_find_files();
void set_find_options(FF_PKT *ff, bool incremental, time_t mtime);
void set_find_changed_function(FF_PKT *ff, bool check_fct(JCR *jcr, FF_PKT *ff));
int find_files(JCR *jcr, FF_PKT *ff, int file_sub(JCR *, FF_PKT *ff_pkt, bool),
int plugin_sub(JCR *, FF_PKT *ff_pkt, bool));
bool match_files(JCR *jcr, FF_PKT *ff, int sub(JCR *, FF_PKT *ff_pkt, bool));
int term_find_files(FF_PKT *ff);
DLL_IMP_EXP bool match_files(JCR *jcr, FF_PKT *ff, int sub(JCR *, FF_PKT *ff_pkt, bool));
DLL_IMP_EXP int term_find_files(FF_PKT *ff);
bool is_in_fileset(FF_PKT *ff);
bool accept_file(FF_PKT *ff);
findINCEXE *allocate_new_incexe(void);
Expand All @@ -58,15 +58,15 @@ findFOPTS *start_options(FF_PKT *ff);
void new_options(FF_PKT *ff, findINCEXE *incexe);

/* match.c */
void init_include_exclude_files(FF_PKT *ff);
void term_include_exclude_files(FF_PKT *ff);
void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname);
void add_fname_to_exclude_list(FF_PKT *ff, const char *fname);
DLL_IMP_EXP void init_include_exclude_files(FF_PKT *ff);
DLL_IMP_EXP void term_include_exclude_files(FF_PKT *ff);
DLL_IMP_EXP void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname);
DLL_IMP_EXP void add_fname_to_exclude_list(FF_PKT *ff, const char *fname);
bool file_is_excluded(FF_PKT *ff, const char *file);
bool file_is_included(FF_PKT *ff, const char *file);
struct s_included_file *get_next_included_file(FF_PKT *ff,
struct s_included_file *inc);
bool parse_size_match(const char *size_match_pattern,
DLL_IMP_EXP bool parse_size_match(const char *size_match_pattern,
struct s_sz_matching *size_matching);

/* find_one.c */
Expand Down
2 changes: 1 addition & 1 deletion src/include/jcr.h
Expand Up @@ -650,7 +650,7 @@ DLL_IMP_EXP extern void set_jcr_job_status(JCR *jcr, int JobStatus);
DLL_IMP_EXP extern int DLL_IMP_EXP num_jobs_run;

#ifdef DEBUG
extern void b_free_jcr(const char *file, int line, JCR *jcr);
DLL_IMP_EXP extern void b_free_jcr(const char *file, int line, JCR *jcr);
#define free_jcr(jcr) b_free_jcr(__FILE__, __LINE__, (jcr))
#else
extern void free_jcr(JCR *jcr);
Expand Down
5 changes: 3 additions & 2 deletions src/lib/CMakeLists.txt
Expand Up @@ -83,6 +83,7 @@ target_link_libraries(bareoscfg bareos ${JANSSON_LIBRARIES})

set (BAREOS_STATIC_SRCS parse_conf.cc res.cc)
add_library(bareosstatic STATIC ${BAREOS_STATIC_SRCS})
target_link_libraries(bareosstatic bareoscfg)


INSTALL(TARGETS bareos DESTINATION ${libdir})
Expand All @@ -91,14 +92,14 @@ INSTALL(TARGETS bareoscfg DESTINATION ${libdir})
set_target_properties(bareoscfg PROPERTIES VERSION "${VERSION}"
SOVERSION "${SOVERSION}"
DEFINE_SYMBOL "BUILDING_DLL"
LINK_FLAGS -Wl,--output-def,bareoscfg.def
)
#LINK_FLAGS -Wl,--output-def,bareoscfg.def

set_target_properties(bareos PROPERTIES VERSION "${VERSION}"
SOVERSION "${SOVERSION}"
DEFINE_SYMBOL "BUILDING_DLL"
LINK_FLAGS -Wl,--output-def,bareos.def
)
#LINK_FLAGS -Wl,--output-def,bareos.def

INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${includedir})

Expand Down
8 changes: 4 additions & 4 deletions src/lib/address_conf.h
Expand Up @@ -27,7 +27,7 @@
* address configuration
*/

class IPADDR : public SMARTALLOC {
class DLL_IMP_EXP IPADDR : public SMARTALLOC {
public:
typedef enum { R_SINGLE, R_SINGLE_PORT, R_SINGLE_ADDR, R_MULTIPLE,
R_DEFAULT, R_EMPTY
Expand Down Expand Up @@ -75,14 +75,14 @@ class IPADDR : public SMARTALLOC {
dlink link;
};

void init_default_addresses(dlist ** addr, const char *port);
void free_addresses(dlist * addrs);
DLL_IMP_EXP void init_default_addresses(dlist ** addr, const char *port);
DLL_IMP_EXP void free_addresses(dlist * addrs);

const char *get_first_address(dlist * addrs, char *outputbuf, int outlen);
int get_first_port_net_order(dlist * addrs);
int get_first_port_host_order(dlist * addrs);

int add_address(dlist **out, IPADDR::i_type type, unsigned short defaultport, int family,
DLL_IMP_EXP int add_address(dlist **out, IPADDR::i_type type, unsigned short defaultport, int family,
const char *hostname_str, const char *port_str, char *buf, int buflen);
const char *build_addresses_str(dlist *addrs, char *buf, int blen, bool print_port=true);

Expand Down
16 changes: 8 additions & 8 deletions src/lib/breg.h
Expand Up @@ -79,36 +79,36 @@ class BREGEXP {
BREGEXP *new_bregexp(const char *motif);

/* launch each bregexp on filename */
int run_bregexp(alist *bregexps, const char *fname);
DLL_IMP_EXP int run_bregexp(alist *bregexps, const char *fname);

/* free BREGEXP (and all POOLMEM) */
void free_bregexp(BREGEXP *script);
DLL_IMP_EXP void free_bregexp(BREGEXP *script);

/* fill an alist with BREGEXP from where */
alist *get_bregexps(const char *where);
DLL_IMP_EXP alist *get_bregexps(const char *where);

/* apply every regexps from the alist */
bool apply_bregexps(const char *fname, alist *bregexps, char **result);
DLL_IMP_EXP bool apply_bregexps(const char *fname, alist *bregexps, char **result);

/* foreach_alist free RUNSCRIPT */
void free_bregexps(alist *bregexps); /* you have to free alist */
DLL_IMP_EXP void free_bregexps(alist *bregexps); /* you have to free alist */

/* get regexp size */
int bregexp_get_build_where_size(char *strip_prefix,
DLL_IMP_EXP int bregexp_get_build_where_size(char *strip_prefix,
char *add_prefix,
char *add_suffix);

/* get a bregexp string from user arguments
* you must allocate it with bregexp_get_build_where_size();
*/
char *bregexp_build_where(char *dest, int str_size,
DLL_IMP_EXP char *bregexp_build_where(char *dest, int str_size,
char *strip_prefix,
char *add_prefix,
char *add_suffix);

/* escape a string to regexp format (sep and \)
* dest must be long enough (dest = 2*src + 1)
*/
char *bregexp_escape_string(char *dest, const char *src, const char sep);
DLL_IMP_EXP char *bregexp_escape_string(char *dest, const char *src, const char sep);

#endif /* __BREG_H_ */
4 changes: 2 additions & 2 deletions src/lib/lex.h
Expand Up @@ -169,7 +169,7 @@ lc->scan_warning(__FILE__, __LINE__, lc, msg, a1, a2, a3, a4, a5)
#define scan_warn6(lc, msg, a1, a2, a3, a4, a5, a6) \
lc->scan_warning(__FILE__, __LINE__, lc, msg, a1, a2, a3, a4, a5, a6)

void scan_to_eol(LEX *lc);
int scan_to_next_not_eol(LEX * lc);
DLL_IMP_EXP void scan_to_eol(LEX *lc);
DLL_IMP_EXP int scan_to_next_not_eol(LEX * lc);

#endif /* _LEX_H */
6 changes: 3 additions & 3 deletions src/lib/md5.h
Expand Up @@ -42,8 +42,8 @@ typedef struct {
MD5_u32plus block[16];
} MD5_CTX;

extern void MD5_Init(MD5_CTX *ctx);
extern void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);
extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
DLL_IMP_EXP extern void MD5_Init(MD5_CTX *ctx);
DLL_IMP_EXP extern void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);
DLL_IMP_EXP extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);

#endif
8 changes: 4 additions & 4 deletions src/lib/mem_pool.h
Expand Up @@ -68,11 +68,11 @@ void free_pool_memory(POOLMEM *buf);
*/
#define free_and_null_pool_memory(a) do { if (a) { free_pool_memory(a); (a) = NULL;} } while (0)

void garbage_collect_memory_pool();
void close_memory_pool();
void print_memory_pool_stats();
DLL_IMP_EXP void garbage_collect_memory_pool();
DLL_IMP_EXP void close_memory_pool();
DLL_IMP_EXP void print_memory_pool_stats();

void garbage_collect_memory();
DLL_IMP_EXP void garbage_collect_memory();

enum {
PM_NOPOOL = 0, /* Nonpooled memory */
Expand Down
38 changes: 19 additions & 19 deletions src/lib/parse_conf.h
Expand Up @@ -382,7 +382,7 @@ typedef void (PRINT_RES_HANDLER)(RES_ITEM *items, int i, POOL_MEM &cfg_str, bool
/*
* New C++ configuration routines
*/
class CONFIG {
class DLL_IMP_EXP CONFIG {
public:
/*
* Members
Expand Down Expand Up @@ -466,39 +466,39 @@ class CONFIG {

CONFIG *new_config_parser();

void prtmsg(void *sock, const char *fmt, ...);
DLL_IMP_EXP void prtmsg(void *sock, const char *fmt, ...);

/*
* Data type routines
*/
DATATYPE_NAME *get_datatype(int number);
const char *datatype_to_str(int type);
const char *datatype_to_description(int type);
DLL_IMP_EXP DATATYPE_NAME *get_datatype(int number);
DLL_IMP_EXP const char *datatype_to_str(int type);
DLL_IMP_EXP const char *datatype_to_description(int type);

/*
* Resource routines
*/
RES *GetResWithName(int rcode, const char *name, bool lock = true);
RES *GetNextRes(int rcode, RES *res);
void b_LockRes(const char *file, int line);
void b_UnlockRes(const char *file, int line);
void dump_resource(int type, RES *res, void sendmsg(void *sock, const char *fmt, ...),
DLL_IMP_EXP RES *GetResWithName(int rcode, const char *name, bool lock = true);
DLL_IMP_EXP RES *GetNextRes(int rcode, RES *res);
DLL_IMP_EXP void b_LockRes(const char *file, int line);
DLL_IMP_EXP void b_UnlockRes(const char *file, int line);
DLL_IMP_EXP void dump_resource(int type, RES *res, void sendmsg(void *sock, const char *fmt, ...),
void *sock, bool hide_sensitive_data = false, bool verbose = false);
void indent_config_item(POOL_MEM &cfg_str, int level, const char *config_item, bool inherited = false);
void free_resource(RES *res, int type);
void init_resource(int type, RES_ITEM *item);
bool save_resource(int type, RES_ITEM *item, int pass);
bool store_resource(int type, LEX *lc, RES_ITEM *item, int index, int pass);
const char *res_to_str(int rcode);
DLL_IMP_EXP void indent_config_item(POOL_MEM &cfg_str, int level, const char *config_item, bool inherited = false);
DLL_IMP_EXP void free_resource(RES *res, int type);
DLL_IMP_EXP void init_resource(int type, RES_ITEM *item);
DLL_IMP_EXP bool save_resource(int type, RES_ITEM *item, int pass);
DLL_IMP_EXP bool store_resource(int type, LEX *lc, RES_ITEM *item, int index, int pass);
DLL_IMP_EXP const char *res_to_str(int rcode);


#ifdef HAVE_JANSSON
/*
* JSON output helper functions
*/
json_t *json_item(s_kw *item);
json_t *json_item(RES_ITEM *item);
json_t *json_items(RES_ITEM items[]);
DLL_IMP_EXP json_t *json_item(s_kw *item);
DLL_IMP_EXP json_t *json_item(RES_ITEM *item);
DLL_IMP_EXP json_t *json_items(RES_ITEM items[]);
#endif

/*
Expand Down
10 changes: 5 additions & 5 deletions src/lib/runscript.h
Expand Up @@ -65,7 +65,7 @@ enum {
/**
* Structure for RunScript ressource
*/
class RUNSCRIPT {
class DLL_IMP_EXP RUNSCRIPT {
public:
POOLMEM *command; /* Command string */
POOLMEM *target; /* Host target */
Expand All @@ -92,20 +92,20 @@ class RUNSCRIPT {
};

/* create new RUNSCRIPT (set all value to 0) */
RUNSCRIPT *new_runscript();
DLL_IMP_EXP RUNSCRIPT *new_runscript();

/* create new RUNSCRIPT from another */
RUNSCRIPT *copy_runscript(RUNSCRIPT *src);
DLL_IMP_EXP RUNSCRIPT *copy_runscript(RUNSCRIPT *src);

/* launch each script from runscripts*/
int run_scripts(JCR *jcr, alist *runscripts, const char *name,
alist *allowed_script_dirs = NULL);

/* free RUNSCRIPT (and all POOLMEM) */
void free_runscript(RUNSCRIPT *script);
DLL_IMP_EXP void free_runscript(RUNSCRIPT *script);

/* foreach_alist free RUNSCRIPT */
void free_runscripts(alist *runscripts); /* you have to free alist */
DLL_IMP_EXP void free_runscripts(alist *runscripts); /* you have to free alist */

extern DLL_IMP_EXP bool (*console_command)(JCR *jcr, const char *cmd);

Expand Down
4 changes: 4 additions & 0 deletions src/lmdb/CMakeLists.txt
Expand Up @@ -18,10 +18,14 @@
# 02110-1301, USA.

include_directories(../include ..)

add_library(bareoslmdb SHARED mdb.c midl.c)

add_definitions(-Wall -m64 -mwin32 -mthreads)

set_target_properties(bareoslmdb PROPERTIES VERSION "${VERSION}"
SOVERSION "${SOVERSION}"
DEFINE_SYMBOL "BUILDING_DLL"
)


Expand Down
11 changes: 8 additions & 3 deletions src/tests/CMakeLists.txt
Expand Up @@ -27,8 +27,10 @@ target_link_libraries(bregtest bareos ${JANSSON_LIBRARIES})
add_executable(testls testls.cc)
target_link_libraries(testls bareosfind bareos ${JANSSON_LIBRARIES})

add_executable(bbatch bbatch.cc)
target_link_libraries(bbatch bareoscats bareos ${JANSSON_LIBRARIES})
IF(NOT ${HAVE_WIN32})
add_executable(bbatch bbatch.cc)
target_link_libraries(bbatch bareoscats bareos ${JANSSON_LIBRARIES})
ENDIF()

#add_executable(bvfs_test bvfs_test.cc)
#target_link_libraries(bvfs_test bareoscats bareossql)
Expand All @@ -43,7 +45,10 @@ add_executable(grow grow.cc)
target_link_libraries(grow bareos ${JANSSON_LIBRARIES})

set (TESTS_SBIN
bbatch bregtest grow testls
bregtest grow testls
)
IF(NOT ${HAVE_WIN32})
LIST(APPEND TESTS_SBIN bbatch)
ENDIF()

INSTALL(TARGETS ${TESTS_SBIN} DESTINATION "${sbindir}")
4 changes: 2 additions & 2 deletions src/win32/compat/glob.cc
Expand Up @@ -1037,7 +1037,7 @@ static glob_t *glob_registry( int request, glob_t *gl_data )
return gl_data;
}

int
DLL_IMP_EXP int
__mingw_glob( const char *pattern, int flags, int (*errfn)(const char *, int), glob_t *gl_data )
{
/* Module entry point for the glob() function.
Expand Down Expand Up @@ -1065,7 +1065,7 @@ __mingw_glob( const char *pattern, int flags, int (*errfn)(const char *, int), g
return status;
}

void
DLL_IMP_EXP void
__mingw_globfree( glob_t *gl_data )
{
/* Module entry point for globfree() function; the activity is
Expand Down

0 comments on commit c17ca65

Please sign in to comment.