… | |
… | |
504 | * Start of misc. readable functions used by others functions in this file |
504 | * Start of misc. readable functions used by others functions in this file |
505 | * |
505 | * |
506 | *****************************************************************************/ |
506 | *****************************************************************************/ |
507 | |
507 | |
508 | static titlelist * |
508 | static titlelist * |
509 | get_empty_booklist (void) |
509 | get_empty_booklist () |
510 | { |
510 | { |
511 | titlelist *bl = new titlelist; |
511 | titlelist *bl = new titlelist; |
512 | |
512 | |
513 | bl->number = 0; |
513 | bl->number = 0; |
514 | bl->first_book = NULL; |
514 | bl->first_book = NULL; |
515 | bl->next = NULL; |
515 | bl->next = NULL; |
516 | return bl; |
516 | return bl; |
517 | } |
517 | } |
518 | |
518 | |
519 | static title * |
519 | static title * |
520 | get_empty_book (void) |
520 | get_empty_book () |
521 | { |
521 | { |
522 | title *t = new title; |
522 | title *t = new title; |
523 | |
523 | |
524 | t->name = NULL; |
524 | t->name = NULL; |
525 | t->archname = NULL; |
525 | t->archname = NULL; |
… | |
… | |
619 | /* init_book_archive() - if not called before, initialise the info list |
619 | /* init_book_archive() - if not called before, initialise the info list |
620 | * This reads in the bookarch file into memory. bookarch is the file |
620 | * This reads in the bookarch file into memory. bookarch is the file |
621 | * created and updated across multiple runs of the program. |
621 | * created and updated across multiple runs of the program. |
622 | */ |
622 | */ |
623 | static void |
623 | static void |
624 | init_book_archive (void) |
624 | init_book_archive () |
625 | { |
625 | { |
626 | FILE *fp; |
626 | FILE *fp; |
627 | int comp, nroftitle = 0; |
627 | int comp, nroftitle = 0; |
628 | char buf[MAX_BUF], fname[MAX_BUF], *cp; |
628 | char buf[MAX_BUF], fname[MAX_BUF], *cp; |
629 | title *book = NULL; |
629 | title *book = NULL; |
… | |
… | |
744 | * |
744 | * |
745 | * This is the function called by the main routine to initialise |
745 | * This is the function called by the main routine to initialise |
746 | * all the readable information. |
746 | * all the readable information. |
747 | */ |
747 | */ |
748 | void |
748 | void |
749 | init_readable (void) |
749 | init_readable () |
750 | { |
750 | { |
751 | static int did_this; |
751 | static int did_this; |
752 | |
752 | |
753 | if (did_this) |
753 | if (did_this) |
754 | return; |
754 | return; |
… | |
… | |
1801 | * Writeback routine for updating the bookarchive. |
1801 | * Writeback routine for updating the bookarchive. |
1802 | * |
1802 | * |
1803 | ****************************************************************************/ |
1803 | ****************************************************************************/ |
1804 | /* write_book_archive() - write out the updated book archive */ |
1804 | /* write_book_archive() - write out the updated book archive */ |
1805 | void |
1805 | void |
1806 | write_book_archive (void) |
1806 | write_book_archive () |
1807 | { |
1807 | { |
1808 | FILE *fp; |
1808 | FILE *fp; |
1809 | int index = 0; |
1809 | int index = 0; |
1810 | char fname[MAX_BUF]; |
1810 | char fname[MAX_BUF]; |
1811 | title *book = NULL; |
1811 | title *book = NULL; |