aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:28 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:28 -0700
commitf1f5aa00c46c3e25517abfdd5ab0c5be2c2cb0d1 (patch)
treebcc07a985c609c3ed4e17616cc42b8deecef4ba9 /com32
parent6186970871197b5e492c083d688fa68def38a478 (diff)
downloadsyslinux-f1f5aa00c46c3e25517abfdd5ab0c5be2c2cb0d1.tar.gz
syslinux-f1f5aa00c46c3e25517abfdd5ab0c5be2c2cb0d1.tar.xz
syslinux-f1f5aa00c46c3e25517abfdd5ab0c5be2c2cb0d1.zip
Run Nindent on com32/menu/printmsg.c
Automatically reformat com32/menu/printmsg.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32')
-rw-r--r--com32/menu/printmsg.c140
1 files changed, 70 insertions, 70 deletions
diff --git a/com32/menu/printmsg.c b/com32/menu/printmsg.c
index cef5508d..cfceac39 100644
--- a/com32/menu/printmsg.c
+++ b/com32/menu/printmsg.c
@@ -30,90 +30,90 @@
static int draw_message_file(const char *filename)
{
- FILE *f;
- int ch;
- enum msgname_state {
- st_init, /* Base state */
- st_si_1, /* <SI> digit 1 */
- st_si_2, /* <SI> digit 2 */
- st_skipline, /* Skip until NL */
- } state = st_init;
- int eof = 0;
- int attr = 0;
+ FILE *f;
+ int ch;
+ enum msgname_state {
+ st_init, /* Base state */
+ st_si_1, /* <SI> digit 1 */
+ st_si_2, /* <SI> digit 2 */
+ st_skipline, /* Skip until NL */
+ } state = st_init;
+ int eof = 0;
+ int attr = 0;
- f = fopen(filename, "r");
- if (!f)
- return -1;
+ f = fopen(filename, "r");
+ if (!f)
+ return -1;
- /* Clear screen, hide cursor, default attribute */
- printf("\033e\033%%@\033)0\033(B\3#%03d\033[?25l\033[2J\033[H",
- message_base_color+0x07);
+ /* Clear screen, hide cursor, default attribute */
+ printf("\033e\033%%@\033)0\033(B\3#%03d\033[?25l\033[2J\033[H",
+ message_base_color + 0x07);
- while (!eof && (ch = getc(f)) != EOF) {
- switch (state) {
- case st_init:
- switch (ch) {
- case '\f':
- fputs("\033[2J\033[H", stdout);
- break;
- case 15: /* SI */
- state = st_si_1;
- break;
- case 24:
- state = st_skipline;
- break;
- case 26:
- eof = 1;
- break;
- case '\a':
- case '\n':
- case '\r':
- putchar(ch);
- break;
- default:
- if (ch >= 32)
- putchar(ch);
- break;
- }
- break;
+ while (!eof && (ch = getc(f)) != EOF) {
+ switch (state) {
+ case st_init:
+ switch (ch) {
+ case '\f':
+ fputs("\033[2J\033[H", stdout);
+ break;
+ case 15: /* SI */
+ state = st_si_1;
+ break;
+ case 24:
+ state = st_skipline;
+ break;
+ case 26:
+ eof = 1;
+ break;
+ case '\a':
+ case '\n':
+ case '\r':
+ putchar(ch);
+ break;
+ default:
+ if (ch >= 32)
+ putchar(ch);
+ break;
+ }
+ break;
- case st_si_1:
- attr = hexval(ch) << 4;
- state = st_si_2;
- break;
+ case st_si_1:
+ attr = hexval(ch) << 4;
+ state = st_si_2;
+ break;
- case st_si_2:
- attr |= hexval(ch);
- printf("\3#%03d", attr+message_base_color);
- state = st_init;
- break;
+ case st_si_2:
+ attr |= hexval(ch);
+ printf("\3#%03d", attr + message_base_color);
+ state = st_init;
+ break;
- case st_skipline:
- if (ch == '\n')
- state = st_init;
- break;
+ case st_skipline:
+ if (ch == '\n')
+ state = st_init;
+ break;
+ }
}
- }
- fclose(f);
- return 0;
+ fclose(f);
+ return 0;
}
int show_message_file(const char *filename, const char *background)
{
- int rv = KEY_NONE;
- const char *old_background = NULL;
+ int rv = KEY_NONE;
+ const char *old_background = NULL;
- if (background) {
- old_background = current_background;
- set_background(background);
- }
+ if (background) {
+ old_background = current_background;
+ set_background(background);
+ }
- if ( !(rv = draw_message_file(filename)) )
- rv = mygetkey(0); /* Wait for keypress */
+ if (!(rv = draw_message_file(filename)))
+ rv = mygetkey(0); /* Wait for keypress */
- if (old_background)
- set_background(old_background);
+ if (old_background)
+ set_background(old_background);
- return rv;
+ return rv;
}