15 size_t Len = (size_t)
str_length(pItemName) + 1;
16 if(Len >
sizeof(aConfig))
18 dbg_msg(
"config_common",
"can't process overlong filename '%s'", pItemName);
24 dbg_msg(
"config_common",
"can't process non-map file '%s'", pItemName);
28 str_copy(aConfig, pItemName,
sizeof(aConfig));
29 aConfig[Len -
sizeof(
".map")] = 0;
31 dbg_msg(
"config_common",
"processing '%s'", pItemName);
32 Process(pStorage, pItemName, aConfig);
35static int ListdirCallback(
const char *pItemName,
int IsDir,
int StorageType,
void *pUser)
48int main(
int argc,
const char **argv)
59 dbg_msg(
"usage",
"%s FILE1 [ FILE2... ]", argv[0]);
60 dbg_msg(
"usage",
"%s DIRECTORY", argv[0]);
69 for(
int i = 1; i < argc; i++)
Definition: system.h:2845
virtual void ListDirectory(int Type, const char *pPath, FS_LISTDIR_CALLBACK pfnCallback, void *pUser)=0
@ TYPE_ALL
Definition: storage.h:26
int main(int argc, const char **argv)
Definition: config_common.h:48
void ProcessItem(const char *pItemName, IStorage *pStorage)
Definition: config_common.h:11
static int ListdirCallback(const char *pItemName, int IsDir, int StorageType, void *pUser)
Definition: config_common.h:35
void Process(IStorage *pStorage, const char *pMapName, const char *pConfigName)
Definition: config_retrieve.cpp:6
void dbg_msg(const char *sys, const char *fmt,...)
Definition: system.cpp:164
int fs_is_dir(const char *path)
Definition: system.cpp:2363
void log_set_global_logger_default()
Definition: log.cpp:43
int str_length(const char *str)
Definition: system.cpp:2754
void str_append(char *dst, const char *src, int dst_size)
Definition: system.cpp:2703
int str_copy(char *dst, const char *src, int dst_size)
Definition: system.cpp:2720
IStorage * CreateLocalStorage()
Definition: storage.cpp:912
Definition: config_common.h:6
const char * m_pPath
Definition: config_common.h:7
IStorage * m_pStorage
Definition: config_common.h:8
#define str_format
Definition: system.cpp:2789
const char * str_endswith(const char *str, const char *suffix)
Definition: system.cpp:3021