3 * More client-side support functions.
4 * Unlike routines.c, some of these DO use global variables.
11 #include <sys/types.h>
19 #if TIME_WITH_SYS_TIME
20 # include <sys/time.h>
24 # include <sys/time.h>
36 #include "citadel_decls.h"
37 #include "routines2.h"
46 #include "client_crypto.h"
49 extern char tempdir[];
50 extern char *axdefs[7];
51 extern long highest_msg_read;
52 extern long maxmsgnum;
53 extern unsigned room_flags;
54 extern int screenwidth;
57 int eopen(char *name, int mode)
60 ret = open(name, mode);
62 err_printf("Cannot open file '%s', mode=%d, errno=%d\n",
70 int room_prompt(int qrflags)
71 { /* return proper room prompt character */
74 if (qrflags & QR_DIRECTORY)
76 if ((a == ']') && (qrflags & QR_NETWORK))
78 if ((a == '>') && (qrflags & QR_NETWORK))
84 { /* register with name and address */
104 strcpy(tmpstate, "");
106 strcpy(tmpphone, "");
107 strcpy(tmpemail, "");
108 strcpy(tmpcountry, "");
110 serv_puts("GREG _SELF_");
114 while (serv_gets(buf), strcmp(buf, "000")) {
116 strcpy(tmpname, buf);
118 strcpy(tmpaddr, buf);
120 strcpy(tmpcity, buf);
122 strcpy(tmpstate, buf);
126 strcpy(tmpphone, buf);
128 strcpy(tmpemail, buf);
130 strcpy(tmpcountry, buf);
134 strprompt("REAL name", tmpname, 29);
135 strprompt("Address", tmpaddr, 24);
136 strprompt("City/town", tmpcity, 14);
137 strprompt("State/province", tmpstate, 2);
138 strprompt("ZIP/Postal Code", tmpzip, 10);
139 strprompt("Country", tmpcountry, 31);
140 strprompt("Telephone number", tmpphone, 14);
144 strcpy(holdemail, tmpemail);
145 strprompt("Email address", tmpemail, 31);
146 snprintf(buf, sizeof buf, "QDIR %s", tmpemail);
150 extract_token(diruser, &buf[4], 0, '@');
151 extract_token(dirnode, &buf[4], 1, '@');
154 if ((strcasecmp(diruser, fullname))
155 || (strcasecmp(dirnode, serv_info.serv_nodename))) {
157 "\nYou can't use %s as your address.\n",
160 "It is already in use by %s @ %s.\n",
163 strcpy(tmpemail, holdemail);
168 /* now send the registration info back to the server */
172 scr_printf("%s\n", &buf[4]);
182 serv_puts(tmpcountry);
188 { /* make all messages old in current room */
191 if (rc_alt_semantics) {
192 if (maxmsgnum == highest_msg_read == 0) {
193 /* err_printf("maxmsgnum == highest_msg_read == 0\n"); */
196 snprintf(buf, sizeof(buf), "SLRP %ld",
197 (maxmsgnum > highest_msg_read) ?
198 maxmsgnum : highest_msg_read);
201 serv_puts("SLRP HIGHEST");
205 scr_printf("%s\n", &buf[4]);
209 * only make messages old in this room that have been read
215 snprintf(buf, sizeof buf, "SLRP %ld", highest_msg_read);
219 scr_printf("%s\n", &buf[4]);
224 * This routine completes a client upload
226 void do_upload(int fd)
230 long transmitted_bytes, total_bytes;
234 /* learn the size of the file */
235 total_bytes = lseek(fd, 0L, 2);
238 transmitted_bytes = 0L;
239 progress(transmitted_bytes, total_bytes);
241 bytes_to_send = read(fd, tbuf, 4096);
242 if (bytes_to_send > 0) {
243 snprintf(buf, sizeof buf, "WRIT %d", bytes_to_send);
247 bytes_expected = atoi(&buf[4]);
248 serv_write(tbuf, bytes_expected);
250 scr_printf("%s\n", &buf[4]);
253 transmitted_bytes = transmitted_bytes + (long) bytes_to_send;
254 progress(transmitted_bytes, total_bytes);
255 } while (bytes_to_send > 0);
257 /* close the upload file, locally and at the server */
261 scr_printf("%s\n", &buf[4]);
266 * client-based uploads (for users with their own clientware)
268 void cli_upload(void)
277 if ((room_flags & QR_UPLOAD) == 0) {
278 scr_printf("*** You cannot upload to this room.\n");
281 newprompt("File to be uploaded: ", flnm, 55);
282 fd = open(flnm, O_RDONLY);
284 scr_printf("Cannot open '%s': %s\n", flnm, strerror(errno));
287 scr_printf("Enter a description of this file:\n");
288 newprompt(": ", desc, 75);
290 /* keep generating filenames in hope of finding a unique one */
294 return; /* fail if tried 10 times */
296 while ((strlen(buf) > 0) && (haschar(buf, '/')))
297 strcpy(buf, &buf[1]);
299 size_t tmp = strlen(buf);
300 snprintf(&buf[tmp], sizeof buf - tmp, "%d", a);
302 snprintf(tbuf, sizeof tbuf, "UOPN %s|%s", buf, desc);
306 scr_printf("%s\n", &buf[4]);
308 } while (buf[0] != '2');
310 /* at this point we have an open upload file at the server */
316 * Function used for various image upload commands
318 void cli_image_upload(char *keyname)
324 snprintf(buf, sizeof buf, "UIMG 0|%s", keyname);
328 scr_printf("%s\n", &buf[4]);
331 newprompt("Image file to be uploaded: ", flnm, 55);
332 fd = open(flnm, O_RDONLY);
334 scr_printf("Cannot open '%s': %s\n", flnm, strerror(errno));
337 snprintf(buf, sizeof buf, "UIMG 1|%s", keyname);
341 scr_printf("%s\n", &buf[4]);
349 * protocol-based uploads (Xmodem, Ymodem, Zmodem)
352 { /* c = upload mode */
362 if ((room_flags & QR_UPLOAD) == 0) {
363 scr_printf("*** You cannot upload to this room.\n");
366 /* we don't need a filename when receiving batch y/z modem */
367 if ((c == 2) || (c == 3))
370 newprompt("Enter filename: ", flnm, 15);
372 for (a = 0; a < strlen(flnm); ++a)
373 if ((flnm[a] == '/') || (flnm[a] == '\\') || (flnm[a] == '>')
374 || (flnm[a] == '?') || (flnm[a] == '*')
375 || (flnm[a] == ';') || (flnm[a] == '&'))
378 newprompt("Enter a short description of the file:\n: ", desc, 150);
380 /* create a temporary directory... */
381 if (mkdir(tempdir, 0700) != 0) {
382 scr_printf("*** Could not create temporary directory %s: %s\n",
383 tempdir, strerror(errno));
386 /* now do the transfer ... in a separate process */
393 scr_printf("Receiving %s - press Ctrl-D to end.\n", flnm);
394 fp = fopen(flnm, "w");
410 execlp("rx", "rx", flnm, NULL);
415 execlp("rb", "rb", NULL);
420 execlp("rz", "rz", NULL);
426 } while ((b != xfer_pid) && (b != (-1)));
431 scr_printf("\r*** Transfer unsuccessful.\n");
435 scr_printf("\r*** Transfer successful. Sending file(s) to server...\n");
436 snprintf(buf, sizeof buf, "cd %s; ls", tempdir);
437 lsfp = popen(buf, "r");
439 while (fgets(flnm, sizeof flnm, lsfp) != NULL) {
440 flnm[strlen(flnm) - 1] = 0;
441 snprintf(buf, sizeof buf, "%s/%s", tempdir, flnm);
442 fd = open(buf, O_RDONLY);
446 snprintf(buf, sizeof buf, "UOPN %s|%s", flnm, desc);
448 size_t tmp = strlen(buf);
456 } while ((buf[0] != '2') && (a < 100));
459 a = read(fd, tbuf, 4096);
461 snprintf(buf, sizeof buf, "WRIT %d", a);
471 scr_printf("%s\n", &buf[4]);
482 void val_user(char *user, int do_validate)
489 snprintf(cmd, sizeof cmd, "GREG %s", user);
498 scr_printf("User #%s - %s ", buf, &cmd[4]);
500 scr_printf("PW: %s\n", buf);
502 scr_printf("%s\n", buf);
504 scr_printf("%s\n", buf);
506 scr_printf("%s, ", buf);
508 scr_printf("%s ", buf);
510 scr_printf("%s\n", buf);
512 scr_printf("%s\n", buf);
516 scr_printf("%s\n", buf);
518 scr_printf("%s\n", buf);
519 } while (strcmp(buf, "000"));
520 scr_printf("Current access level: %d (%s)\n", ax, axdefs[ax]);
522 scr_printf("%-30s\n%s\n", user, &cmd[4]);
526 /* now set the access level */
527 ax = intprompt("Access level", ax, 0, 6);
528 snprintf(cmd, sizeof cmd, "VALI %s|%d", user, ax);
532 scr_printf("%s\n", &cmd[4]);
539 { /* validate new users */
550 scr_printf("%s\n", &cmd[4]);
552 extract(buf, cmd, 0);
553 val_user(&buf[4], 1);
555 } while (finished == 0);
565 signal(SIGINT, SIG_DFL);
566 signal(SIGQUIT, SIG_DFL);
567 execlp(getenv("SHELL"), getenv("SHELL"), NULL);
568 err_printf("Could not open a shell: %s\n", strerror(errno));
573 } while ((a != b) && (a != (-1)));
579 * <.A>ide <F>ile <D>elete command
581 void deletefile(void)
586 newprompt("Filename: ", filename, 31);
587 if (strlen(filename) == 0)
589 snprintf(cmd, sizeof cmd, "DELF %s", filename);
592 err_printf("%s\n", &cmd[4]);
596 * <.A>ide <F>ile <S>end command
598 void netsendfile(void)
600 char filename[32], destsys[20], cmd[SIZ];
602 newprompt("Filename: ", filename, 31);
603 if (strlen(filename) == 0)
605 newprompt("System to send to: ", destsys, 19);
606 snprintf(cmd, sizeof cmd, "NETF %s|%s", filename, destsys);
609 err_printf("%s\n", &cmd[4]);
614 * <.A>ide <F>ile <M>ove command
619 char newroom[ROOMNAMELEN];
622 newprompt("Filename: ", filename, 63);
623 if (strlen(filename) == 0)
625 newprompt("Enter target room: ", newroom, ROOMNAMELEN - 1);
627 snprintf(cmd, sizeof cmd, "MOVF %s|%s", filename, newroom);
630 err_printf("%s\n", &cmd[4]);
635 * list of users who have filled out a bio
645 pprintf("%s\n", &buf[4]);
648 while (serv_gets(buf), strcmp(buf, "000")) {
649 if ((pos + strlen(buf) + 5) > screenwidth) {
653 pprintf("%s, ", buf);
654 pos = pos + strlen(buf) + 2;
656 pprintf("%c%c \n\n", 8, 8);
669 newprompt("Read bio for who ('?' for list) : ", who, 25);
671 if (!strcmp(who, "?"))
673 } while (!strcmp(who, "?"));
674 snprintf(buf, sizeof buf, "RBIO %s", who);
678 pprintf("%s\n", &buf[4]);
681 while (serv_gets(buf), strcmp(buf, "000")) {
682 pprintf("%s\n", buf);
688 * General system configuration command
690 void do_system_configuration(void)
695 int expire_value = 0;
699 /* Clear out the config buffers */
700 memset(&sc[0][0], 0, sizeof(sc));
702 /* Fetch the current config */
703 serv_puts("CONF get");
707 while (serv_gets(buf), strcmp(buf, "000")) {
709 strcpy(&sc[a][0], buf);
714 /* Fetch the expire policy (this will silently fail on old servers,
715 * resulting in "default" policy)
717 serv_puts("GPEX site");
720 expire_mode = extract_int(&buf[4], 0);
721 expire_value = extract_int(&buf[4], 1);
725 /* Identification parameters */
727 strprompt("Node name", &sc[0][0], 15);
728 strprompt("Fully qualified domain name", &sc[1][0], 63);
729 strprompt("Human readable node name", &sc[2][0], 20);
730 strprompt("Modem dialup number", &sc[3][0], 15);
731 strprompt("Geographic location of this system", &sc[12][0], 31);
732 strprompt("Name of system administrator", &sc[13][0], 25);
733 strprompt("Paginator prompt", &sc[10][0], 79);
735 /* this prompt is commented out until we finish the moderation system
736 strprompt("Default moderation filter for new users", &sc[25][0], 4);
739 /* Security parameters */
741 snprintf(sc[7], sizeof sc[7], "%d", (boolprompt(
742 "Require registration for new users",
744 snprintf(sc[29], sizeof sc[29], "%d", (boolprompt(
745 "Disable self-service user account creation",
747 strprompt("Initial access level for new users", &sc[6][0], 1);
748 strprompt("Access level required to create rooms", &sc[19][0], 1);
749 snprintf(sc[4], sizeof sc[4], "%d", (boolprompt(
750 "Automatically give room aide privs to a user who creates a private room",
753 snprintf(sc[8], sizeof sc[8], "%d", (boolprompt(
754 "Automatically move problem user messages to twit room",
757 strprompt("Name of twit room", &sc[9][0], ROOMNAMELEN);
758 snprintf(sc[11], sizeof sc[11], "%d", (boolprompt(
759 "Restrict Internet mail to only those with that privilege",
761 snprintf(sc[26], sizeof sc[26], "%d", (boolprompt(
762 "Allow Aides to Zap (forget) rooms",
765 if (strlen(&sc[18][0]) > 0) logpages = 1;
767 logpages = boolprompt("Log all pages", logpages);
769 strprompt("Name of logging room", &sc[18][0], ROOMNAMELEN);
778 strprompt("Server connection idle timeout (in seconds)", &sc[5][0], 4);
779 strprompt("Maximum concurrent sessions", &sc[14][0], 4);
780 strprompt("Maximum message length", &sc[20][0], 20);
781 strprompt("Minimum number of worker threads", &sc[21][0], 3);
782 strprompt("Maximum number of worker threads", &sc[22][0], 3);
784 /* no longer applicable ... deprecated
785 strprompt("Server-to-server networking password", &sc[15][0], 19);
788 strprompt("How often to run network jobs (in seconds)", &sc[28][0], 5);
789 strprompt("SMTP server port (-1 to disable)", &sc[24][0], 5);
790 strprompt("POP3 server port (-1 to disable)", &sc[23][0], 5);
791 strprompt("IMAP server port (-1 to disable)", &sc[27][0], 5);
793 /* Expiry settings */
794 strprompt("Default user purge time (days)", &sc[16][0], 5);
795 strprompt("Default room purge time (days)", &sc[17][0], 5);
797 /* Angels and demons dancing in my head... */
799 snprintf(buf, sizeof buf, "%d", expire_mode);
800 strprompt("System default message expire policy (? for list)",
804 "1. Never automatically expire messages\n"
805 "2. Expire by message count\n"
806 "3. Expire by message age\n");
808 } while ((buf[0] < 49) || (buf[0] > 51));
809 expire_mode = buf[0] - 48;
811 /* ...lunatics and monsters underneath my bed */
812 if (expire_mode == 2) {
813 snprintf(buf, sizeof buf, "%d", expire_value);
814 strprompt("Keep how many messages online?", buf, 10);
815 expire_value = atol(buf);
817 if (expire_mode == 3) {
818 snprintf(buf, sizeof buf, "%d", expire_value);
819 strprompt("Keep messages for how many days?", buf, 10);
820 expire_value = atol(buf);
823 scr_printf("Save this configuration? ");
825 serv_puts("CONF set");
828 for (a = 0; a < 30; ++a)
829 serv_puts(&sc[a][0]);
832 snprintf(buf, sizeof buf, "SPEX site|%d|%d",
833 expire_mode, expire_value);
841 * support function for do_internet_configuration()
843 void get_inet_rec_type(char *buf) {
846 keyopt(" <1> localhost (Alias for this computer)\n");
847 keyopt(" <2> gateway domain (Domain for all Citadel systems)\n");
848 keyopt(" <3> smart-host (Forward all outbound mail to this host)\n");
849 keyopt(" <4> directory (Consult the Global Address Book)\n");
850 sel = intprompt("Which one", 1, 1, 4);
852 case 1: strcpy(buf, "localhost");
854 case 2: strcpy(buf, "gatewaydomain");
856 case 3: strcpy(buf, "smarthost");
858 case 4: strcpy(buf, "directory");
865 * Internet mail configuration
867 void do_internet_configuration(void) {
877 snprintf(buf, sizeof buf, "CONF getsys|%s", INTERNETCFG);
880 if (buf[0] == '1') while (serv_gets(buf), strcmp(buf, "000")) {
882 if (num_recs == 1) recs = malloc(sizeof(char *));
883 else recs = realloc(recs, (sizeof(char *)) * num_recs);
884 recs[num_recs-1] = malloc(SIZ);
885 strcpy(recs[num_recs-1], buf);
891 scr_printf("### Host or domain Record type \n");
893 scr_printf("--- -------------------------------------------------- --------------------\n");
894 for (i=0; i<num_recs; ++i) {
896 scr_printf("%3d ", i+1);
897 extract(buf, recs[i], 0);
899 scr_printf("%-50s ", buf);
900 extract(buf, recs[i], 1);
901 color(BRIGHT_MAGENTA);
902 scr_printf("%-20s\n", buf);
906 ch = keymenu("", "<A>dd|<D>elete|<S>ave|<Q>uit");
911 recs = malloc(sizeof(char *));
912 else recs = realloc(recs,
913 (sizeof(char *)) * num_recs);
914 newprompt("Enter host name: ",
917 get_inet_rec_type(&buf[strlen(buf)]);
918 recs[num_recs-1] = strdup(buf);
921 i = intprompt("Delete which one",
925 for (j=i; j<num_recs; ++j)
929 snprintf(buf, sizeof buf, "CONF putsys|%s",
934 for (i=0; i<num_recs; ++i) {
940 scr_printf("%s\n", &buf[4]);
945 quitting = boolprompt(
946 "Quit without saving", 0);
951 } while (quitting == 0);
954 for (i=0; i<num_recs; ++i) free(recs[i]);
962 * Edit network configuration for room sharing, mailing lists, etc.
964 void network_config_management(char *entrytype, char *comment) {
965 char filename[PATH_MAX];
966 char changefile[PATH_MAX];
977 if (strlen(editor_path) == 0) {
978 scr_printf("You must have an external editor configured in"
979 " order to use this function.\n");
983 snprintf(filename, sizeof filename, "%s.listedit", tmpnam(NULL));
984 snprintf(changefile, sizeof changefile, "%s.listedit", tmpnam(NULL));
986 tempfp = fopen(filename, "w");
987 if (tempfp == NULL) {
988 err_printf("Cannot open %s: %s\n", filename, strerror(errno));
992 fprintf(tempfp, "# Configuration for room: %s\n", room_name);
993 fprintf(tempfp, "# %s\n", comment);
994 fprintf(tempfp, "# Specify one per line.\n"
1000 while(serv_gets(buf), strcmp(buf, "000")) {
1001 extract(instr, buf, 0);
1002 if (!strcasecmp(instr, entrytype)) {
1003 extract(addr, buf, 1);
1004 fprintf(tempfp, "%s\n", addr);
1010 e_ex_code = 1; /* start with a failed exit code */
1011 editor_pid = fork();
1012 cksum = file_checksum(filename);
1013 if (editor_pid == 0) {
1014 chmod(filename, 0600);
1016 sttybbs(SB_RESTORE);
1017 putenv("WINDOW_TITLE=Network configuration");
1018 execlp(editor_path, editor_path, filename, NULL);
1021 if (editor_pid > 0) {
1024 b = ka_wait(&e_ex_code);
1025 } while ((b != editor_pid) && (b >= 0));
1031 if (file_checksum(filename) == cksum) {
1032 err_printf("*** Not saving changes.\n");
1036 if (e_ex_code == 0) { /* Save changes */
1037 changefp = fopen(changefile, "w");
1040 if (buf[0] == '1') {
1041 while(serv_gets(buf), strcmp(buf, "000")) {
1042 extract(instr, buf, 0);
1043 if (strcasecmp(instr, entrytype)) {
1044 fprintf(changefp, "%s\n", buf);
1048 tempfp = fopen(filename, "r");
1049 while (fgets(buf, sizeof buf, tempfp) != NULL) {
1050 for (i=0; i<strlen(buf); ++i) {
1051 if (buf[i] == '#') buf[i] = 0;
1054 if (strlen(buf) > 0) {
1055 fprintf(changefp, "%s|%s\n", entrytype, buf);
1061 /* now write it to the server... */
1064 if (buf[0] == '4') {
1065 changefp = fopen(changefile, "r");
1066 if (changefp != NULL) {
1067 while (fgets(buf, sizeof buf,
1068 changefp) != NULL) {
1069 buf[strlen(buf) - 1] = 0;
1078 unlink(filename); /* Delete the temporary files */
1084 * IGnet node configuration
1086 void do_ignet_configuration(void) {
1096 snprintf(buf, sizeof buf, "CONF getsys|%s", IGNETCFG);
1099 if (buf[0] == '1') while (serv_gets(buf), strcmp(buf, "000")) {
1101 if (num_recs == 1) recs = malloc(sizeof(char *));
1102 else recs = realloc(recs, (sizeof(char *)) * num_recs);
1103 recs[num_recs-1] = malloc(SIZ);
1104 strcpy(recs[num_recs-1], buf);
1109 color(BRIGHT_WHITE);
1118 "------------------ "
1119 "-------------------------------- "
1121 for (i=0; i<num_recs; ++i) {
1123 scr_printf("%3d ", i+1);
1124 extract(buf, recs[i], 0);
1126 scr_printf("%-16s ", buf);
1127 extract(buf, recs[i], 1);
1128 color(BRIGHT_MAGENTA);
1129 scr_printf("%-18s ", buf);
1130 extract(buf, recs[i], 2);
1132 scr_printf("%-32s ", buf);
1133 extract(buf, recs[i], 3);
1134 color(BRIGHT_MAGENTA);
1135 scr_printf("%-3s\n", buf);
1139 ch = keymenu("", "<A>dd|<D>elete|<S>ave|<Q>uit");
1144 recs = malloc(sizeof(char *));
1145 else recs = realloc(recs,
1146 (sizeof(char *)) * num_recs);
1147 newprompt("Enter node name : ", buf, 16);
1149 newprompt("Enter shared secret: ",
1150 &buf[strlen(buf)], 18);
1152 newprompt("Enter host or IP : ",
1153 &buf[strlen(buf)], 32);
1154 strcat(buf, "|504");
1155 strprompt("Enter port number : ",
1156 &buf[strlen(buf)-3], 5);
1157 recs[num_recs-1] = strdup(buf);
1160 i = intprompt("Delete which one",
1161 1, 1, num_recs) - 1;
1164 for (j=i; j<num_recs; ++j)
1165 recs[j] = recs[j+1];
1168 snprintf(buf, sizeof buf, "CONF putsys|%s", IGNETCFG);
1171 if (buf[0] == '4') {
1172 for (i=0; i<num_recs; ++i) {
1178 scr_printf("%s\n", &buf[4]);
1183 quitting = boolprompt(
1184 "Quit without saving", 0);
1189 } while (quitting == 0);
1192 for (i=0; i<num_recs; ++i) free(recs[i]);
1198 * Filter list configuration
1200 void do_filterlist_configuration(void) {
1210 snprintf(buf, sizeof buf, "CONF getsys|%s", FILTERLIST);
1213 if (buf[0] == '1') while (serv_gets(buf), strcmp(buf, "000")) {
1215 if (num_recs == 1) recs = malloc(sizeof(char *));
1216 else recs = realloc(recs, (sizeof(char *)) * num_recs);
1217 recs[num_recs-1] = malloc(SIZ);
1218 strcpy(recs[num_recs-1], buf);
1223 color(BRIGHT_WHITE);
1231 "---------------------------- "
1232 "---------------------------- "
1235 for (i=0; i<num_recs; ++i) {
1237 scr_printf("%3d ", i+1);
1238 extract(buf, recs[i], 0);
1240 scr_printf("%-28s ", buf);
1241 extract(buf, recs[i], 1);
1242 color(BRIGHT_MAGENTA);
1243 scr_printf("%-28s ", buf);
1244 extract(buf, recs[i], 2);
1246 scr_printf("%-16s\n", buf);
1247 extract(buf, recs[i], 3);
1251 ch = keymenu("", "<A>dd|<D>elete|<S>ave|<Q>uit");
1256 recs = malloc(sizeof(char *));
1257 else recs = realloc(recs,
1258 (sizeof(char *)) * num_recs);
1259 newprompt("Enter user name: ", buf, 28);
1261 newprompt("Enter room name: ",
1262 &buf[strlen(buf)], 28);
1264 newprompt("Enter node name: ",
1265 &buf[strlen(buf)], 16);
1267 recs[num_recs-1] = strdup(buf);
1270 i = intprompt("Delete which one",
1271 1, 1, num_recs) - 1;
1274 for (j=i; j<num_recs; ++j)
1275 recs[j] = recs[j+1];
1278 snprintf(buf, sizeof buf, "CONF putsys|%s", FILTERLIST);
1281 if (buf[0] == '4') {
1282 for (i=0; i<num_recs; ++i) {
1288 scr_printf("%s\n", &buf[4]);
1293 quitting = boolprompt(
1294 "Quit without saving", 0);
1299 } while (quitting == 0);
1302 for (i=0; i<num_recs; ++i) free(recs[i]);