home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
391.lha
/
AmigaUser
/
src
/
auc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-07-06
|
3KB
|
109 lines
#include "include.h"
#include "extern.h"
auc()
{
int done = 0;
int choice = 0;
int i;
char str[256];
float search;
while(!done) {
printf("\nChoose one of the following\n");
printf(" 0) Exit 5) List Comments\n");
printf(" 1) List Entry 6) Search Entries for a Keynumber\n");
printf(" 2) List Names 7) List Keynumbers\n");
printf(" 3) List Email addresses 8) List ALL entries\n");
printf(" 4) List Systems\n");
printf("\nEnter choice :");
scanf("%s",str);
if(isanumber(str)) {
choice = atoi(str);
switch(choice) {
case 0 : done = 1;
break;
case 1 : printf("Enter Entry Number to list:");
scanf("%d",&choice);
if((choice < 0) || (choice > numentries-1)){
printf("There aren't that many entries!\n");
break;
}
curr = head;
for(i = 0;i < choice;i++) /* scan through the list till found */
curr = curr -> next;
printf("Entry %d\n", choice);
liststr("Name:",curr -> name);
liststr("Email:",curr -> email);
liststr("System:",curr -> system);
listint(curr);
liststr("Comment:",curr -> comment);
break;
case 2 : curr = head;
i = 0;
while(curr != NULL) {
sprintf(str,"%d. ",i++);
liststr(str,curr -> name);
curr = curr -> next;
}
break;
case 3 : curr = head;
i = 0;
while(curr != NULL) {
sprintf(str,"%d. ",i++);
liststr(str,curr -> email);
curr = curr -> next;
}
break;
case 4 : curr = head;
i = 0;
while(curr != NULL) {
sprintf(str,"%d. ",i++);
liststr(str,curr -> system);
curr = curr -> next;
}
break;
case 5 : curr = head;
i = 0;
while(curr != NULL) {
sprintf(str,"%d. ",i++);
liststr(str,curr -> comment);
curr = curr -> next;
}
break;
case 6 : printf("Enter Key Number to search for:");
scanf("%f",&search);
searchfor(search);
break;
case 7 : listkeys();
break;
case 8 : curr = head;
i = 0;
while(curr != NULL) {
printf("---------------------------------------------------------------------------\n");
printf("Entry %d\n", i++);
liststr("Name:",curr -> name);
liststr("Email:",curr -> email);
liststr("System:",curr -> system);
listint(curr);
liststr("Comment:",curr -> comment);
curr = curr -> next;
}
break;
default: break;
}
}
}
return(1);
}