2 * Copyright (c) 2007, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
13 #ifndef LIBSOLV_TOOLS_UTIL_H
14 #define LIBSOLV_TOOLS_UTIL_H
16 static char *_join_tmp;
17 static int _join_tmpl;
20 makeevr(Pool *pool, const char *s)
22 if (!strncmp(s, "0:", 2) && s[2])
24 return pool_str2id(pool, s, 1);
32 split(char *l, char **sp, int m)
42 while (*l && *l != ' ')
52 /* this join does not depend on parsedata */
54 join2(const char *s1, const char *s2, const char *s3)
69 _join_tmp = malloc(_join_tmpl);
71 _join_tmp = realloc(_join_tmp, _join_tmpl);
102 /* util function to set a translated string */
103 static inline void repodata_set_tstr(Repodata *data, Id handle, const char *attrname, const char *lang, const char *str)
106 attrid = pool_str2id(data->repo->pool, join2(attrname, ":", lang), 1);
107 repodata_set_str(data, handle, attrid, str);
110 #endif /* LIBSOLV_TOOLS_UTIL_H */