aboutsummaryrefslogtreecommitdiff
path: root/src/symtab.c
AgeCommit message (Collapse)AuthorFiles
2022-01-12Update copyright yearsSergey Poznyakoff1
2021-12-12Fix grecs_symtab_foreachSergey Poznyakoff1
If the enumerator function returned a non-0 value, this function would leave the symtab in inconsistent state. The bug was introduced with deferred operation support, in c2f02c56. * src/symtab.c (grecs_symtab_foreach): Break instead of returning from the loop.
2021-01-06Update copyright yearsSergey Poznyakoff1
2016-08-25symtabs: allow to modify the list during iteration over it.Sergey Poznyakoff1
* include/grecs/list.h (grecs_list_remove): New proto. * include/grecs/symtab.h (grecs_symtab_count_entries): Rename to grecs_symtab_count. * src/list.c (grecs_list_remove): New function. (grecs_list_remove_tail, grecs_list_clear) (grecs_list_locate,grecs_list_index): Treat NULL list as empty list. * src/symtab.c: Defer table modifications during iteration (symtab_defer_type): New enum. (grecs_symtab)<elcount,itr_level,defer_list>: New members. (symtab_defer_op): New static function. (grecs_symtab_remove): When called during iteration, add the entry to the defer_del deferment list, unless it is already in defer_add, in which case remove it from there. Update elcount. (grecs_symtab_lookup_or_install): Defer addition when iterating. Update elcount. (grecs_symtab_clear): Reset elcount to 0. (grecs_symtab_create): Initialize elcount. (grecs_symtab_foreach): Process deferred modifications.
2016-07-04Update copyright yearsSergey Poznyakoff1
2016-03-12Prevent NULL dereferencing when attempting to remove an unexistent symtab entry.Sergey Poznyakoff1
* src/symtab.c (grecs_symtab_remove): Return if no matching entry was found.
2015-12-31Case-insensitive hash functionSergey Poznyakoff1
* src/grecs.hin (grecs_hash_string_ci): New proto. * src/symtab.c (grecs_hash_string_ci): New function.
2015-12-17Update copyright yearsSergey Poznyakoff1
2015-12-16Shut useless compiler warningsSergey Poznyakoff1
2012-01-03Happy GNU YearSergey Poznyakoff1
2011-05-10Bugfixes.Sergey Poznyakoff1
* Makefile.am (gitid.h): Fix sed expression. * src/grecs.h (grecs_hash_string): New proto. * src/symtab.c (grecs_hash_string): New function.
2011-04-30Drop all dependencies from gnulib.Sergey Poznyakoff1
* gnulib.modules: Remove. * src/mem.c: New file. * src/symtab.c: New file. * src/Makefile.am (libgrecs_a_SOURCES): Add mem.c and symtab.c. (INCLUDES): Remove -Ignu * src/grecs-gram.y (grecs_vasprintf, grecs_asprintf): New functions. (grecs_warning, grecs_error): Use grecs_vasprintf. (string_to_signed, string_to_unsigned): Remove. (STRTONUM,STRxTONUM,GETUNUM,GETSNUM): New macros (from Mailutils). (grecs_string_convert): Use macros for numeric conversions. (grecs_prop_tab): Remove entries for uintmax_t and intmax_t. * src/grecs-lex.l: Drop dependency on obstack. (line_acc, string_list): New statics. (line_acc_free_entry,line_acc_add_string): new function (line_acc_add_char,list_acc_unescape_char): new function (line_add_unescape_last): new function (grecs_lex_begin,grecs_line_add, multiline_begin) (grecs_line_finish): Rewrite. * src/grecs.h (grecs_type_uintmax,grecs_type_intmax): Remove. (grecs_malloc_fun,grecs_realloc_fun,grecs_alloc_die_fun): New externs. (grecs_malloc,grecs_realloc,grecs_alloc_die,grecs_strdup) (grecs_list_clear,grecs_list_free) (grecs_vasprintf,grecs_asprintf): New protos. (grecs_symtab,grecs_syment): New structs. (grecs_symtab_enumerator_t): New type. (grecs_symtab_strerror,grecs_symtab_lookup_or_install) (grecs_symtab_clear,grecs_symtab_create) (grecs_symtab_create_default) (grecs_symtab_free,grecs_symtab_remove,grecs_symtab_replace) (grecs_symtab_enumerate,grecs_symtab_count_entries): New protos. * src/list.c (grecs_list_clear): New function. (grecs_list_free): Use grecs_list_clear. * src/preproc.c (linebufbase,linebufsize): New variables. (pp_getline): New function. (pp_line_stmt_size): Remove. (pp_line_stmt): Use grecs_asprintf to format data. (next_line,grecs_preproc_extrn_start): Use pp_getline. (source_lookup): Use grecs_symtab instead of hash. * src/text.c: Rewrite using grecs_symtab.

Return to:

Send suggestions and report system problems to the System administrator.