3 // Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; version 2 of the License.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 * \brief Declarations which are used by util-vserver internally.
22 #ifndef H_UTIL_VSERVER_LIB_INTERNAL_H
23 #define H_UTIL_VSERVER_LIB_INTERNAL_H
36 #ifdef HAVE_VERSIONING
37 /* FIXME: HAVE_ASM_DOT_GLOBAL_NAME */
38 # define _symbol_version(real, name, version) \
39 __asm__ (".symver " #real "," #name "@" #version)
40 # define _default_symbol_version(real, name, version) \
41 __asm__ (".symver " #real "," #name "@@" #version)
43 # define _symbol_version(real, name, version)
44 # define _default_symbol_version(real, name, version) \
45 extern __typeof (real) name __attribute__ ((alias (#name)));
47 #define symbol_version(real, name, version) \
48 _symbol_version(real, name, version)
49 #define default_symbol_version(real, name, version) \
50 _default_symbol_version(real, name, version)
53 char * vc_getVserverByCtx_Internal(xid_t ctx, /*@null@*/vcCfgStyle *style,
54 /*@null@*/char const *revdir,
55 bool validate_result);
58 int utilvserver_checkCompatVersion();
59 uint_least32_t utilvserver_checkCompatConfig();
60 bool utilvserver_isDirectory(char const *path, bool follow_link);
61 bool utilvserver_isFile(char const *path, bool follow_link);
62 bool utilvserver_isLink(char const *path);
64 int utilvserver_listparser_uint32(char const *str, size_t len,
65 char const **err_ptr, size_t *err_len,
68 uint_least32_t (*func)(char const*,
72 int utilvserver_listparser_uint64(char const *str, size_t len,
73 char const **err_ptr, size_t *err_len,
76 uint_least64_t (*func)(char const*,
80 struct Mapping_uint32 {
81 char const * const id;
86 struct Mapping_uint64 {
87 char const * const id;
92 ssize_t utilvserver_value2text_uint32(char const *str, size_t len,
93 struct Mapping_uint32 const *map,
94 size_t map_len) NONNULL((1,3));
96 ssize_t utilvserver_value2text_uint64(char const *str, size_t len,
97 struct Mapping_uint64 const *map,
98 size_t map_len) NONNULL((1,3));
100 ssize_t utilvserver_text2value_uint32(uint_least32_t *val,
101 struct Mapping_uint32 const *map,
102 size_t map_len) NONNULL((1,2));
104 ssize_t utilvserver_text2value_uint64(uint_least64_t *val,
105 struct Mapping_uint64 const *map,
106 size_t map_len) NONNULL((1,2));
112 #endif // H_UTIL_VSERVER_LIB_INTERNAL_H