3 * Copyright (c) 2007, Novell Inc.
5 * This program is licensed under the BSD license, read LICENSE.BSD
6 * for further information
14 #ifndef SATSOLVER_TOOLS_UTIL_H
15 #define SATSOLVER_TOOLS_UTIL_H
17 static char *_join_tmp;
18 static int _join_tmpl;
20 struct parsedata_common {
28 makeevr(Pool *pool, const char *s)
30 if (!strncmp(s, "0:", 2) && s[2])
32 return str2id(pool, s, 1);
40 split(char *l, char **sp, int m)
50 while (*l && *l != ' ')
60 /* this join does not depend on parsedata */
62 join2(const char *s1, const char *s2, const char *s3)
77 _join_tmp = malloc(_join_tmpl);
79 _join_tmp = realloc(_join_tmp, _join_tmpl);
110 /* util function to set a translated string */
111 static inline void repodata_set_tstr(Repodata *data, Id handle, const char *attrname, const char *lang, const char *str)
114 attrid = str2id(data->repo->pool, join2(attrname, ":", lang), 1);
115 repodata_set_str(data, handle, attrid, str);
118 #endif /* SATSOLVER_TOOLS_UTIL_H */