Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/utils.c @ 524:05c0e55c4bb1
Pass message body to external command
Introduce 2 new options: event_log_files & event_log_dir
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 20 Nov 2005 00:08:49 +0100 |
parents | 339e85418b49 |
children | c71699efa5cc |
comparison
equal
deleted
inserted
replaced
523:fc6bc26f891e | 524:05c0e55c4bb1 |
---|---|
143 } | 143 } |
144 | 144 |
145 return 0; | 145 return 0; |
146 } | 146 } |
147 | 147 |
148 const char *ut_get_tmpdir(void) | |
149 { | |
150 static const char *tmpdir; | |
151 const char *tmpvars[] = { "MCABBERTMPDIR", "TMP", "TMPDIR", "TEMP" }; | |
152 int i; | |
153 | |
154 if (tmpdir) | |
155 return tmpdir; | |
156 | |
157 for (i = 0; i < (sizeof(tmpvars) / sizeof(const char *)); i++) { | |
158 tmpdir = getenv(tmpvars[i]); | |
159 if (tmpdir && tmpdir[0] && tmpdir[0] == '/' && tmpdir[1]) { | |
160 // Looks ok. | |
161 return tmpdir; | |
162 } | |
163 } | |
164 | |
165 // Default temporary directory | |
166 tmpdir = "/tmp"; | |
167 return tmpdir; | |
168 } | |
169 | |
148 // to_iso8601(dststr, timestamp) | 170 // to_iso8601(dststr, timestamp) |
149 // Convert timestamp to iso8601 format, and store it in dststr. | 171 // Convert timestamp to iso8601 format, and store it in dststr. |
150 // NOTE: dststr should be at last 19 chars long. | 172 // NOTE: dststr should be at last 19 chars long. |
151 // Return should be 0 | 173 // Return should be 0 |
152 int to_iso8601(char *dststr, time_t timestamp) | 174 int to_iso8601(char *dststr, time_t timestamp) |