Changeset c6c51d2
- Timestamp:
- May 18, 2011, 4:10:39 PM (13 years ago)
- Parents:
- 7865479 (diff), 92fc397 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
cmd.c
r6a71113 r92fc397 12 12 13 13 int owl_cmddict_setup(owl_cmddict *cd) { 14 if (0 != owl_cmddict_init(cd)) return(-1);14 owl_cmddict_init(cd); 15 15 if (0 != owl_cmddict_add_from_list(cd, commands_to_init)) return(-1); 16 16 return(0); 17 17 } 18 18 19 int owl_cmddict_init(owl_cmddict *cd) { 20 if (owl_dict_create(cd)) return(-1); 21 return(0); 19 void owl_cmddict_init(owl_cmddict *cd) { 20 owl_dict_create(cd); 22 21 } 23 22 … … 135 134 void owl_cmd_cleanup(owl_cmd *cmd) 136 135 { 137 if (cmd->name)g_free(cmd->name);138 if (cmd->summary)g_free(cmd->summary);139 if (cmd->usage)g_free(cmd->usage);140 if (cmd->description)g_free(cmd->description);141 if (cmd->cmd_aliased_to)g_free(cmd->cmd_aliased_to);136 g_free(cmd->name); 137 g_free(cmd->summary); 138 g_free(cmd->usage); 139 g_free(cmd->description); 140 g_free(cmd->cmd_aliased_to); 142 141 if (cmd->cmd_perl) owl_perlconfig_cmd_cleanup(cmd); 143 142 } -
commands.c
rc809f5e r55b2de8 1288 1288 } 1289 1289 owl_function_nextmsg_full(filter, skip_deleted, last_if_none); 1290 if (filter)g_free(filter);1290 g_free(filter); 1291 1291 return(NULL); 1292 1292 } … … 1318 1318 } 1319 1319 owl_function_prevmsg_full(filter, skip_deleted, first_if_none); 1320 if (filter)g_free(filter);1320 g_free(filter); 1321 1321 return(NULL); 1322 1322 } … … 1691 1691 commands = g_strsplit_set(newbuff, ";", 0); 1692 1692 for (i = 0; commands[i] != NULL; i++) { 1693 if (lastrv) { 1694 g_free(lastrv); 1695 } 1693 g_free(lastrv); 1696 1694 lastrv = owl_function_command(commands[i]); 1697 1695 } -
dict.c
rf25df21 r92fc397 15 15 #define GROWBY 3 / 2 16 16 17 intowl_dict_create(owl_dict *d) {17 void owl_dict_create(owl_dict *d) { 18 18 d->size=0; 19 19 d->els=g_new(owl_dict_el, INITSIZE); 20 20 d->avail=INITSIZE; 21 if (d->els==NULL) return(-1);22 return(0);23 21 } 24 22 … … 60 58 /* Appends dictionary keys to a list. Duplicates the keys, 61 59 * so they will need to be freed by the caller. */ 62 intowl_dict_get_keys(const owl_dict *d, owl_list *l) {60 void owl_dict_get_keys(const owl_dict *d, owl_list *l) { 63 61 int i; 64 char *dupk;65 62 for (i=0; i<d->size; i++) { 66 if ((dupk = g_strdup(d->els[i].k)) == NULL) return(-1); 67 owl_list_append_element(l, dupk); 63 owl_list_append_element(l, g_strdup(d->els[i].k)); 68 64 } 69 return(0);70 65 } 71 66 … … 84 79 { 85 80 int pos, found; 86 char *dupk;87 81 found = _owl_dict_find_pos(d, k, &pos); 88 82 if (found && delete_on_replace) { … … 99 93 if (d->els==NULL) return(-1); 100 94 } 101 if ((dupk = g_strdup(k)) == NULL) return(-1);102 95 if (pos!=d->size) { 103 96 /* shift forward to leave us a slot */ … … 106 99 } 107 100 d->size++; 108 d->els[pos].k = dupk;101 d->els[pos].k = g_strdup(k); 109 102 d->els[pos].v = v; 110 103 return(0); -
editwin.c
r47e0a6a r55b2de8 317 317 } 318 318 319 if (locktext) 320 g_free(locktext); 319 g_free(locktext); 321 320 322 321 oe_set_index(e, lock); -
functions.c
r7865479 rc6c51d2 32 32 char *rv; 33 33 rv=owl_function_command(cmdbuff); 34 if (rv)g_free(rv);34 g_free(rv); 35 35 } 36 36 … … 453 453 454 454 if (rv || status) { 455 if(cryptmsg)g_free(cryptmsg);455 g_free(cryptmsg); 456 456 g_free(old_msg); 457 457 owl_function_error("Error in zcrypt, possibly no key found. Message not sent."); … … 991 991 /* execute the commands in shutdown */ 992 992 ret = owl_perlconfig_execute("BarnOwl::Hooks::_shutdown();"); 993 if (ret)g_free(ret);993 g_free(ret); 994 994 995 995 /* signal our child process, if any */ … … 2358 2358 done: 2359 2359 g_free(class); 2360 if (instance) { 2361 g_free(instance); 2362 } 2360 g_free(instance); 2363 2361 return(filtname); 2364 2362 } -
global.c
r7b4f3be rc72f884 505 505 506 506 void owl_global_set_startupargs(owl_global *g, int argc, char **argv) { 507 if (g->startupargs)g_free(g->startupargs);507 g_free(g->startupargs); 508 508 g->startupargs = g_strjoinv(" ", argv); 509 509 } … … 747 747 } 748 748 749 intowl_global_get_style_names(const owl_global *g, owl_list *l) {750 returnowl_dict_get_keys(&(g->styledict), l);749 void owl_global_get_style_names(const owl_global *g, owl_list *l) { 750 owl_dict_get_keys(&(g->styledict), l); 751 751 } 752 752 -
keybinding.c
rd07af84 r55b2de8 69 69 void owl_keybinding_delete(owl_keybinding *kb) 70 70 { 71 if (kb->keys)g_free(kb->keys);72 if (kb->desc)g_free(kb->desc);73 if (kb->command)g_free(kb->command);71 g_free(kb->keys); 72 g_free(kb->desc); 73 g_free(kb->command); 74 74 g_free(kb); 75 75 } -
keymap.c
r47e0a6a r92fc397 9 9 { 10 10 if (!name || !desc) return(-1); 11 if ((km->name = g_strdup(name)) == NULL) return(-1);12 if ((km->desc = g_strdup(desc)) == NULL) return(-1);13 if (0 != owl_list_create(&km->bindings)) return(-1);11 km->name = g_strdup(name); 12 km->desc = g_strdup(desc); 13 owl_list_create(&km->bindings); 14 14 km->parent = NULL; 15 15 km->default_fn = default_fn; … … 179 179 /* NOTE: keyhandler has private access to the internals of keymap */ 180 180 181 intowl_keyhandler_init(owl_keyhandler *kh)182 { 183 if (0 != owl_dict_create(&kh->keymaps)) return(-1);181 void owl_keyhandler_init(owl_keyhandler *kh) 182 { 183 owl_dict_create(&kh->keymaps); 184 184 kh->active = NULL; 185 185 owl_keyhandler_reset(kh); 186 return(0);187 186 } 188 187 -
list.c
rddbbcffa r7fd0bf7 5 5 #define GROWBY 3 / 2 6 6 7 intowl_list_create(owl_list *l)7 void owl_list_create(owl_list *l) 8 8 { 9 9 l->size=0; 10 10 l->list=g_new(void *, INITSIZE); 11 11 l->avail=INITSIZE; 12 if (l->list==NULL) return(-1);13 return(0);14 12 } 15 13 -
owl.c
r9efa5bd r55b2de8 552 552 owl_function_debugmsg("startup: executing perl startup, if applicable"); 553 553 perlout = owl_perlconfig_execute("BarnOwl::Hooks::_startup();"); 554 if (perlout)g_free(perlout);554 g_free(perlout); 555 555 556 556 /* welcome message */ -
perlconfig.c
rf2d71cfa r55b2de8 467 467 :"BarnOwl::_receive_msg_legacy_wrap", m); 468 468 } 469 if (ptr)g_free(ptr);469 g_free(ptr); 470 470 } 471 471 … … 478 478 :"BarnOwl::Hooks::_new_msg", m); 479 479 } 480 if (ptr)g_free(ptr);480 g_free(ptr); 481 481 } 482 482 -
perlglue.xs
r6a71113 r55b2de8 57 57 RETVAL 58 58 CLEANUP: 59 if (rv)g_free(rv);59 g_free(rv); 60 60 61 61 SV * … … 114 114 RETVAL 115 115 CLEANUP: 116 if (rv)g_free(rv);116 g_free(rv); 117 117 118 118 const utf8 * … … 141 141 RETVAL 142 142 CLEANUP: 143 if (rv)g_free(rv);143 g_free(rv); 144 144 145 145 void … … 324 324 RETVAL 325 325 CLEANUP: 326 if (rv) 327 g_free(rv); 326 g_free(rv); 328 327 329 328 void -
tester.c
rf25df21 r92fc397 233 233 234 234 printf("# BEGIN testing owl_dict\n"); 235 FAIL_UNLESS("create", 0==owl_dict_create(&d));235 owl_dict_create(&d); 236 236 FAIL_UNLESS("insert b", 0==owl_dict_insert_element(&d, "b", bv, owl_dict_noop_delete)); 237 237 FAIL_UNLESS("insert d", 0==owl_dict_insert_element(&d, "d", dv, owl_dict_noop_delete)); … … 249 249 FAIL_UNLESS("get_size", 3==owl_dict_get_size(&d)); 250 250 owl_list_create(&l); 251 FAIL_UNLESS("get_keys", 0==owl_dict_get_keys(&d, &l));251 owl_dict_get_keys(&d, &l); 252 252 FAIL_UNLESS("get_keys result size", 3==owl_list_get_size(&l)); 253 253 -
variable.c
rf203cad r92fc397 559 559 int owl_variable_dict_setup(owl_vardict *vd) { 560 560 owl_variable *var, *cur; 561 if (owl_dict_create(vd)) return(-1);561 owl_dict_create(vd); 562 562 for (var = variables_to_init; var->name != NULL; var++) { 563 563 cur = g_new(owl_variable, 1); … … 641 641 642 642 void owl_variable_update(owl_variable *var, const char *summary, const char *desc) { 643 if(var->summary)g_free(var->summary);643 g_free(var->summary); 644 644 var->summary = g_strdup(summary); 645 if(var->description)g_free(var->description);645 g_free(var->description); 646 646 var->description = g_strdup(desc); 647 647 } … … 651 651 if(old) { 652 652 owl_variable_update(old, summ, desc); 653 if(old->pval_default)g_free(old->pval_default);653 g_free(old->pval_default); 654 654 old->pval_default = g_strdup(initval); 655 655 } else { … … 944 944 void owl_variable_delete_default(owl_variable *v) 945 945 { 946 if (v->val)g_free(v->val);946 g_free(v->val); 947 947 } 948 948 … … 1076 1076 if (!v->validate_fn(v, newval)) return(-1); 1077 1077 } 1078 if (v->val)g_free(v->val);1078 g_free(v->val); 1079 1079 v->val = g_strdup(newval); 1080 1080 return(0); -
view.c
rd4927a7 r55b2de8 160 160 { 161 161 owl_list_cleanup(&v->ml.list, NULL); 162 if (v->name)g_free(v->name);162 g_free(v->name); 163 163 } -
zcrypt.c
r1dd285b r55b2de8 476 476 477 477 for(i = 0; i < MAX_SEARCH; i++) { 478 if(varname[i] != NULL) { 479 g_free(varname[i]); 480 } 481 } 482 483 if(filename != NULL) { 484 g_free(filename); 485 } 478 g_free(varname[i]); 479 } 480 481 g_free(filename); 486 482 487 483 return keyfile; … … 773 769 err = call_filter("gpg", argv, in, &out, &status); 774 770 if(err || status) { 775 if(out)g_free(out);771 g_free(out); 776 772 return FALSE; 777 773 } … … 856 852 err = call_filter("gpg", argv, in, &out, &status); 857 853 if(err || status) { 858 if(out)g_free(out);854 g_free(out); 859 855 return FALSE; 860 856 } -
zephyr.c
rf203cad r55b2de8 417 417 return 0; 418 418 } 419 if (buffer) 420 g_free(buffer); 419 g_free(buffer); 421 420 422 421 return owl_zephyr_loadsubs_helper(subs, count); -
zwrite.c
r3f52e14 r55b2de8 185 185 void owl_zwrite_set_message_raw(owl_zwrite *z, const char *msg) 186 186 { 187 if (z->message)g_free(z->message);187 g_free(z->message); 188 188 z->message = owl_validate_utf8(msg); 189 189 } … … 195 195 char *tmp = NULL, *tmp2; 196 196 197 if (z->message)g_free(z->message);197 g_free(z->message); 198 198 199 199 j=owl_list_get_size(&(z->recips)); … … 289 289 void owl_zwrite_set_opcode(owl_zwrite *z, const char *opcode) 290 290 { 291 if (z->opcode)g_free(z->opcode);291 g_free(z->opcode); 292 292 z->opcode=owl_validate_utf8(opcode); 293 293 } … … 306 306 void owl_zwrite_set_zsig(owl_zwrite *z, const char *zsig) 307 307 { 308 if(z->zsig)g_free(z->zsig);308 g_free(z->zsig); 309 309 z->zsig = g_strdup(zsig); 310 310 } … … 353 353 { 354 354 owl_list_cleanup(&(z->recips), &g_free); 355 if (z->cmd)g_free(z->cmd);356 if (z->zwriteline)g_free(z->zwriteline);357 if (z->class)g_free(z->class);358 if (z->inst)g_free(z->inst);359 if (z->opcode)g_free(z->opcode);360 if (z->realm)g_free(z->realm);361 if (z->message)g_free(z->message);362 if (z->zsig)g_free(z->zsig);355 g_free(z->cmd); 356 g_free(z->zwriteline); 357 g_free(z->class); 358 g_free(z->inst); 359 g_free(z->opcode); 360 g_free(z->realm); 361 g_free(z->message); 362 g_free(z->zsig); 363 363 } 364 364 -
configure.ac
r4479497 r64c829a 115 115 116 116 dnl Add CFLAGS and LIBS for glib-2.0 117 PKG_CHECK_MODULES(GLIB,[glib-2.0 gobject-2.0])117 PKG_CHECK_MODULES(GLIB,[glib-2.0 >= 2.12 gobject-2.0]) 118 118 119 119 AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}]) -
logging.c
rfe3b017 r7865479 151 151 } else if (owl_message_is_type_jabber(m)) { 152 152 to = g_strdup_printf("jabber:%s", owl_message_get_recipient(m)); 153 owl_text_tr(to, '/', '_');153 g_strdelimit(to, "/", '_'); 154 154 } else if (owl_message_is_type_aim(m)) { 155 155 char *temp2; -
owl.h
r7b4f3be rede073c 66 66 #include "window.h" 67 67 68 #ifndef OWL_VERSION_STRING 68 69 #ifdef GIT_VERSION 69 70 #define stringify(x) __stringify(x) … … 73 74 #define OWL_VERSION_STRING PACKAGE_VERSION 74 75 #endif 76 #endif /* !OWL_VERSION_STRING */ 75 77 76 78 /* Feature that is being tested to redirect stderr through a pipe. -
text.c
r42ee1be r7865479 275 275 g_strfreev(split); 276 276 return out; 277 }278 279 /* replace all instances of character a in buff with the character280 * b. buff must be null terminated.281 */282 void owl_text_tr(char *buff, char a, char b)283 {284 int i;285 286 owl_function_debugmsg("In: %s", buff);287 for (i=0; buff[i]!='\0'; i++) {288 if (buff[i]==a) buff[i]=b;289 }290 owl_function_debugmsg("Out: %s", buff);291 277 } 292 278
Note: See TracChangeset
for help on using the changeset viewer.