Changeset 6829afc
- 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)
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
aim.c
rd427f08 r6829afc 437 437 438 438 /* caller must free the return */ 439 G_GNUC_WARN_UNUSED_RESULTchar *owl_aim_normalize_screenname(const char *in)439 CALLER_OWN char *owl_aim_normalize_screenname(const char *in) 440 440 { 441 441 char *out; -
cmd.c
rd427f08 r6829afc 56 56 57 57 /* caller must free the return */ 58 G_GNUC_WARN_UNUSED_RESULTchar *_owl_cmddict_execute(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc, const char *buff)58 CALLER_OWN char *_owl_cmddict_execute(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc, const char *buff) 59 59 { 60 60 char *retval = NULL; … … 73 73 74 74 /* caller must free the return */ 75 G_GNUC_WARN_UNUSED_RESULTchar *owl_cmddict_execute(const owl_cmddict *cd, const owl_context *ctx, const char *cmdbuff)75 CALLER_OWN char *owl_cmddict_execute(const owl_cmddict *cd, const owl_context *ctx, const char *cmdbuff) 76 76 { 77 77 char **argv; … … 97 97 98 98 /* caller must free the return */ 99 G_GNUC_WARN_UNUSED_RESULTchar *owl_cmddict_execute_argv(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc)99 CALLER_OWN char *owl_cmddict_execute_argv(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc) 100 100 { 101 101 char *buff; … … 154 154 155 155 /* caller must free the result */ 156 G_GNUC_WARN_UNUSED_RESULTchar *owl_cmd_execute(const owl_cmd *cmd, const owl_cmddict *cd, const owl_context *ctx, int argc, const char *const *argv, const char *cmdbuff)156 CALLER_OWN char *owl_cmd_execute(const owl_cmd *cmd, const owl_cmddict *cd, const owl_context *ctx, int argc, const char *const *argv, const char *cmdbuff) 157 157 { 158 158 static int alias_recurse_depth = 0; … … 228 228 229 229 /* returns a summary line describing this keymap. the caller must free. */ 230 G_GNUC_WARN_UNUSED_RESULTchar *owl_cmd_describe(const owl_cmd *cmd)230 CALLER_OWN char *owl_cmd_describe(const owl_cmd *cmd) 231 231 { 232 232 if (!cmd || !cmd->name || !cmd->summary) return NULL; -
commands.c
rb470451 r6829afc 1373 1373 } 1374 1374 1375 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_smartfilter(int argc, const char *const *argv, const char *buff)1375 CALLER_OWN char *owl_command_smartfilter(int argc, const char *const *argv, const char *buff) 1376 1376 { 1377 1377 char *filtname = NULL; … … 1413 1413 } 1414 1414 1415 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_get_shift(int argc, const char *const *argv, const char *buff)1415 CALLER_OWN char *owl_command_get_shift(int argc, const char *const *argv, const char *buff) 1416 1416 { 1417 1417 if(argc != 1) … … 1644 1644 1645 1645 1646 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_exec(int argc, const char *const *argv, const char *buff)1646 CALLER_OWN char *owl_command_exec(int argc, const char *const *argv, const char *buff) 1647 1647 { 1648 1648 return owl_function_exec(argc, argv, buff, OWL_OUTPUT_RETURN); 1649 1649 } 1650 1650 1651 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_pexec(int argc, const char *const *argv, const char *buff)1651 CALLER_OWN char *owl_command_pexec(int argc, const char *const *argv, const char *buff) 1652 1652 { 1653 1653 return owl_function_exec(argc, argv, buff, OWL_OUTPUT_POPUP); 1654 1654 } 1655 1655 1656 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_aexec(int argc, const char *const *argv, const char *buff)1656 CALLER_OWN char *owl_command_aexec(int argc, const char *const *argv, const char *buff) 1657 1657 { 1658 1658 return owl_function_exec(argc, argv, buff, OWL_OUTPUT_ADMINMSG); 1659 1659 } 1660 1660 1661 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_perl(int argc, const char *const *argv, const char *buff)1661 CALLER_OWN char *owl_command_perl(int argc, const char *const *argv, const char *buff) 1662 1662 { 1663 1663 return owl_function_perl(argc, argv, buff, OWL_OUTPUT_RETURN); 1664 1664 } 1665 1665 1666 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_pperl(int argc, const char *const *argv, const char *buff)1666 CALLER_OWN char *owl_command_pperl(int argc, const char *const *argv, const char *buff) 1667 1667 { 1668 1668 return owl_function_perl(argc, argv, buff, OWL_OUTPUT_POPUP); 1669 1669 } 1670 1670 1671 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_aperl(int argc, const char *const *argv, const char *buff)1671 CALLER_OWN char *owl_command_aperl(int argc, const char *const *argv, const char *buff) 1672 1672 { 1673 1673 return owl_function_perl(argc, argv, buff, OWL_OUTPUT_ADMINMSG); 1674 1674 } 1675 1675 1676 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_multi(int argc, const char *const *argv, const char *buff)1676 CALLER_OWN char *owl_command_multi(int argc, const char *const *argv, const char *buff) 1677 1677 { 1678 1678 char *lastrv = NULL, *newbuff; … … 2594 2594 } 2595 2595 2596 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_getstyle(int argc, const char *const *argv, const char *buff)2596 CALLER_OWN char *owl_command_getstyle(int argc, const char *const *argv, const char *buff) 2597 2597 { 2598 2598 const char *stylename; … … 2637 2637 } 2638 2638 2639 G_GNUC_WARN_UNUSED_RESULTchar *owl_command_with_history(int argc, const char *const *argv, const char *buff)2639 CALLER_OWN char *owl_command_with_history(int argc, const char *const *argv, const char *buff) 2640 2640 { 2641 2641 owl_history *hist; -
context.c
rd427f08 r6829afc 6 6 7 7 /* TODO: dependency from owl_context -> owl_window is annoying. */ 8 G_GNUC_WARN_UNUSED_RESULTowl_context *owl_context_new(int mode, void *data, const char *keymap, owl_window *cursor)8 CALLER_OWN owl_context *owl_context_new(int mode, void *data, const char *keymap, owl_window *cursor) 9 9 { 10 10 owl_context *c; -
dict.c
rd427f08 r6829afc 107 107 /* Doesn't free the value of the element, but does 108 108 * return it so the caller can free it. */ 109 G_GNUC_WARN_UNUSED_RESULTvoid *owl_dict_remove_element(owl_dict *d, const char *k)109 CALLER_OWN void *owl_dict_remove_element(owl_dict *d, const char *k) 110 110 { 111 111 int i; -
editcontext.c
rd427f08 r6829afc 8 8 } 9 9 10 G_GNUC_WARN_UNUSED_RESULTowl_context *owl_editcontext_new(int mode, owl_editwin *e, const char *keymap, void (*deactivate_cb)(owl_context*), void *cbdata)10 CALLER_OWN owl_context *owl_editcontext_new(int mode, owl_editwin *e, const char *keymap, void (*deactivate_cb)(owl_context*), void *cbdata) 11 11 { 12 12 owl_context *ctx = owl_context_new(mode, owl_editwin_ref(e), keymap, -
editwin.c
rd427f08 r6829afc 61 61 static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len); 62 62 static int oe_copy_region(owl_editwin *e); 63 static G_GNUC_WARN_UNUSED_RESULTchar *oe_chunk(owl_editwin *e, int start, int end);63 static CALLER_OWN char *oe_chunk(owl_editwin *e, int start, int end); 64 64 static void oe_destroy_cbdata(owl_editwin *e); 65 65 static void oe_dirty(owl_editwin *e); … … 70 70 #define WHITESPACE " \n\t" 71 71 72 static G_GNUC_WARN_UNUSED_RESULTowl_editwin *owl_editwin_allocate(void)72 static CALLER_OWN owl_editwin *owl_editwin_allocate(void) 73 73 { 74 74 owl_editwin *e = g_new0(owl_editwin, 1); … … 142 142 } 143 143 144 G_GNUC_WARN_UNUSED_RESULTowl_editwin *owl_editwin_new(owl_window *win, int winlines, int wincols, int style, owl_history *hist)144 CALLER_OWN owl_editwin *owl_editwin_new(owl_window *win, int winlines, int wincols, int style, owl_history *hist) 145 145 { 146 146 owl_editwin *e = owl_editwin_allocate(); … … 1369 1369 } 1370 1370 1371 G_GNUC_WARN_UNUSED_RESULTchar *owl_editwin_get_region(owl_editwin *e)1371 CALLER_OWN char *owl_editwin_get_region(owl_editwin *e) 1372 1372 { 1373 1373 int start, end; … … 1388 1388 } 1389 1389 1390 static G_GNUC_WARN_UNUSED_RESULTchar *oe_chunk(owl_editwin *e, int start, int end)1390 static CALLER_OWN char *oe_chunk(owl_editwin *e, int start, int end) 1391 1391 { 1392 1392 char *p; -
filter.c
rd427f08 r6829afc 200 200 201 201 202 char G_GNUC_WARN_UNUSED_RESULT*owl_filter_print(const owl_filter *f)202 char CALLER_OWN *owl_filter_print(const owl_filter *f) 203 203 { 204 204 GString *out = g_string_new(""); -
fmtext.c
rd427f08 r6829afc 171 171 * freeing the return 172 172 */ 173 char G_GNUC_WARN_UNUSED_RESULT*owl_fmtext_print_plain(const owl_fmtext *f)173 char CALLER_OWN *owl_fmtext_print_plain(const owl_fmtext *f) 174 174 { 175 175 return owl_strip_format_chars(f->buff->str); -
functions.c
rb470451 r6829afc 14 14 #include "filterproc.h" 15 15 16 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_command(const char *cmdbuff)16 CALLER_OWN char *owl_function_command(const char *cmdbuff) 17 17 { 18 18 owl_function_debugmsg("executing command: %s", cmdbuff); … … 21 21 } 22 22 23 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_command_argv(const char *const *argv, int argc)23 CALLER_OWN char *owl_function_command_argv(const char *const *argv, int argc) 24 24 { 25 25 return owl_cmddict_execute_argv(owl_global_get_cmddict(&g), … … 95 95 } 96 96 97 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_style_describe(const char *name)97 CALLER_OWN char *owl_function_style_describe(const char *name) 98 98 { 99 99 const char *desc; … … 112 112 } 113 113 114 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_cmd_describe(const char *name)114 CALLER_OWN char *owl_function_cmd_describe(const char *name) 115 115 { 116 116 const owl_cmd *cmd = owl_cmddict_find(owl_global_get_cmddict(&g), name); … … 250 250 * owl_global_messagequeue_addmsg() for that. 251 251 */ 252 G_GNUC_WARN_UNUSED_RESULTowl_message *owl_function_make_outgoing_aim(const char *body, const char *to)252 CALLER_OWN owl_message *owl_function_make_outgoing_aim(const char *body, const char *to) 253 253 { 254 254 owl_message *m; … … 271 271 * owl_global_messagequeue_addmsg() for that. 272 272 */ 273 G_GNUC_WARN_UNUSED_RESULTowl_message *owl_function_make_outgoing_loopback(const char *body)273 CALLER_OWN owl_message *owl_function_make_outgoing_loopback(const char *body) 274 274 { 275 275 owl_message *m; … … 1900 1900 } 1901 1901 1902 G_GNUC_WARN_UNUSED_RESULTowl_editwin *owl_function_start_question(const char *line)1902 CALLER_OWN owl_editwin *owl_function_start_question(const char *line) 1903 1903 { 1904 1904 owl_editwin *tw; … … 1915 1915 } 1916 1916 1917 G_GNUC_WARN_UNUSED_RESULTowl_editwin *owl_function_start_password(const char *line)1917 CALLER_OWN owl_editwin *owl_function_start_password(const char *line) 1918 1918 { 1919 1919 owl_editwin *tw; … … 1932 1932 } 1933 1933 1934 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_exec(int argc, const char *const *argv, const char *buff, int type)1934 CALLER_OWN char *owl_function_exec(int argc, const char *const *argv, const char *buff, int type) 1935 1935 { 1936 1936 /* if type == 1 display in a popup … … 1975 1975 } 1976 1976 1977 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_perl(int argc, const char *const *argv, const char *buff, int type)1977 CALLER_OWN char *owl_function_perl(int argc, const char *const *argv, const char *buff, int type) 1978 1978 { 1979 1979 /* if type == 1 display in a popup … … 2145 2145 * Returns the name of the negated filter, which the caller must free. 2146 2146 */ 2147 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_create_negative_filter(const char *filtername)2147 CALLER_OWN char *owl_function_create_negative_filter(const char *filtername) 2148 2148 { 2149 2149 char *newname; … … 2242 2242 * If 'related' is nonzero, encompass unclasses and .d classes as well. 2243 2243 */ 2244 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_classinstfilt(const char *c, const char *i, int related)2244 CALLER_OWN char *owl_function_classinstfilt(const char *c, const char *i, int related) 2245 2245 { 2246 2246 owl_filter *f; … … 2329 2329 * the filter, which the caller must free. 2330 2330 */ 2331 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_zuserfilt(const char *longuser)2331 CALLER_OWN char *owl_function_zuserfilt(const char *longuser) 2332 2332 { 2333 2333 owl_filter *f; … … 2375 2375 * Returns the name of the filter, which the caller must free. 2376 2376 */ 2377 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_aimuserfilt(const char *user)2377 CALLER_OWN char *owl_function_aimuserfilt(const char *user) 2378 2378 { 2379 2379 owl_filter *f; … … 2413 2413 } 2414 2414 2415 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_typefilt(const char *type)2415 CALLER_OWN char *owl_function_typefilt(const char *type) 2416 2416 { 2417 2417 owl_filter *f; … … 2469 2469 } 2470 2470 2471 static G_GNUC_WARN_UNUSED_RESULTchar *owl_function_smartfilter_cc(const owl_message *m)2471 static CALLER_OWN char *owl_function_smartfilter_cc(const owl_message *m) 2472 2472 { 2473 2473 const char *ccs; … … 2521 2521 * name to the AIM conversation with that user 2522 2522 */ 2523 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_smartfilter(int type, int invert_related)2523 CALLER_OWN char *owl_function_smartfilter(int type, int invert_related) 2524 2524 { 2525 2525 const owl_view *v; … … 2860 2860 } 2861 2861 2862 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_keymap_summary(const char *name)2862 CALLER_OWN char *owl_function_keymap_summary(const char *name) 2863 2863 { 2864 2864 const owl_keymap *km … … 2974 2974 /* strips formatting from ztext and returns the unformatted text. 2975 2975 * caller is responsible for freeing. */ 2976 G_GNUC_WARN_UNUSED_RESULTchar *owl_function_ztext_stylestrip(const char *zt)2976 CALLER_OWN char *owl_function_ztext_stylestrip(const char *zt) 2977 2977 { 2978 2978 owl_fmtext fm; -
global.c
r43744ce r6829afc 172 172 /* Pops the current context from the context stack and returns it. Caller is 173 173 * responsible for freeing. */ 174 G_GNUC_WARN_UNUSED_RESULTowl_context *owl_global_pop_context_no_delete(owl_global *g)174 CALLER_OWN owl_context *owl_global_pop_context_no_delete(owl_global *g) 175 175 { 176 176 owl_context *c; … … 725 725 * necessary. 726 726 */ 727 owl_message G_GNUC_WARN_UNUSED_RESULT*owl_global_messagequeue_popmsg(owl_global *g)727 owl_message CALLER_OWN *owl_global_messagequeue_popmsg(owl_global *g) 728 728 { 729 729 owl_message *out; -
keybinding.c
rd427f08 r6829afc 14 14 15 15 /* sets up a new keybinding for a command */ 16 G_GNUC_WARN_UNUSED_RESULTowl_keybinding *owl_keybinding_new(const char *keyseq, const char *command, void (*function_fn)(void), const char *desc)16 CALLER_OWN owl_keybinding *owl_keybinding_new(const char *keyseq, const char *command, void (*function_fn)(void), const char *desc) 17 17 { 18 18 owl_keybinding *kb = g_new(owl_keybinding, 1); … … 85 85 } 86 86 87 G_GNUC_WARN_UNUSED_RESULTchar *owl_keybinding_stack_tostring(int *j, int len)87 CALLER_OWN char *owl_keybinding_stack_tostring(int *j, int len) 88 88 { 89 89 GString *string; … … 100 100 } 101 101 102 G_GNUC_WARN_UNUSED_RESULTchar *owl_keybinding_tostring(const owl_keybinding *kb)102 CALLER_OWN char *owl_keybinding_tostring(const owl_keybinding *kb) 103 103 { 104 104 return owl_keybinding_stack_tostring(kb->keys, kb->len); -
keymap.c
rd427f08 r6829afc 80 80 81 81 /* returns a summary line describing this keymap. the caller must free. */ 82 G_GNUC_WARN_UNUSED_RESULTchar *owl_keymap_summary(const owl_keymap *km)82 CALLER_OWN char *owl_keymap_summary(const owl_keymap *km) 83 83 { 84 84 if (!km || !km->name || !km->desc) return NULL; -
keypress.c
rd427f08 r6829afc 129 129 /* OWL_META is definied in owl.h */ 130 130 131 char G_GNUC_WARN_UNUSED_RESULT*owl_keypress_tostring(int j, int esc)131 char CALLER_OWN *owl_keypress_tostring(int j, int esc) 132 132 { 133 133 GString *kb; -
logging.c
rd427f08 r6829afc 80 80 } 81 81 82 G_GNUC_WARN_UNUSED_RESULTchar *owl_log_zephyr(const owl_message *m)82 CALLER_OWN char *owl_log_zephyr(const owl_message *m) 83 83 { 84 84 char *tmp = NULL; … … 104 104 } 105 105 106 G_GNUC_WARN_UNUSED_RESULTchar *owl_log_aim(const owl_message *m)106 CALLER_OWN char *owl_log_aim(const owl_message *m) 107 107 { 108 108 GString *buffer = NULL; … … 122 122 } 123 123 124 G_GNUC_WARN_UNUSED_RESULTchar *owl_log_jabber(const owl_message *m)124 CALLER_OWN char *owl_log_jabber(const owl_message *m) 125 125 { 126 126 GString *buffer = NULL; … … 135 135 } 136 136 137 G_GNUC_WARN_UNUSED_RESULTchar *owl_log_generic(const owl_message *m)137 CALLER_OWN char *owl_log_generic(const owl_message *m) 138 138 { 139 139 GString *buffer; -
message.c
rd427f08 r6829afc 580 580 581 581 /* caller must free return value. */ 582 G_GNUC_WARN_UNUSED_RESULTchar *owl_message_get_cc(const owl_message *m)582 CALLER_OWN char *owl_message_get_cc(const owl_message *m) 583 583 { 584 584 const char *cur; … … 597 597 598 598 /* caller must free return value */ 599 G_GNUC_WARN_UNUSED_RESULTGList *owl_message_get_cc_without_recipient(const owl_message *m)599 CALLER_OWN GList *owl_message_get_cc_without_recipient(const owl_message *m) 600 600 { 601 601 char *cc, *shortuser, *recip; -
owl.h
r95b52d1 r6829afc 199 199 #define OWL_ENABLE_ZCRYPT 1 200 200 #endif 201 202 /* Annotate functions in which the caller owns the return value and is 203 * responsible for ensuring it is freed. */ 204 #define CALLER_OWN G_GNUC_WARN_UNUSED_RESULT 201 205 202 206 #define OWL_META(key) ((key)|010000) … … 251 255 * WARNING: this approach is hard to make 252 256 * thread-safe... */ 253 char G_GNUC_WARN_UNUSED_RESULT*(*get_tostring_fn)(const struct _owl_variable *v, const void *val);257 char CALLER_OWN *(*get_tostring_fn)(const struct _owl_variable *v, const void *val); 254 258 /* converts val to a string; 255 259 * caller must free the result */ … … 313 317 314 318 /* These don't take any context */ 315 char G_GNUC_WARN_UNUSED_RESULT*(*cmd_args_fn)(int argc, const char *const *argv, const char *buff);319 char CALLER_OWN *(*cmd_args_fn)(int argc, const char *const *argv, const char *buff); 316 320 /* takes argv and the full command as buff. 317 321 * caller must free return value if !NULL */ … … 320 324 321 325 /* The following also take the active context if it's valid */ 322 char G_GNUC_WARN_UNUSED_RESULT*(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff);326 char CALLER_OWN *(*cmd_ctxargs_fn)(void *ctx, int argc, const char *const *argv, const char *buff); 323 327 /* takes argv and the full command as buff. 324 328 * caller must free return value if !NULL */ -
perlconfig.c
rd427f08 r6829afc 23 23 24 24 25 G_GNUC_WARN_UNUSED_RESULTSV *owl_new_sv(const char * str)25 CALLER_OWN SV *owl_new_sv(const char * str) 26 26 { 27 27 SV *ret = newSVpv(str, 0); … … 36 36 } 37 37 38 G_GNUC_WARN_UNUSED_RESULTAV *owl_new_av(const owl_list *l, SV *(*to_sv)(const void *))38 CALLER_OWN AV *owl_new_av(const owl_list *l, SV *(*to_sv)(const void *)) 39 39 { 40 40 AV *ret; … … 52 52 } 53 53 54 G_GNUC_WARN_UNUSED_RESULTHV *owl_new_hv(const owl_dict *d, SV *(*to_sv)(const void *))54 CALLER_OWN HV *owl_new_hv(const owl_dict *d, SV *(*to_sv)(const void *)) 55 55 { 56 56 HV *ret; … … 75 75 } 76 76 77 G_GNUC_WARN_UNUSED_RESULTSV *owl_perlconfig_message2hashref(const owl_message *m)77 CALLER_OWN SV *owl_perlconfig_message2hashref(const owl_message *m) 78 78 { 79 79 HV *h, *stash; … … 165 165 } 166 166 167 G_GNUC_WARN_UNUSED_RESULTSV *owl_perlconfig_curmessage2hashref(void)167 CALLER_OWN SV *owl_perlconfig_curmessage2hashref(void) 168 168 { 169 169 int curmsg; … … 183 183 This has been somewhat addressed, but is still not lossless. 184 184 */ 185 G_GNUC_WARN_UNUSED_RESULTowl_message *owl_perlconfig_hashref2message(SV *msg)185 CALLER_OWN owl_message *owl_perlconfig_hashref2message(SV *msg) 186 186 { 187 187 owl_message * m; … … 251 251 /* Calls in a scalar context, passing it a hash reference. 252 252 If return value is non-null, caller must free. */ 253 G_GNUC_WARN_UNUSED_RESULTchar *owl_perlconfig_call_with_message(const char *subname, const owl_message *m)253 CALLER_OWN char *owl_perlconfig_call_with_message(const char *subname, const owl_message *m) 254 254 { 255 255 dSP ; … … 300 300 If the return value is non-null, the caller must free it. 301 301 */ 302 G_GNUC_WARN_UNUSED_RESULTchar *owl_perlconfig_message_call_method(const owl_message *m, const char *method, int argc, const char **argv)302 CALLER_OWN char *owl_perlconfig_message_call_method(const owl_message *m, const char *method, int argc, const char **argv) 303 303 { 304 304 dSP; … … 350 350 351 351 /* caller must free result, if not NULL */ 352 G_GNUC_WARN_UNUSED_RESULTchar *owl_perlconfig_initperl(const char *file, int *Pargc, char ***Pargv, char ***Penv)352 CALLER_OWN char *owl_perlconfig_initperl(const char *file, int *Pargc, char ***Pargv, char ***Penv) 353 353 { 354 354 int ret; … … 436 436 437 437 /* caller is responsible for freeing returned string */ 438 G_GNUC_WARN_UNUSED_RESULTchar *owl_perlconfig_execute(const char *line)438 CALLER_OWN char *owl_perlconfig_execute(const char *line) 439 439 { 440 440 STRLEN len; … … 506 506 507 507 /* caller must free the result */ 508 G_GNUC_WARN_UNUSED_RESULTchar *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv)508 CALLER_OWN char *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv) 509 509 { 510 510 int i, count; -
popwin.c
rd427f08 r6829afc 1 1 #include "owl.h" 2 2 3 G_GNUC_WARN_UNUSED_RESULTowl_popwin *owl_popwin_new(void)3 CALLER_OWN owl_popwin *owl_popwin_new(void) 4 4 { 5 5 owl_popwin *pw = g_new0(owl_popwin, 1); -
text.c
rd427f08 r6829afc 7 7 /* Returns a copy of 'in' with each line indented 'n' 8 8 * characters. Result must be freed with g_free. */ 9 G_GNUC_WARN_UNUSED_RESULTchar *owl_text_indent(const char *in, int n)9 CALLER_OWN char *owl_text_indent(const char *in, int n) 10 10 { 11 11 const char *ptr1, *ptr2, *last; … … 48 48 49 49 /* caller must free the return */ 50 G_GNUC_WARN_UNUSED_RESULTchar *owl_text_htmlstrip(const char *in)50 CALLER_OWN char *owl_text_htmlstrip(const char *in) 51 51 { 52 52 const char *ptr1, *end, *ptr2, *ptr3; … … 129 129 130 130 /* Caller must free return */ 131 G_GNUC_WARN_UNUSED_RESULTchar *owl_text_expand_tabs(const char *in)131 CALLER_OWN char *owl_text_expand_tabs(const char *in) 132 132 { 133 133 int len = 0; … … 188 188 189 189 /* caller must free the return */ 190 G_GNUC_WARN_UNUSED_RESULTchar *owl_text_wordwrap(const char *in, int col)190 CALLER_OWN char *owl_text_wordwrap(const char *in, int col) 191 191 { 192 192 char *out; … … 269 269 * Caller must free returned string. 270 270 */ 271 G_GNUC_WARN_UNUSED_RESULTchar *owl_text_substitute(const char *in, const char *from, const char *to)271 CALLER_OWN char *owl_text_substitute(const char *in, const char *from, const char *to) 272 272 { 273 273 char **split = g_strsplit(in, from, 0), *out; … … 284 284 * On success returns the string, on error returns NULL. 285 285 */ 286 G_GNUC_WARN_UNUSED_RESULTchar *owl_text_quote(const char *in, const char *toquote, const char *quotestr)286 CALLER_OWN char *owl_text_quote(const char *in, const char *toquote, const char *quotestr) 287 287 { 288 288 int i, x, r, place, escape; -
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; -
variable.c
rd427f08 r6829afc 646 646 } 647 647 648 G_GNUC_WARN_UNUSED_RESULTowl_variable *owl_variable_newvar(const char *name, const char *summary, const char *description)648 CALLER_OWN owl_variable *owl_variable_newvar(const char *name, const char *summary, const char *description) 649 649 { 650 650 owl_variable * var = g_new0(owl_variable, 1); … … 825 825 } 826 826 827 G_GNUC_WARN_UNUSED_RESULTchar *owl_variable_get_tostring(const owl_vardict *d, const char *name)827 CALLER_OWN char *owl_variable_get_tostring(const owl_vardict *d, const char *name) 828 828 { 829 829 owl_variable *v; … … 834 834 } 835 835 836 G_GNUC_WARN_UNUSED_RESULTchar *owl_variable_get_default_tostring(const owl_vardict *d, const char *name)836 CALLER_OWN char *owl_variable_get_default_tostring(const owl_vardict *d, const char *name) 837 837 { 838 838 owl_variable *v; … … 995 995 } 996 996 997 G_GNUC_WARN_UNUSED_RESULTchar *owl_variable_bool_get_tostring_default(const owl_variable *v, const void *val)997 CALLER_OWN char *owl_variable_bool_get_tostring_default(const owl_variable *v, const void *val) 998 998 { 999 999 if (val == NULL) { … … 1031 1031 } 1032 1032 1033 G_GNUC_WARN_UNUSED_RESULTchar *owl_variable_int_get_tostring_default(const owl_variable *v, const void *val)1033 CALLER_OWN char *owl_variable_int_get_tostring_default(const owl_variable *v, const void *val) 1034 1034 { 1035 1035 if (val == NULL) { … … 1071 1071 } 1072 1072 1073 G_GNUC_WARN_UNUSED_RESULTchar *owl_variable_enum_get_tostring(const owl_variable *v, const void *val)1073 CALLER_OWN char *owl_variable_enum_get_tostring(const owl_variable *v, const void *val) 1074 1074 { 1075 1075 char **enums; … … 1112 1112 } 1113 1113 1114 G_GNUC_WARN_UNUSED_RESULTchar *owl_variable_string_get_tostring_default(const owl_variable *v, const void *val)1114 CALLER_OWN char *owl_variable_string_get_tostring_default(const owl_variable *v, const void *val) 1115 1115 { 1116 1116 if (val == NULL) { -
viewwin.c
rd427f08 r6829afc 12 12 * will be used by the viewwin 13 13 */ 14 G_GNUC_WARN_UNUSED_RESULTowl_viewwin *owl_viewwin_new_text(owl_window *win, const char *text)14 CALLER_OWN owl_viewwin *owl_viewwin_new_text(owl_window *win, const char *text) 15 15 { 16 16 owl_viewwin *v = g_new0(owl_viewwin, 1); … … 34 34 * will be used by the viewwin 35 35 */ 36 G_GNUC_WARN_UNUSED_RESULTowl_viewwin *owl_viewwin_new_fmtext(owl_window *win, const owl_fmtext *fmtext)36 CALLER_OWN owl_viewwin *owl_viewwin_new_fmtext(owl_window *win, const owl_fmtext *fmtext) 37 37 { 38 38 char *text; … … 237 237 } 238 238 239 G_GNUC_WARN_UNUSED_RESULTowl_editwin *owl_viewwin_set_typwin_active(owl_viewwin *v, owl_history *hist) {239 CALLER_OWN owl_editwin *owl_viewwin_set_typwin_active(owl_viewwin *v, owl_history *hist) { 240 240 int lines, cols; 241 241 owl_editwin *cmdline; -
window.c
rd427f08 r6829afc 569 569 }; 570 570 571 G_GNUC_WARN_UNUSED_RESULTGSource *owl_window_redraw_source_new(void)571 CALLER_OWN GSource *owl_window_redraw_source_new(void) 572 572 { 573 573 GSource *source; -
zcrypt.c
rd427f08 r6829afc 27 27 #include "filterproc.h" 28 28 29 /* Annotate functions in which the caller owns the return value and is 30 * responsible for ensuring it is freed. */ 31 #define CALLER_OWN G_GNUC_WARN_UNUSED_RESULT 32 29 33 #define MAX_KEY 128 30 34 #define MAX_LINE 128 … … 53 57 } ZWRITEOPTIONS; 54 58 55 G_GNUC_WARN_UNUSED_RESULTchar *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance);59 CALLER_OWN char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance); 56 60 int ParseCryptSpec(const char *spec, const char **keyfile); 57 G_GNUC_WARN_UNUSED_RESULTchar *BuildArgString(char **argv, int start, int end);58 G_GNUC_WARN_UNUSED_RESULTchar *read_keystring(const char *keyfile);61 CALLER_OWN char *BuildArgString(char **argv, int start, int end); 62 CALLER_OWN char *read_keystring(const char *keyfile); 59 63 60 64 int do_encrypt(int zephyr, const char *class, const char *instance, … … 364 368 /* Build a space-separated string from argv from elements between start * 365 369 * and end - 1. malloc()'s the returned string. */ 366 G_GNUC_WARN_UNUSED_RESULTchar *BuildArgString(char **argv, int start, int end)370 CALLER_OWN char *BuildArgString(char **argv, int start, int end) 367 371 { 368 372 int len = 1; … … 401 405 #define MAX_SEARCH 3 402 406 /* Find the class/instance in the .crypt-table */ 403 G_GNUC_WARN_UNUSED_RESULTchar *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance)407 CALLER_OWN char *GetZephyrVarKeyFile(const char *whoami, const char *class, const char *instance) 404 408 { 405 409 char *keyfile = NULL; … … 579 583 } 580 584 581 G_GNUC_WARN_UNUSED_RESULTchar *slurp_stdin(int ignoredot, int *length) {585 CALLER_OWN char *slurp_stdin(int ignoredot, int *length) { 582 586 char *buf; 583 587 char *inptr; … … 611 615 } 612 616 613 G_GNUC_WARN_UNUSED_RESULTchar *GetInputBuffer(ZWRITEOPTIONS *zoptions, int *length) {617 CALLER_OWN char *GetInputBuffer(ZWRITEOPTIONS *zoptions, int *length) { 614 618 char *buf; 615 619 … … 637 641 } 638 642 639 G_GNUC_WARN_UNUSED_RESULTchar *read_keystring(const char *keyfile) {643 CALLER_OWN char *read_keystring(const char *keyfile) { 640 644 char *keystring; 641 645 FILE *fkey = fopen(keyfile, "r"); -
zephyr.c
rd427f08 r6829afc 524 524 */ 525 525 #ifdef HAVE_LIBZEPHYR 526 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_field(const ZNotice_t *n, int j)526 CALLER_OWN char *owl_zephyr_get_field(const ZNotice_t *n, int j) 527 527 { 528 528 int i, count, save; … … 552 552 } 553 553 554 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_field_as_utf8(const ZNotice_t *n, int j)554 CALLER_OWN char *owl_zephyr_get_field_as_utf8(const ZNotice_t *n, int j) 555 555 { 556 556 int i, count, save; … … 584 584 } 585 585 #else 586 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_field(void *n, int j)586 CALLER_OWN char *owl_zephyr_get_field(void *n, int j) 587 587 { 588 588 return(g_strdup("")); 589 589 } 590 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_field_as_utf8(void *n, int j)590 CALLER_OWN char *owl_zephyr_get_field_as_utf8(void *n, int j) 591 591 { 592 592 return owl_zephyr_get_field(n, j); … … 621 621 * caller must free the return 622 622 */ 623 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_get_message(const ZNotice_t *n, const owl_message *m)623 CALLER_OWN char *owl_zephyr_get_message(const ZNotice_t *n, const owl_message *m) 624 624 { 625 625 #define OWL_NFIELDS 5 … … 942 942 #endif 943 943 944 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_zlocate(const char *user, int auth)944 CALLER_OWN char *owl_zephyr_zlocate(const char *user, int auth) 945 945 { 946 946 #ifdef HAVE_LIBZEPHYR … … 1042 1042 1043 1043 /* caller must free the return */ 1044 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip)1044 CALLER_OWN char *owl_zephyr_makesubline(const char *class, const char *inst, const char *recip) 1045 1045 { 1046 1046 return g_strdup_printf("%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip); … … 1122 1122 * free the return. 1123 1123 */ 1124 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_getsubs(void)1124 CALLER_OWN char *owl_zephyr_getsubs(void) 1125 1125 { 1126 1126 #ifdef HAVE_LIBZEPHYR … … 1242 1242 * The caller must free the return 1243 1243 */ 1244 G_GNUC_WARN_UNUSED_RESULTchar *short_zuser(const char *in)1244 CALLER_OWN char *short_zuser(const char *in) 1245 1245 { 1246 1246 char *ptr = strrchr(in, '@'); … … 1254 1254 * The caller must free the return. 1255 1255 */ 1256 G_GNUC_WARN_UNUSED_RESULTchar *long_zuser(const char *in)1256 CALLER_OWN char *long_zuser(const char *in) 1257 1257 { 1258 1258 char *ptr = strrchr(in, '@'); … … 1282 1282 * caller must free the return. 1283 1283 */ 1284 G_GNUC_WARN_UNUSED_RESULTchar *owl_zephyr_smartstripped_user(const char *in)1284 CALLER_OWN char *owl_zephyr_smartstripped_user(const char *in) 1285 1285 { 1286 1286 char *slash, *dot, *realm, *out; -
zwrite.c
rd427f08 r6829afc 5 5 #include "owl.h" 6 6 7 G_GNUC_WARN_UNUSED_RESULTowl_zwrite *owl_zwrite_new(const char *line)7 CALLER_OWN owl_zwrite *owl_zwrite_new(const char *line) 8 8 { 9 9 owl_zwrite *z = g_new(owl_zwrite, 1); … … 321 321 322 322 /* Caller must free the result. */ 323 G_GNUC_WARN_UNUSED_RESULTchar *owl_zwrite_get_recip_n_with_realm(const owl_zwrite *z, int n)323 CALLER_OWN char *owl_zwrite_get_recip_n_with_realm(const owl_zwrite *z, int n) 324 324 { 325 325 if (z->realm[0]) { … … 370 370 * If not a CC, only the recip_index'th user will be replied to. 371 371 */ 372 G_GNUC_WARN_UNUSED_RESULTchar *owl_zwrite_get_replyline(const owl_zwrite *z, int recip_index)372 CALLER_OWN char *owl_zwrite_get_replyline(const owl_zwrite *z, int recip_index) 373 373 { 374 374 /* Match ordering in zwrite help. */
Note: See TracChangeset
for help on using the changeset viewer.