tdel.c (1574) | tdel.c (8870) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Margo Seltzer. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 85 unchanged lines hidden (view full) --- 94 95/* 96 * enter key/data pair into the table 97 */ 98 if ((dbp->put)(dbp, &key, &item, R_NOOVERWRITE) != NULL) { 99 fprintf(stderr, "cannot enter: key %s\n", 100 item.data); 101 exit(1); | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Margo Seltzer. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 85 unchanged lines hidden (view full) --- 94 95/* 96 * enter key/data pair into the table 97 */ 98 if ((dbp->put)(dbp, &key, &item, R_NOOVERWRITE) != NULL) { 99 fprintf(stderr, "cannot enter: key %s\n", 100 item.data); 101 exit(1); |
102 } | 102 } |
103 } 104 105 if ( --argc ) { 106 fp = fopen ( argv[0], "r"); 107 i = 0; 108 while ( fgets(wp1, 8192, fp) && 109 fgets(wp2, 8192, fp) && 110 i++ < MAXWORDS) { 111 key.size = strlen(wp1); 112 stat = (dbp->del)(dbp, &key, 0); 113 if (stat) { 114 fprintf ( stderr, "Error retrieving %s\n", key.data ); 115 exit(1); | 103 } 104 105 if ( --argc ) { 106 fp = fopen ( argv[0], "r"); 107 i = 0; 108 while ( fgets(wp1, 8192, fp) && 109 fgets(wp2, 8192, fp) && 110 i++ < MAXWORDS) { 111 key.size = strlen(wp1); 112 stat = (dbp->del)(dbp, &key, 0); 113 if (stat) { 114 fprintf ( stderr, "Error retrieving %s\n", key.data ); 115 exit(1); |
116 } | 116 } |
117 } 118 fclose(fp); 119 } 120 (dbp->close)(dbp); 121 exit(0); 122} | 117 } 118 fclose(fp); 119 } 120 (dbp->close)(dbp); 121 exit(0); 122} |