Fixed Big-endian menus

This commit is contained in:
Michiel Broek 2003-09-20 09:23:28 +00:00
parent 130d965e47
commit 8f886bc4fe
3 changed files with 38 additions and 33 deletions

View File

@ -35,7 +35,6 @@
#define Max_passlen 14 /* Define maximum passwd length */ #define Max_passlen 14 /* Define maximum passwd length */
/***************************************************************************** /*****************************************************************************
* *
* Global typedefs. * Global typedefs.
@ -842,12 +841,24 @@ struct menufile {
unsigned int xMaxSecurity; unsigned int xMaxSecurity;
char Password[15]; /* Menu Password */ char Password[15]; /* Menu Password */
char TypeDesc[30]; /* Menu Type Description */ char TypeDesc[30]; /* Menu Type Description */
#ifdef __i386__
unsigned AutoExec : 1; /* Auto Exec Menu Type */ unsigned AutoExec : 1; /* Auto Exec Menu Type */
unsigned NoDoorsys : 1; /* Suppress door.sys */ unsigned NoDoorsys : 1; /* Suppress door.sys */
unsigned Y2Kdoorsys : 1; /* Write Y2K style door.sys */ unsigned Y2Kdoorsys : 1; /* Write Y2K style door.sys */
unsigned Comport : 1; /* Vmodem comport mode */ unsigned Comport : 1; /* Vmodem comport mode */
unsigned NoSuid : 1; /* Execute door nosuid */ unsigned NoSuid : 1; /* Execute door nosuid */
unsigned NoPrompt : 1; /* No prompt after door */ unsigned NoPrompt : 1; /* No prompt after door */
#else
/* All bits swapped */
unsigned xxLE_Dummy1 : 1;
unsigned xxLE_Dummy2 : 1;
unsigned NoPrompt : 1; /* No prompt after door */
unsigned NoSuid : 1; /* Execute noduid */
unsigned Comport : 1; /* Vmodem comport mode */
unsigned Y2Kdoorsys : 1; /* Write Y2K style door.sys */
unsigned NoDoorsys : 1; /* Suppress door.sys */
unsigned AutoExec : 1; /* Auto Exec Menu Type */
#endif
long xCredit; long xCredit;
int HiForeGnd; /* High ForeGround color */ int HiForeGnd; /* High ForeGround color */
int HiBackGnd; /* High ForeGround color */ int HiBackGnd; /* High ForeGround color */

View File

