BT_SPLIT_NAMES(1) btparse BT_SPLIT_NAMES(1) (NAME) bt_split_names - BibTeX (SYNOPSIS) bt_stringlist * bt_split_list (char * string, char * delim, char * filename, int line, char * description); void bt_free_list (bt_stringlist *list); bt_name * bt_split_name (char * name, char * filename, int line, int name_num); void bt_free_name (bt_name * name); BibTeX --- --- ( ) . btparse : BibTeX BibTeX . : <<>> (first von last jr). : ( 'and' ) . bt_split_list() . bt_split_name() BibTeX . ( BibTeX --- .) bt_format_names . (FUNCTIONS) bt_split_list() bt_stringlist * bt_split_list (char * string, char * delim, char * filename, int line, char * description) "string" "delim" ( ) . BibTeX : o o (whitespace) o o "and" Candy and Apples AnD {Green Eggs and Ham} : "Candy" "Apples" "{Green Eggs and Ham}". --- "and" --- / . ("and and") NULL . and Joe Q. Blow and and Smith, Jr., John : "and Joe Q. Blow" "NULL" "Smith, Jr., John". ( : BibTeX .) "bt_stringlist" : typedef struct { char * string; int num_items; char ** items; } bt_stringlist; : . : "string" "string" bt_split_list() NUL . ( .) "string" bt_free_list() free() . "num_items" bt_split_list(). "items" "num_items" "string". "items[1]" . "string" NUL "items[i]" C . "filename" "line" "description" . "filename" "line" "description" ( ) . "name" "description" --- <> <> . bt_free_list() void bt_free_list (bt_stringlist *list) "bt_stringlist" bt_split_list() . bt_split_list() . bt_split_name() bt_name * bt_split_name (char * name, char * filename, int line, int name_num) BibTeX : first von last jr. . (!) (tokens) . van der Graaf, Horace Q. {Foo, Bar, and Sons} . . ( ) <> <> . <> : (last) (first) . `von' `last' . <> . `von' `von' `last' `first' . `last' . . <> . ( `jr' .) `jr' . BibTeX 'jr' : Henry Ford Jr. George Herbert Walker Bush III BibTeX bt_split_name() : "Jr." "III" . 'jr' : Henry {Ford Jr.} George Herbert Walker {Bush III} <<->> ("author-year"). btparse . "bt_name" : typedef struct { bt_stringlist * tokens; char ** parts[BT_MAX_NAMEPARTS]; int part_len[BT_MAX_NAMEPARTS]; } bt_name; . : "tokens" . "bt_stringlist" . "parts" . << >> "bt_namepart" . "parts[BTN_LAST]" "parts[BTN_LAST][1]" "char *" : 'last' "parts[BTN_LAST][1][0]" 'last' . "part_len" . 'first' ( "name" "bt_name *" bt_split_name() ): for (i = 0; i < name->part_len[BTN_FIRST]; i++) { printf ("token %d of first name: %s\n", i, name->parts[BTN_FIRST][i]); } bt_free_name() void bt_free_name (bt_name * name) "bt_name" bt_split_name() ( "bt_stringlist" "bt_name") . (SEE ALSO) btparse, bt_format_names (AUTHOR) Greg Ward btparse, version 0.91 2025-07-14 BT_SPLIT_NAMES(1)