free(ff);
return hard_links;
}
+
+/* dump the name_list of every include inside a FileSet */
+void dump_name_list(const char* file, int lineno, int lvl, const char *prefix,
+ findFILESET *fileset)
+{
+ for (int i=0; i<fileset->include_list.size(); i++) {
+ findINCEXE *incexe = (findINCEXE *)fileset->include_list.get(i);
+ dlistString *node;
+ foreach_dlist(node, &incexe->name_list) {
+ Dmsg1(DT_VOLUME|50, "name_list = %s\n", node->c_str());
+ if (chk_dbglvl(lvl)) d_msg(file, lineno, lvl, "%s INC[%d] name = %s\n", prefix, i, node->c_str());
+ }
+ }
+}
const char *fstype, const char *mountpoint,
const char *mntopts, const char *fsname);
bool read_mtab(mtab_handler_t *mtab_handler, void *user_ctx);
+void dump_name_list(const char* file, int lineno, int lvl, const char *prefix,
+ findFILESET *fileset);
#include "protos.h"
}
#endif
+/* simply replace any '\\' into '/' */
+void win32_to_unix_slash(char *name)
+{
+ for(char *p = name; *p ; p++) {
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
+}
+
+/* remove the trailing slashes if any */
+void remove_win32_trailing_slash(char *name)
+{
+ int l = strlen(name);
+ while (l > 0 && (name[l-1] == '/' || name[l-1] == '\\')) {
+ name[--l]='\0';
+ }
+}
+
/*
* Convert a WUTF8 path into a normalized wchar windows path
* Get the result from cache
int wutf8_path_2_wchar(POOLMEM **ppszUCS, const char *pszUTF);
int UTF8_2_wchar(POOLMEM **pszUCS, const char *pszUTF);
int make_win32_path_UTF8_2_wchar(POOLMEM **pszUCS, const char *pszUTF, BOOL* pBIsRawPath = NULL);
+void win32_to_unix_slash(char *name);
+void remove_win32_trailing_slash(char *name);
// init with win9x, but maybe set to NT in InitWinAPI
extern DWORD DLL_IMP_EXP g_platform_id;