/* skip the state dir unless a HIDDEN is performed */ if (!(params->walk_type & DAV_WALKTYPE_HIDDEN) && !strcmp(dirent.name, DAV_FS_STATE_DIR)) { continue; }
を
/* skip the state dir unless a HIDDEN is performed */ if (!(params->walk_type & DAV_WALKTYPE_HIDDEN) && is_hidden_file(dirent.name)) { continue; }
のように変えて、
static int is_hidden_file(const char *name) { ... }
という、引数 name を調べて隠したければ真、表示したければ 偽を返すような関数を作る必要があります。