Changeset f25df21
- Timestamp:
- Mar 24, 2011, 4:05:29 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- c809f5e
- Parents:
- e56303f
- git-author:
- David Benjamin <davidben@mit.edu> (03/08/11 15:04:52)
- git-committer:
- David Benjamin <davidben@mit.edu> (03/24/11 16:05:29)
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
cmd.c
re56303f rf25df21 33 33 } 34 34 35 /* free the list with owl_cmddict_namelist_cleanup */36 35 void owl_cmddict_get_names(const owl_cmddict *d, owl_list *l) { 37 36 owl_dict_get_keys(d, l); … … 40 39 const owl_cmd *owl_cmddict_find(const owl_cmddict *d, const char *name) { 41 40 return owl_dict_find_element(d, name); 42 }43 44 void owl_cmddict_namelist_cleanup(owl_list *l)45 {46 owl_list_cleanup(l, g_free);47 41 } 48 42 -
dict.c
rd4927a7 rf25df21 58 58 } 59 59 60 /* creates a list and fills it in with keys. duplicates the keys,60 /* Appends dictionary keys to a list. Duplicates the keys, 61 61 * so they will need to be freed by the caller. */ 62 62 int owl_dict_get_keys(const owl_dict *d, owl_list *l) { 63 63 int i; 64 64 char *dupk; 65 if (owl_list_create(l)) return(-1);66 65 for (i=0; i<d->size; i++) { 67 66 if ((dupk = g_strdup(d->els[i].k)) == NULL) return(-1); -
functions.c
r4479497 rf25df21 53 53 owl_fmtext_append_bold(&fm, "Commands: "); 54 54 owl_fmtext_append_normal(&fm, "(use 'show command <name>' for details)\n"); 55 owl_list_create(&l); 55 56 owl_cmddict_get_names(owl_global_get_cmddict(&g), &l); 56 57 owl_fmtext_append_list(&fm, &l, "\n", owl_function_cmd_describe); 57 58 owl_fmtext_append_normal(&fm, "\n"); 58 59 owl_function_popless_fmtext(&fm); 59 owl_ cmddict_namelist_cleanup(&l);60 owl_list_cleanup(&l, g_free); 60 61 owl_fmtext_cleanup(&fm); 61 62 } … … 85 86 owl_fmtext_init_null(&fm); 86 87 owl_fmtext_append_bold(&fm, "Styles:\n"); 88 owl_list_create(&l); 87 89 owl_global_get_style_names(&g, &l); 88 90 owl_fmtext_append_list(&fm, &l, "\n", owl_function_style_describe); … … 1623 1625 g_string_append_printf(str, "%-20s = %s\n", "VARIABLE", "VALUE"); 1624 1626 g_string_append_printf(str, "%-20s %s\n", "--------", "-----"); 1627 owl_list_create(&varnames); 1625 1628 owl_variable_dict_get_names(owl_global_get_vardict(&g), &varnames); 1626 1629 numvarnames = owl_list_get_size(&varnames); … … 1637 1640 } 1638 1641 g_string_append(str, "\n"); 1639 owl_ variable_dict_namelist_cleanup(&varnames);1642 owl_list_cleanup(&varnames, g_free); 1640 1643 1641 1644 owl_function_popless_text(str->str); … … 1653 1656 owl_fmtext_append_bold(&fm, 1654 1657 "Variables: (use 'show variable <name>' for details)\n"); 1658 owl_list_create(&varnames); 1655 1659 owl_variable_dict_get_names(owl_global_get_vardict(&g), &varnames); 1656 1660 numvarnames = owl_list_get_size(&varnames); … … 1661 1665 } 1662 1666 } 1663 owl_ variable_dict_namelist_cleanup(&varnames);1667 owl_list_cleanup(&varnames, g_free); 1664 1668 owl_function_popless_fmtext(&fm); 1665 1669 owl_fmtext_cleanup(&fm); … … 2874 2878 owl_fmtext_append_bold(&fm, "Keymaps: "); 2875 2879 owl_fmtext_append_normal(&fm, "(use 'show keymap <name>' for details)\n"); 2880 owl_list_create(&l); 2876 2881 owl_keyhandler_get_keymap_names(kh, &l); 2877 2882 owl_fmtext_append_list(&fm, &l, "\n", owl_function_keymap_summary); … … 2888 2893 2889 2894 owl_function_popless_fmtext(&fm); 2890 owl_ keyhandler_keymap_namelist_cleanup(&l);2895 owl_list_cleanup(&l, g_free); 2891 2896 owl_fmtext_cleanup(&fm); 2892 2897 } -
global.c
rf54b07d rf25df21 764 764 } 765 765 766 /* creates a list and fills it in with keys. duplicates the keys,767 * so they will need to be freed by the caller. */768 766 int owl_global_get_style_names(const owl_global *g, owl_list *l) { 769 767 return owl_dict_get_keys(&(g->styledict), l); -
help.c
rc38bfe0 rf25df21 129 129 owl_fmtext_append_bold(&fm, 130 130 "Variables:\n"); 131 owl_list_create(&varnames); 131 132 owl_variable_dict_get_names(owl_global_get_vardict(&g), &varnames); 132 133 numvarnames = owl_list_get_size(&varnames); … … 137 138 } 138 139 } 139 owl_ variable_dict_namelist_cleanup(&varnames);140 owl_list_cleanup(&varnames, g_free); 140 141 141 142 owl_fmtext_append_normal(&fm, "\n"); -
keymap.c
r3472845 rf25df21 217 217 } 218 218 219 /* free the list with owl_cmddict_namelist_cleanup */220 219 void owl_keyhandler_get_keymap_names(const owl_keyhandler *kh, owl_list *l) 221 220 { 222 221 owl_dict_get_keys(&kh->keymaps, l); 223 222 } 224 225 void owl_keyhandler_keymap_namelist_cleanup(owl_list *l)226 {227 owl_list_cleanup(l, g_free);228 }229 230 223 231 224 -
perlconfig.c
r3472845 rf25df21 63 63 64 64 /* TODO: add an iterator-like interface to owl_dict */ 65 owl_list_create(&l); 65 66 owl_dict_get_keys(d, &l); 66 67 for (i = 0; i < owl_list_get_size(&l); i++) { -
perlglue.xs
rddbbcffa rf25df21 389 389 { 390 390 kh = owl_global_get_keyhandler(&g); 391 owl_list_create(&l); 391 392 owl_keyhandler_get_keymap_names(kh, &l); 392 393 RETVAL = owl_new_av(&l, (SV*(*)(const void*))owl_new_sv); -
tester.c
re56303f rf25df21 248 248 249 249 FAIL_UNLESS("get_size", 3==owl_dict_get_size(&d)); 250 owl_list_create(&l); 250 251 FAIL_UNLESS("get_keys", 0==owl_dict_get_keys(&d, &l)); 251 252 FAIL_UNLESS("get_keys result size", 3==owl_list_get_size(&l)); -
variable.c
r010a951 rf25df21 632 632 } 633 633 634 /* free the list with owl_variable_dict_namelist_cleanup */635 634 void owl_variable_dict_get_names(const owl_vardict *d, owl_list *l) { 636 635 owl_dict_get_keys(d, l); 637 }638 639 void owl_variable_dict_namelist_cleanup(owl_list *l)640 {641 owl_list_cleanup(l, g_free);642 636 } 643 637
Note: See TracChangeset
for help on using the changeset viewer.