*** /tmp/,RCSt1005702 Mon Aug 5 23:56:30 1991 --- do_mtg.c Sat Aug 3 03:20:30 1991 *************** *** 53,59 **** #ifdef EDSC_CACHE if (curr = search_cache_meetings(&nb)) { /* ! * The meeting isn't cached yet, lets refresh the cache * information because we don't know if it's up to date. */ dsc_get_mtg_info(&nb,&m_info,&code); --- 53,59 ---- #ifdef EDSC_CACHE if (curr = search_cache_meetings(&nb)) { /* ! * The meeting is already cached, but we'll refresh the cache * information because we don't know if it's up to date. */ dsc_get_mtg_info(&nb,&m_info,&code); *************** *** 67,72 **** --- 67,74 ---- return; } } + if (curr->m_info.last != m_info.last) + cache_it(&nb, curr->m_info.last); dsc_destroy_mtg_info(&curr->m_info); curr->m_info = m_info; curr->meeting_code = code; *** /tmp/,RCSt1005707 Mon Aug 5 23:56:43 1991 --- do_trn.c Mon Aug 5 15:54:27 1991 *************** *** 15,20 **** --- 15,21 ---- #include #include #include + #include #include #include #include *************** *** 28,33 **** --- 29,41 ---- #endif #include "edsc.h" + /* + * Define POSIX-style macros for systems who don't have them. + */ + #ifndef S_ISREG + #define S_ISREG(m) ((m&S_IFMT) == S_IFREG) + #endif + do_gti(args) char *args; { *************** *** 190,195 **** --- 198,205 ---- int fd; char *plural; char line[255]; + #else + struct stat stat_buf; #endif int code; *************** *** 233,239 **** cache_pc = 0; cache_working = 1; tinfo = cache_current->t_info; ! (void) unlink(output_fn); if (link(cache_current->filename, output_fn)) { int fd, rfd, cc; char buf[8192]; --- 243,251 ---- cache_pc = 0; cache_working = 1; tinfo = cache_current->t_info; ! if ((!stat(output_fn, &stat_buf)) && ! S_ISREG(stat_buf.st_mode)) ! (void) unlink(output_fn); if (link(cache_current->filename, output_fn)) { int fd, rfd, cc; char buf[8192]; *************** *** 537,542 **** --- 549,557 ---- } close(fd); + #ifdef EDSC_CACHE + cache_itn(&nb, new_trn_num); + #endif punt: dsc_destroy_name_blk(&nb); } *************** *** 748,753 **** --- 763,772 ---- } dsc_set_trn_flags(&nb, trn_num, flags, &code); + + #ifdef EDSC_CACHE + cache_it(&nb, trn_num); + #endif dsc_destroy_name_blk(&nb); *************** *** 788,793 **** --- 807,816 ---- return; } dsc_retrieve_trn(&nb, trn_num, &code); + #ifdef EDSC_CACHE + if (!code) + cache_itn(&nb, trn_num); + #endif dsc_destroy_name_blk(&nb); if (code != 0) { printf(";%s\n", error_message(code)); *************** *** 828,833 **** --- 851,860 ---- } dsc_delete_trn(&nb, trn_num, &code); + #ifdef EDSC_CACHE + if (!code) + cache_itn(&nb, trn_num); + #endif dsc_destroy_name_blk(&nb); if (code != 0) { printf(";%s\n", error_message(code)); *** /tmp/,RCSt1005712 Mon Aug 5 23:56:51 1991 --- do_cache.c Mon Aug 5 14:28:39 1991 *************** *** 199,205 **** trn_nums trn_num; name_blk nb; int code; - struct cache_info *entry; /* First, we get the transaction number */ if (get_word(&cp, &trn_string, " ", &delim) < 0) { --- 199,204 ---- *************** *** 218,232 **** printf(";%s\n", error_message(code)); return; } ! if (entry = cache_search(&nb, trn_num)) { if (entry->flags & CACHE_FLG_INFO) dsc_destroy_trn_info3(&entry->t_info); - if (entry->flags & CACHE_FLG_TEXT) - unlink(entry->filename); entry->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); entry->info_code = entry->text_code = 0; } - printf("()\n"); } /* --- 217,238 ---- printf(";%s\n", error_message(code)); return; } ! cache_it(&nb, trn_num); ! printf("()\n"); ! } ! ! cache_it(nbp, trn_num) ! name_blk *nbp; ! trn_nums trn_num; ! { ! struct cache_info *entry; ! ! if (entry = cache_search(nbp, trn_num)) { if (entry->flags & CACHE_FLG_INFO) dsc_destroy_trn_info3(&entry->t_info); entry->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); entry->info_code = entry->text_code = 0; } } /* *************** *** 239,245 **** trn_nums trn_num; name_blk nb; int code; - struct cache_info *entry, *current; /* First, we get the transaction number */ if (get_word(&cp, &trn_string, " ", &delim) < 0) { --- 245,250 ---- *************** *** 258,322 **** printf(";%s\n", error_message(code)); return; } ! if (!(current = cache_search(&nb, trn_num))) { while (!current || !(current->flags & CACHE_FLG_INFO)) ! cache_transaction(&nb, trn_num, ¤t); } ! if (entry = cache_search(&nb, current->t_info.next)) { ! if (entry->flags & CACHE_FLG_INFO) ! dsc_destroy_trn_info3(&entry->t_info); ! if (entry->flags & CACHE_FLG_TEXT) ! unlink(entry->filename); ! entry->info_code = entry->text_code = 0; ! entry->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); ! } ! if (entry = cache_search(&nb, current->t_info.prev)) { ! if (entry->flags & CACHE_FLG_INFO) ! dsc_destroy_trn_info3(&entry->t_info); ! if (entry->flags & CACHE_FLG_TEXT) ! unlink(entry->filename); ! entry->info_code = entry->text_code = 0; ! entry->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); ! } ! if (entry = cache_search(&nb, current->t_info.nref)) { ! if (entry->flags & CACHE_FLG_INFO) ! dsc_destroy_trn_info3(&entry->t_info); ! if (entry->flags & CACHE_FLG_TEXT) ! unlink(entry->filename); ! entry->info_code = entry->text_code = 0; ! entry->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); ! } ! if (entry = cache_search(&nb, current->t_info.pref)) { ! if (entry->flags & CACHE_FLG_INFO) ! dsc_destroy_trn_info3(&entry->t_info); ! if (entry->flags & CACHE_FLG_TEXT) ! unlink(entry->filename); ! entry->info_code = entry->text_code = 0; ! entry->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); ! } ! if (entry = cache_search(&nb, current->t_info.fref)) { ! if (entry->flags & CACHE_FLG_INFO) ! dsc_destroy_trn_info3(&entry->t_info); ! if (entry->flags & CACHE_FLG_TEXT) ! unlink(entry->filename); ! entry->info_code = entry->text_code = 0; ! entry->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); ! } ! if (entry = cache_search(&nb, current->t_info.lref)) { ! if (entry->flags & CACHE_FLG_INFO) ! dsc_destroy_trn_info3(&entry->t_info); ! if (entry->flags & CACHE_FLG_TEXT) ! unlink(entry->filename); ! entry->info_code = entry->text_code = 0; ! entry->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); ! } if (current->flags & CACHE_FLG_INFO) dsc_destroy_trn_info3(¤t->t_info); - if (current->flags & CACHE_FLG_TEXT) - unlink(current->filename); current->info_code = current->text_code = 0; current->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); - printf("()\n"); } /* --- 263,293 ---- printf(";%s\n", error_message(code)); return; } ! cache_itn(&nb, trn_num); ! printf("()\n"); ! } ! ! cache_itn(nbp, trn_num) ! name_blk *nbp; ! trn_nums trn_num; ! { ! struct cache_info *current; ! ! ! if (!(current = cache_search(nbp, trn_num))) { while (!current || !(current->flags & CACHE_FLG_INFO)) ! cache_transaction(nbp, trn_num, ¤t); } ! cache_it(nbp, current->t_info.next); ! cache_it(nbp, current->t_info.prev); ! cache_it(nbp, current->t_info.nref); ! cache_it(nbp, current->t_info.pref); ! cache_it(nbp, current->t_info.fref); ! cache_it(nbp, current->t_info.lref); if (current->flags & CACHE_FLG_INFO) dsc_destroy_trn_info3(¤t->t_info); current->info_code = current->text_code = 0; current->flags &= ~(CACHE_FLG_INFO|CACHE_FLG_TEXT); } /* *************** *** 377,383 **** trn_nums trn_num; struct cache_info **trn_entry; { ! struct cache_info *entry; entry = cache_search(nbp, trn_num); #ifdef CACHE_DEBUG --- 348,356 ---- trn_nums trn_num; struct cache_info **trn_entry; { ! struct cache_info *entry, *link; ! trn_nums trn; ! cache_dir i; entry = cache_search(nbp, trn_num); #ifdef CACHE_DEBUG *************** *** 394,399 **** --- 367,381 ---- dsc_get_trn_info3(&entry->meeting->nb, entry->trn_num, &entry->t_info, &entry->info_code); entry->flags |= CACHE_FLG_INFO; + if (!entry->info_code) { + for (i=CACHE_DIR_NEXT; i <= CACHE_DIR_PREF; i++) { + if ((trn = move_trn(entry, i)) && + (link = cache_search(nbp, trn)) && + (link->flags & CACHE_FLG_INFO) && + (move_trn(link, ((i-1)^1)+1) != trn)) + cache_it(nbp, trn); + } + } return (entry->flags & CACHE_FLG_TEXT); } if (!(entry->flags & CACHE_FLG_TEXT)) { *************** *** 570,577 **** void free_cache_entry(entry) struct cache_info *entry; { ! if (entry->flags & CACHE_FLG_TEXT) unlink(entry->filename); if (entry->flags & CACHE_FLG_INFO) dsc_destroy_trn_info3(&entry->t_info); entry->flags = 0; --- 552,560 ---- void free_cache_entry(entry) struct cache_info *entry; { ! if (entry->filename[0]) unlink(entry->filename); + entry->filename[0]='\0'; if (entry->flags & CACHE_FLG_INFO) dsc_destroy_trn_info3(&entry->t_info); entry->flags = 0; *************** *** 690,696 **** name_blk *nbp; { struct cache_meeting *curr; - int code; for (curr=cache_meetings; curr; curr = curr->next) { if (!strcasecmp(nbp->hostname, curr->nb.hostname) && --- 673,678 ----