#include <sys/wait.h>
#include <errno.h>
#include "citadel.h"
+#include "rooms.h"
#define IFEXPERT if (userflags&US_EXPERT)
#define IFNEXPERT if ((userflags&US_EXPERT)==0)
#define IFNAIDE if (axlevel<6)
-long finduser();
-void sttybbs();
-void extract();
-int extract_int();
-void hit_any_key();
-int yesno();
-int yesno_d();
-void strprompt();
-void newprompt();
-int struncmp();
-void dotgoto();
-long extract_long();
-void serv_read();
-void formout();
-int inkey();
-int fmout();
-void citedit();
-void progress();
-int pattern();
-int file_checksum();
-int nukedir();
-void color();
+long finduser(int file, char *name);
+void sttybbs(int cmd);
+void extract(char *dest, char *source, int parmnum);
+int extract_int(char *source, int parmnum);
+void hit_any_key(void);
+int yesno(void);
+int yesno_d(int d);
+void strprompt(char *prompt, char *str, int len);
+void newprompt(char *prompt, char *str, int len);
+int struncmp(char *lstr, char *rstr, int len);
+void dotgoto(char *towhere, int display_name);
+long extract_long(char *source, int parmnum);
+void serv_read(char *buf, int bytes);
+void formout(char *name);
+int inkey(void);
+int fmout(int width, FILE *fp, char pagin, int height, int starting_lp, char subst);
+void citedit(FILE *fp, long int base_pos);
+void progress(long int curr, long int cmax);
+int pattern(char *search, char *patn);
+int file_checksum(char *filename);
+int nukedir(char *dirname);
+void color(int colornum);
extern unsigned room_flags;
extern char room_name[];
extern char floorlist[128][256];
-void load_floorlist() {
+void load_floorlist(void) {
int a;
char buf[256];
}
}
-void listrms(variety)
-char *variety; {
+void listrms(char *variety)
+{
char buf[256];
char rmname[32];
int f,c;
}
-void list_other_floors() {
+void list_other_floors(void) {
int a,c;
c = 1;
* List known rooms. kn_floor_mode should be set to 0 for a 'flat' listing,
* 1 to list rooms on the current floor, or 1 to list rooms on all floors.
*/
-void knrooms(kn_floor_mode)
-int kn_floor_mode; {
+void knrooms(int kn_floor_mode)
+{
char buf[256];
int a;
}
-void listzrooms() { /* list public forgotten rooms */
+void listzrooms(void) { /* list public forgotten rooms */
color(3);
printf("\n Forgotten public rooms:\n");
listrms("LZRM");
}
-int set_room_attr(ibuf,prompt,sbit)
-int ibuf;
-char *prompt;
-unsigned sbit; {
+int set_room_attr(int ibuf, char *prompt, unsigned int sbit)
+{
int a;
printf("%s [%s]? ",prompt,((ibuf&sbit) ? "Yes":"No"));
* The supplied argument is the 'default' floor number.
* This function returns the selected floor number.
*/
-int select_floor(rfloor)
-int rfloor; {
+int select_floor(int rfloor)
+{
int a, newfloor;
char floorstr[256];
/*
* .<A>ide <E>dit room
*/
-void editthisroom() {
+void editthisroom(void) {
char rname[20];
char rpass[10];
char rdir[15];
/*
* un-goto the previous room
*/
-void ungoto() {
+void ungoto(void) {
char buf[256];
if (!strcmp(ugname,"")) return;
* download() - download a file or files. The argument passed to this
* function determines which protocol to use.
*/
-void download(proto)
-int proto; {
+void download(int proto)
+{
/*
- 0 = paginate, 1 = xmodem, 2 = raw, 3 = ymodem, 4 = zmodem, 5 = save
/*
* read directory of this room
*/
-void roomdir() {
+void roomdir(void) {
char flnm[256];
char flsz[32];
char comment[256];
/*
* add a user to a private room
*/
-void invite() {
+void invite(void) {
char aaa[31],bbb[256];
if ((room_flags & QR_PRIVATE)==0) {
/*
* kick a user out of a room
*/
-void kickout() {
+void kickout(void) {
char aaa[31],bbb[256];
if ((room_flags & QR_PRIVATE)==0) {
/*
* aide command: kill the current room
*/
-void killroom() {
+void killroom(void) {
char aaa[100];
serv_puts("KILL 0");
dotgoto("_BASEROOM_",0);
}
-void forget() { /* forget the current room */
+void forget(void) { /* forget the current room */
char cmd[256];
printf("Are you sure you want to forget this room? ");
/*
* create a new room
*/
-void entroom() {
+void entroom(void) {
char cmd[256];
char new_room_name[20];
int new_room_type;
-void readinfo() { /* read info file for current room */
+void readinfo(void) { /* read info file for current room */
char cmd[256];
sprintf(cmd,"RINF");
/*
* <W>ho knows room...
*/
-void whoknows() {
+void whoknows(void) {
char buf[256];
serv_puts("WHOK");
serv_gets(buf);
}
-void do_edit(desc,read_cmd,check_cmd,write_cmd)
-char *desc;
-char *read_cmd;
-char *check_cmd;
-char *write_cmd;
- {
+void do_edit(char *desc, char *read_cmd, char *check_cmd, char *write_cmd)
+{
FILE *fp;
char cmd[256];
int b,cksum,editor_exit;
}
-void enterinfo() { /* edit info file for current room */
+void enterinfo(void) { /* edit info file for current room */
do_edit("the Info file for this room","RINF","EINF 0","EINF 1");
}
-void enter_bio() {
+void enter_bio(void) {
char cmd[256];
sprintf(cmd,"RBIO %s",fullname);
do_edit("your Bio",cmd,"NOOP","EBIO");
/*
* create a new floor
*/
-void create_floor() {
+void create_floor(void) {
char buf[256];
char newfloorname[256];
/*
* edit the current floor
*/
-void edit_floor() {
+void edit_floor(void) {
char buf[256];
if (floorlist[(int)curr_floor][0]==0) load_floorlist();
/*
* kill the current floor
*/
-void kill_floor() {
+void kill_floor(void) {
int floornum_to_delete,a;
char buf[256];