Doxygen annotations for config files.
[tools/librpm-tizen.git] / lib / misc.h
1 #ifndef H_MISC
2 #define H_MISC
3
4 /**
5  * \file lib/misc.h
6  *
7  */
8
9 #include <unistd.h>
10 #include <sys/types.h>
11
12 #include "header.h"
13 #include "ugid.h"
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 /**
20  */
21 /*@only@*/ char ** splitString(const char * str, int length, char sep);
22
23 /**
24  */
25 void    freeSplitString( /*@only@*/ char ** list);
26
27 /**
28  * Remove occurences of trailing character from string.
29  * @param s             string
30  * @param c             character to strip
31  * @return              string
32  */
33 /*@unused@*/ static inline char * stripTrailingChar(char * s, char c)
34         /*@modifies *s */
35 {
36     char * t;
37     for (t = s + strlen(s) - 1; *t == c && t >= s; t--)
38         *t = '\0';
39     return s;
40 }
41
42 /**
43  */
44 int     rpmfileexists(const char * filespec)    /*@*/;
45
46 /**
47  */
48 int     rpmvercmp(const char * one, const char * two);
49
50 /* these are like the normal functions, but they malloc() the space which
51    is needed */
52
53 /**
54  */
55 int     dosetenv(const char *name, const char *value, int overwrite);
56
57 /**
58  */
59 int     doputenv(const char * str);
60
61 /**
62  */
63 int     makeTempFile(const char * prefix, /*@out@*/ const char ** fnptr,
64                         /*@out@*/ FD_t * fdptr);
65
66 /**
67  * @return              cureent working directory (malloc'ed)
68  */
69 /*@only@*/ char * currentDirectory(void);
70
71 /**
72  */
73 void    compressFilelist(Header h);
74
75 /**
76  */
77 void    expandFilelist(Header h);
78
79 /**
80  */
81 void    buildOrigFileList(Header h, /*@out@*/ const char *** fileListPtr, 
82                         /*@out@*/ int * fileCountPtr);
83
84 /**
85  */
86 int myGlobPatternP (const char *patternURL)     /*@*/;
87
88 /**
89  */
90 int rpmGlob(const char * patterns, /*@out@*/ int * argcPtr,
91         /*@out@*/ const char *** argvPtr)
92                 /*@modifies *argcPtr, *argvPtr @*/;
93
94 /**
95  */
96 void providePackageNVR(Header h);
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif  /* H_MISC */