X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Flib%2Finternal.h;h=9286b440c6a4db1cd6d3c816a5abb120f0cb12e6;hb=9cb1d1b9b11842ffadaf45b4651dd3d7d03bb0c6;hp=4598a77e2402314d65fc212ab8fc91fc6a172a99;hpb=6033c23dc5fe04c0987387edaeea5948da9537e2;p=util-vserver.git diff --git a/util-vserver/lib/internal.h b/util-vserver/lib/internal.h index 4598a77..9286b44 100644 --- a/util-vserver/lib/internal.h +++ b/util-vserver/lib/internal.h @@ -15,6 +15,9 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +/** \file internal.h + * \brief Declarations which are used by util-vserver internally. + */ #ifndef H_UTIL_VSERVER_LIB_INTERNAL_H #define H_UTIL_VSERVER_LIB_INTERNAL_H @@ -29,21 +32,52 @@ extern "C" { int utilvserver_checkCompatVersion(); bool utilvserver_isDirectory(char const *path, bool follow_link); +bool utilvserver_isFile(char const *path, bool follow_link); +bool utilvserver_isLink(char const *path); int utilvserver_listparser_uint32(char const *str, size_t len, char const **err_ptr, size_t *err_len, uint_least32_t *flag, uint_least32_t *mask, uint_least32_t (*func)(char const*, - size_t)) NONNULL((0,4,5,6)); + size_t, bool * + )) NONNULL((1,5,7)); int utilvserver_listparser_uint64(char const *str, size_t len, char const **err_ptr, size_t *err_len, uint_least64_t *flag, uint_least64_t *mask, uint_least64_t (*func)(char const*, - size_t)) NONNULL((0,4,5,6)); + size_t, bool * + )) NONNULL((1,5,7)); + +struct Mapping_uint32 { + char const * const id; + size_t len; + uint_least32_t val; +}; + +struct Mapping_uint64 { + char const * const id; + size_t len; + uint_least64_t val; +}; + +ssize_t utilvserver_value2text_uint32(char const *str, size_t len, + struct Mapping_uint32 const *map, + size_t map_len) NONNULL((1,3)); + +ssize_t utilvserver_value2text_uint64(char const *str, size_t len, + struct Mapping_uint64 const *map, + size_t map_len) NONNULL((1,3)); + +ssize_t utilvserver_text2value_uint32(uint_least32_t *val, + struct Mapping_uint32 const *map, + size_t map_len) NONNULL((1,2)); +ssize_t utilvserver_text2value_uint64(uint_least64_t *val, + struct Mapping_uint64 const *map, + size_t map_len) NONNULL((1,2)); #ifdef __cplusplus } #endif