- Timestamp:
- Jun 25, 2011, 3:26:15 AM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 12294d2
- Parents:
- 95b52d1
- git-author:
- David Benjamin <davidben@mit.edu> (06/24/11 22:56:15)
- git-committer:
- David Benjamin <davidben@mit.edu> (06/25/11 03:26:15)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
util.c
rd427f08 r6829afc 35 35 * duplicate slashes are removed. Caller must free the return. 36 36 */ 37 G_GNUC_WARN_UNUSED_RESULTchar *owl_util_makepath(const char *in)37 CALLER_OWN char *owl_util_makepath(const char *in) 38 38 { 39 39 int i, j, x; … … 102 102 to -1, argv will be NULL and the caller does not need to free anything. The 103 103 returned vector is NULL-terminated. */ 104 G_GNUC_WARN_UNUSED_RESULTchar **owl_parseline(const char *line, int *argc)104 CALLER_OWN char **owl_parseline(const char *line, int *argc) 105 105 { 106 106 GPtrArray *argv; … … 245 245 } 246 246 247 G_GNUC_WARN_UNUSED_RESULTchar *owl_string_build_quoted(const char *tmpl, ...)247 CALLER_OWN char *owl_string_build_quoted(const char *tmpl, ...) 248 248 { 249 249 GString *buf = g_string_new(""); … … 257 257 /* Returns a quoted version of arg suitable for placing in a 258 258 * command-line. Result should be freed with g_free. */ 259 G_GNUC_WARN_UNUSED_RESULTchar *owl_arg_quote(const char *arg)259 CALLER_OWN char *owl_arg_quote(const char *arg) 260 260 { 261 261 GString *buf = g_string_new("");; … … 265 265 266 266 /* caller must free the return */ 267 G_GNUC_WARN_UNUSED_RESULTchar *owl_util_minutes_to_timestr(int in)267 CALLER_OWN char *owl_util_minutes_to_timestr(int in) 268 268 { 269 269 int days, hours; … … 331 331 332 332 /* Get the default tty name. Caller must free the return */ 333 G_GNUC_WARN_UNUSED_RESULTchar *owl_util_get_default_tty(void)333 CALLER_OWN char *owl_util_get_default_tty(void) 334 334 { 335 335 const char *tmp; … … 353 353 * return. 354 354 */ 355 G_GNUC_WARN_UNUSED_RESULTchar *owl_util_stripnewlines(const char *in)355 CALLER_OWN char *owl_util_stripnewlines(const char *in) 356 356 { 357 357 … … 384 384 * Error conditions are the same as g_file_read_link. 385 385 */ 386 G_GNUC_WARN_UNUSED_RESULTgchar *owl_util_recursive_resolve_link(const char *filename)386 CALLER_OWN gchar *owl_util_recursive_resolve_link(const char *filename) 387 387 { 388 388 gchar *last_path = g_strdup(filename); … … 511 511 The caller is responsible for freeing the allocated string. 512 512 */ 513 G_GNUC_WARN_UNUSED_RESULTchar *owl_util_baseclass(const char *class)513 CALLER_OWN char *owl_util_baseclass(const char *class) 514 514 { 515 515 char *start, *end; … … 547 547 /* Strips format characters from a valid utf-8 string. Returns the 548 548 empty string if 'in' does not validate. Caller must free the return. */ 549 G_GNUC_WARN_UNUSED_RESULTchar *owl_strip_format_chars(const char *in)549 CALLER_OWN char *owl_strip_format_chars(const char *in) 550 550 { 551 551 char *r; … … 586 586 * Caller must free the return. 587 587 */ 588 G_GNUC_WARN_UNUSED_RESULTchar *owl_validate_or_convert(const char *in)588 CALLER_OWN char *owl_validate_or_convert(const char *in) 589 589 { 590 590 if (g_utf8_validate(in, -1, NULL)) { … … 602 602 * Caller must free the return. 603 603 */ 604 G_GNUC_WARN_UNUSED_RESULTchar *owl_validate_utf8(const char *in)604 CALLER_OWN char *owl_validate_utf8(const char *in) 605 605 { 606 606 char *out; … … 635 635 636 636 /* caller must free the return */ 637 G_GNUC_WARN_UNUSED_RESULTchar *owl_escape_highbit(const char *str)637 CALLER_OWN char *owl_escape_highbit(const char *str) 638 638 { 639 639 GString *out = g_string_new(""); … … 698 698 699 699 /* Read the rest of the input available in fp into a string. */ 700 G_GNUC_WARN_UNUSED_RESULTchar *owl_slurp(FILE *fp)700 CALLER_OWN char *owl_slurp(FILE *fp) 701 701 { 702 702 char *buf = NULL;
Note: See TracChangeset
for help on using the changeset viewer.