static int32_t adduser(Ceo__AddUser *in, Ceo__AddUserResponse *out, char *client) { int32_t chk_stat, status; char *prog; chk_stat = check_adduser(in, out, client); if (chk_stat) return chk_stat; if (in->type == CEO__ADD_USER__TYPE__MEMBER) { status = addmember(in, out); prog = "addmember"; } else if (in->type == CEO__ADD_USER__TYPE__CLUB_REP) { status = addmember(in, out); prog = "addclubrep"; } else if (in->type == CEO__ADD_USER__TYPE__CLUB) { status = addclub(in, out); prog = "addclub"; } else { fatal("unknown user type %d", in->type); } if (status) response_message(out, 0, "there were failures, please contact systems committee"); adduser_spam(in, out, client, prog, status); return status; }
void main() { int ch,ch1,ch2,ch3; fm=fopen("member.dat","a+"); ft=fopen("trans.dat","a+"); fb=fopen("book.dat","a+"); mainscr(); while(1) { bk: showmenu(mainmenu,5,10,35); ch=getchoice(mainmenu,"MBRHE",10,35,5); switch(ch) { case 1:bk1: showmenu(memmenu,4,10,35); ch1=getchoice(memmenu,"ARIB",10,35,4); switch(ch1) { case 1: addmember(); goto bk1; case 2: renewmem(); goto bk1; case 3: memdupid(); goto bk1; case 4: goto bk; } break; case 2:bk2: showmenu(bookmenu,4,10,35); ch2=getchoice(bookmenu,"AIRB",10,35,4); switch(ch2) { case 1: addbook(); goto bk2; case 2: issbook(); goto bk2; case 3: retbook(); goto bk2; case 4: goto bk; } break; case 3:bk3: showmenu(rptmenu,4,10,35); ch3=getchoice(rptmenu,"MBTB",10,35,4); switch(ch3) { case 1: allmem(); goto bk3; case 2: allbook();goto bk3; case 3: alltransac();goto bk3; case 4: goto bk; } break; case 4: showhelp(); break; case 5:fclose(ft); fclose(fm); fclose(fb); exit(); } } }