- Timestamp:
- Jun 22, 2011, 3:40:50 PM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- b343c2c
- Parents:
- 84a071f
- git-author:
- Jason Gross <jgross@mit.edu> (06/06/11 05:24:30)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (06/22/11 15:40:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
util.c
r83a4af3 rd427f08 35 35 * duplicate slashes are removed. Caller must free the return. 36 36 */ 37 char *owl_util_makepath(const char *in)37 G_GNUC_WARN_UNUSED_RESULT 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 char **owl_parseline(const char *line, int *argc)104 G_GNUC_WARN_UNUSED_RESULT char **owl_parseline(const char *line, int *argc) 105 105 { 106 106 GPtrArray *argv; … … 245 245 } 246 246 247 char *owl_string_build_quoted(const char *tmpl, ...)247 G_GNUC_WARN_UNUSED_RESULT 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 char *owl_arg_quote(const char *arg)259 G_GNUC_WARN_UNUSED_RESULT 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 char *owl_util_minutes_to_timestr(int in)267 G_GNUC_WARN_UNUSED_RESULT 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 char *owl_util_get_default_tty(void)333 G_GNUC_WARN_UNUSED_RESULT char *owl_util_get_default_tty(void) 334 334 { 335 335 const char *tmp; … … 353 353 * return. 354 354 */ 355 char *owl_util_stripnewlines(const char *in)355 G_GNUC_WARN_UNUSED_RESULT 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 gchar *owl_util_recursive_resolve_link(const char *filename)386 G_GNUC_WARN_UNUSED_RESULT 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 char * owl_util_baseclass(const char *class)513 G_GNUC_WARN_UNUSED_RESULT char *owl_util_baseclass(const char *class) 514 514 { 515 515 char *start, *end; … … 546 546 547 547 /* Strips format characters from a valid utf-8 string. Returns the 548 empty string if 'in' does not validate. */549 char *owl_strip_format_chars(const char *in)548 empty string if 'in' does not validate. Caller must free the return. */ 549 G_GNUC_WARN_UNUSED_RESULT char *owl_strip_format_chars(const char *in) 550 550 { 551 551 char *r; … … 584 584 * out characters in Unicode Plane 16, as we use that plane internally 585 585 * for formatting. 586 */ 587 char * owl_validate_or_convert(const char *in) 586 * Caller must free the return. 587 */ 588 G_GNUC_WARN_UNUSED_RESULT char *owl_validate_or_convert(const char *in) 588 589 { 589 590 if (g_utf8_validate(in, -1, NULL)) { … … 599 600 * Validate 'in' as UTF-8, and either return a copy of it, or an empty 600 601 * string if it is invalid utf-8. 601 */ 602 char * owl_validate_utf8(const char *in) 602 * Caller must free the return. 603 */ 604 G_GNUC_WARN_UNUSED_RESULT char *owl_validate_utf8(const char *in) 603 605 { 604 606 char *out; … … 632 634 } 633 635 634 char *owl_escape_highbit(const char *str) 636 /* caller must free the return */ 637 G_GNUC_WARN_UNUSED_RESULT char *owl_escape_highbit(const char *str) 635 638 { 636 639 GString *out = g_string_new(""); … … 695 698 696 699 /* Read the rest of the input available in fp into a string. */ 697 char *owl_slurp(FILE *fp)700 G_GNUC_WARN_UNUSED_RESULT char *owl_slurp(FILE *fp) 698 701 { 699 702 char *buf = NULL;
Note: See TracChangeset
for help on using the changeset viewer.