X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Flib_internal%2Fmatchlist.h;h=49a60ffcb2fc71449f6751f1ef4071204bf47e0f;hb=56ab7e36934d0c50d9258c9098d403f44133ba59;hp=0e31517dfdbc0a092b8385d2116f9383de0cc78d;hpb=e2c0f11e78a2029eb6b4a9b6acaafe7f778d98a2;p=util-vserver.git diff --git a/util-vserver/lib_internal/matchlist.h b/util-vserver/lib_internal/matchlist.h index 0e31517..49a60ff 100644 --- a/util-vserver/lib_internal/matchlist.h +++ b/util-vserver/lib_internal/matchlist.h @@ -21,17 +21,21 @@ #include "pathinfo.h" #include "string.h" +#include "pathinfo.h" + +#include #include #include typedef int (*MatchItemCompareFunc)(char const *, char const *); +typedef enum { stINCLUDE,stEXCLUDE,stSKIP } MatchType; struct MatchItem { - enum { stINCLUDE, stEXCLUDE } type; - char const * name; - MatchItemCompareFunc cmp; + MatchType type; + char const * name; + MatchItemCompareFunc cmp; }; struct MatchList @@ -46,15 +50,25 @@ struct MatchList size_t buf_count; }; +struct MatchVserverInfo +{ + char const *name; + + vcCfgStyle style; + PathInfo vdir; + PathInfo appdir; + + bool use_pkgmgmt; +}; + void MatchList_init(struct MatchList *, char const *root, size_t count) NONNULL((1,2)); bool MatchList_initByVserver(struct MatchList *, - char const *vserver, - char const **res_appdir) NONNULL((1,2)); + struct MatchVserverInfo const *vserver) NONNULL((1,2)); void MatchList_initManually(struct MatchList *list, - char const *vserver, + struct MatchVserverInfo const *vserver, char const *vdir, - char const *exclude_file) NONNULL((1,3,4)); + char const *exclude_file) NONNULL((1,4)); void MatchList_initRefserverList(struct MatchList **, size_t *cnt, char const *dir) NONNULL((1,2,3)); void MatchList_destroy(struct MatchList *) NONNULL((1)); @@ -62,7 +76,7 @@ void MatchList_appendFiles(struct MatchList *, size_t idx, char **files, size_t count, bool auto_type) NONNULL((1,3)); -bool MatchList_compare(struct MatchList const *, +MatchType MatchList_compare(struct MatchList const *, char const *path) NONNULL((1,2)); struct MatchItem const * MatchList_find(struct MatchList const *, @@ -70,4 +84,8 @@ const * MatchList_find(struct MatchList const *, void MatchList_printId(struct MatchList const *, int fd) NONNULL((1)); + +bool MatchVserverInfo_init(struct MatchVserverInfo *); +void MatchVserverInfo_free(struct MatchVserverInfo *); + #endif // H_UTIL_VSERVER_LIB_INTERNAL_MATCHLIST_H