@ -158,7 +158,7 @@ void menu()
while (fread(&menus, sizeof(menus), 1, pMenuFile) == 1) { while (fread(&menus, sizeof(menus), 1, pMenuFile) == 1) {
if ( Le_Access(exitinfo.Security, menus.MenuSecurity) && (UserAge >= le_int(menus.Age))){ if ( Le_Access(exitinfo.Security, menus.MenuSecurity) && (UserAge >= le_int(menus.Age))){
if ( menus.AutoExec ) { if (menus.AutoExec) {
DoMenu( le_int(menus.MenuType) ); DoMenu( le_int(menus.MenuType) );
} }
DisplayMenu( ); DisplayMenu( );

View File

@ -135,13 +135,19 @@ void Show_A_Menu(void)
S_COL(15,16, "Normal display color", le_int(menus.ForeGnd), le_int(menus.BackGnd)) S_COL(15,16, "Normal display color", le_int(menus.ForeGnd), le_int(menus.BackGnd))
S_COL(16,16, "Bright display color", le_int(menus.HiForeGnd), le_int(menus.HiBackGnd)) S_COL(16,16, "Bright display color", le_int(menus.HiForeGnd), le_int(menus.HiBackGnd))
set_color(WHITE, BLACK); set_color(WHITE, BLACK);
show_bool(17,16, le_int(menus.AutoExec)); Syslog('-', "AutoExec %d %d", menus.AutoExec, le_int(menus.AutoExec));
Syslog('-', "NoDoorSys %d %d", menus.NoDoorsys, le_int(menus.NoDoorsys));
Syslog('-', "Y2Kdoorsys %d %d", menus.Y2Kdoorsys, le_int(menus.Y2Kdoorsys));
Syslog('-', "Comport %d %d", menus.Comport, le_int(menus.Comport));
Syslog('-', "NoSuid %d %d", menus.NoSuid, le_int(menus.NoSuid));
Syslog('-', "NoPrompt %d %d", menus.NoPrompt, le_int(menus.NoPrompt));
show_bool(17,16, menus.AutoExec);
if (le_int(menus.MenuType) == 7) { if (le_int(menus.MenuType) == 7) {
show_bool(13,58, le_int(menus.NoDoorsys)); show_bool(13,58, menus.NoDoorsys);
show_bool(14,58, le_int(menus.Y2Kdoorsys)); show_bool(14,58, menus.Y2Kdoorsys);
show_bool(15,58, le_int(menus.Comport)); show_bool(15,58, menus.Comport);
show_bool(16,58, le_int(menus.NoSuid)); show_bool(16,58, menus.NoSuid);
show_bool(17,58, le_int(menus.NoPrompt)); show_bool(17,58, menus.NoPrompt);
} }
} }
@ -253,38 +259,26 @@ void Edit_A_Menu(void)
menus.HiBackGnd = le_int(bg); menus.HiBackGnd = le_int(bg);
Show_A_Menu(); Show_A_Menu();
break; break;
case 10:temp = le_int(menus.AutoExec); case 10:menus.AutoExec = edit_bool(17,16, menus.AutoExec, (char *)"Is this an ^Autoexecute^ menu item");
temp = edit_bool(17,16, temp, (char *)"Is this an ^Autoexecute^ menu item");
menus.AutoExec = le_int(temp);
break; break;
case 11:if (le_int(menus.MenuType) == 7) { case 11:if (le_int(menus.MenuType) == 7) {
temp = le_int(menus.NoDoorsys); menus.NoDoorsys = edit_bool(13,58, menus.NoDoorsys, (char *)"Suppress writing ^door.sys^ dropfile");
temp = edit_bool(13,58, temp, (char *)"Suppress writing ^door.sys^ dropfile");
menus.NoDoorsys = le_int(temp);
} }
break; break;
case 12:if (le_int(menus.MenuType) == 7) { case 12:if (le_int(menus.MenuType) == 7) {
temp = le_int(menus.Y2Kdoorsys); menus.Y2Kdoorsys = edit_bool(14,58, menus.Y2Kdoorsys, (char *)"Create ^door.sys^ with 4 digit yearnumbers");
temp = edit_bool(14,58, temp, (char *)"Create ^door.sys^ with 4 digit yearnumbers");
menus.Y2Kdoorsys = le_int(temp);
} }
break; break;
case 13:if (le_int(menus.MenuType) == 7) { case 13:if (le_int(menus.MenuType) == 7) {
temp = le_int(menus.Comport); menus.Comport = edit_bool(15,58, menus.Comport, (char *)"Write real ^COM port^ in door.sys for Vmodem patch");
temp = edit_bool(15,58, temp, (char *)"Write real ^COM port^ in door.sys for Vmodem patch");
menus.Comport = le_int(temp);
} }
break; break;
case 14:if (le_int(menus.MenuType) == 7) { case 14:if (le_int(menus.MenuType) == 7) {
temp = le_int(menus.NoSuid); menus.NoSuid = edit_bool(16,58, menus.NoSuid, (char *)"Run the door as ^real user (nosuid)^");
temp = edit_bool(16,58, temp, (char *)"Run the door as ^real user (nosuid)^");
menus.NoSuid = le_int(temp);
} }
break; break;
case 15:if (le_int(menus.MenuType) == 7) { case 15:if (le_int(menus.MenuType) == 7) {
temp = le_int(menus.NoPrompt); menus.NoPrompt = edit_bool(17,58, menus.NoPrompt, (char *)"^Don't display prompt^ when door is finished");
temp = edit_bool(17,58, temp, (char *)"^Don't display prompt^ when door is finished");
menus.NoPrompt = le_int(temp);
} }
break; break;
} }
@ -338,7 +332,7 @@ void EditMenu(char *Name)
if (menus.MenuKey[0] || menus.AutoExec) { if (menus.MenuKey[0] || menus.AutoExec) {
set_color(CYAN, BLACK); set_color(CYAN, BLACK);
mvprintw(y, 5, "%3d. ", o + i); mvprintw(y, 5, "%3d. ", o + i);
if (le_int(menus.AutoExec)) { if (menus.AutoExec) {
set_color(LIGHTRED, BLACK); set_color(LIGHTRED, BLACK);
mvprintw(y, 10, "a"); mvprintw(y, 10, "a");
set_color(CYAN, BLACK); set_color(CYAN, BLACK);
@ -602,7 +596,7 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page)
while (fread(&menus, sizeof(menus), 1, mn) == 1) { while (fread(&menus, sizeof(menus), 1, mn) == 1) {
if (menus.MenuKey[0]) if (menus.MenuKey[0])
fprintf(fp, " Menu select %s\n", menus.MenuKey); fprintf(fp, " Menu select %s\n", menus.MenuKey);
if (le_int(menus.AutoExec)) if (menus.AutoExec)
fprintf(fp, " Menu select Autoexec\n"); fprintf(fp, " Menu select Autoexec\n");
fprintf(fp, " Type %d %s\n", le_int(menus.MenuType), menus.TypeDesc); fprintf(fp, " Type %d %s\n", le_int(menus.MenuType), menus.TypeDesc);
fprintf(fp, " Opt. data %s\n", menus.OptionalData); fprintf(fp, " Opt. data %s\n", menus.OptionalData);
@ -615,11 +609,11 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Hi-colors %s on %s\n", fprintf(fp, " Hi-colors %s on %s\n",
get_color(le_int(menus.HiForeGnd)), get_color(le_int(menus.HiBackGnd))); get_color(le_int(menus.HiForeGnd)), get_color(le_int(menus.HiBackGnd)));
if (le_int(menus.MenuType) == 7) { if (le_int(menus.MenuType) == 7) {
fprintf(fp, " No door.sys %s\n", getboolean(le_int(menus.NoDoorsys))); fprintf(fp, " No door.sys %s\n", getboolean(menus.NoDoorsys));
fprintf(fp, " Y2K door.sys %s\n", getboolean(le_int(menus.Y2Kdoorsys))); fprintf(fp, " Y2K door.sys %s\n", getboolean(menus.Y2Kdoorsys));
fprintf(fp, " Use COM port %s\n", getboolean(le_int(menus.Comport))); fprintf(fp, " Use COM port %s\n", getboolean(menus.Comport));
fprintf(fp, " No setuid %s\n", getboolean(le_int(menus.NoSuid))); fprintf(fp, " No setuid %s\n", getboolean(menus.NoSuid));
fprintf(fp, " No Prompt %s\n", getboolean(le_int(menus.NoPrompt))); fprintf(fp, " No Prompt %s\n", getboolean(menus.NoPrompt));
} }
fprintf(fp, "\n\n"); fprintf(fp, "\n\n");
j++; j++;