just whitespace
This commit is contained in:
@@ -528,7 +528,7 @@ int main(int ac, char **av)
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
name = av[i];
|
||||
name = av[i];
|
||||
if (!name) {
|
||||
printf("%s: configuration file missing\n", av[0]);
|
||||
}
|
||||
|
@@ -264,7 +264,7 @@ struct menu *next_menu(struct menu *menu)
|
||||
break;
|
||||
}
|
||||
} while ((menu = menu->parent));
|
||||
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
@@ -824,7 +824,7 @@ bool expr_depends_symbol(struct expr *dep, struct symbol *sym)
|
||||
default:
|
||||
;
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
|
||||
|
@@ -2771,7 +2771,7 @@ YY_FATAL_ERROR( "flex scanner jammed" );
|
||||
*/
|
||||
static int yy_get_next_buffer (void)
|
||||
{
|
||||
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
|
||||
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
|
||||
register char *source = (yytext_ptr);
|
||||
register int number_to_move, i;
|
||||
int ret_val;
|
||||
@@ -3091,7 +3091,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
static void zconf_load_buffer_state (void)
|
||||
{
|
||||
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
|
||||
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
|
||||
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
|
||||
zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
|
||||
(yy_hold_char) = *(yy_c_buf_p);
|
||||
@@ -3180,7 +3180,7 @@ static void zconf_load_buffer_state (void)
|
||||
*/
|
||||
void zconf_flush_buffer (YY_BUFFER_STATE b )
|
||||
{
|
||||
if ( ! b )
|
||||
if ( ! b )
|
||||
return;
|
||||
|
||||
b->yy_n_chars = 0;
|
||||
@@ -3209,7 +3209,7 @@ static void zconf_load_buffer_state (void)
|
||||
*/
|
||||
void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
|
||||
{
|
||||
if (new_buffer == NULL)
|
||||
if (new_buffer == NULL)
|
||||
return;
|
||||
|
||||
zconfensure_buffer_stack();
|
||||
@@ -3239,7 +3239,7 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
|
||||
*/
|
||||
void zconfpop_buffer_state (void)
|
||||
{
|
||||
if (!YY_CURRENT_BUFFER)
|
||||
if (!YY_CURRENT_BUFFER)
|
||||
return;
|
||||
|
||||
zconf_delete_buffer(YY_CURRENT_BUFFER );
|
||||
@@ -3387,7 +3387,7 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * bytes, int len )
|
||||
|
||||
static void yy_fatal_error (yyconst char* msg )
|
||||
{
|
||||
(void) fprintf( stderr, "%s\n", msg );
|
||||
(void) fprintf( stderr, "%s\n", msg );
|
||||
exit( YY_EXIT_FAILURE );
|
||||
}
|
||||
|
||||
@@ -3514,7 +3514,7 @@ int zconflex_destroy (void)
|
||||
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
|
||||
{
|
||||
register int i;
|
||||
for ( i = 0; i < n; ++i )
|
||||
for ( i = 0; i < n; ++i )
|
||||
s1[i] = s2[i];
|
||||
}
|
||||
#endif
|
||||
@@ -3523,7 +3523,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
|
||||
static int yy_flex_strlen (yyconst char * s )
|
||||
{
|
||||
register int n;
|
||||
for ( n = 0; s[n]; ++n )
|
||||
for ( n = 0; s[n]; ++n )
|
||||
;
|
||||
|
||||
return n;
|
||||
|
@@ -52,8 +52,8 @@ print_item (WINDOW * win, const char *item, int status,
|
||||
wattrset (win, selected ? item_selected_attr : item_attr);
|
||||
waddstr (win, (char *)item+1);
|
||||
if (selected) {
|
||||
wmove (win, choice, check_x+1);
|
||||
wrefresh (win);
|
||||
wmove (win, choice, check_x+1);
|
||||
wrefresh (win);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ int
|
||||
dialog_checklist (const char *title, const char *prompt, int height, int width,
|
||||
int list_height, int item_no, struct dialog_list_item ** items,
|
||||
int flag)
|
||||
|
||||
|
||||
{
|
||||
int i, x, y, box_x, box_y;
|
||||
int key = 0, button = 0, choice = 0, scroll = 0, max_choice, *status;
|
||||
@@ -140,7 +140,7 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
|
||||
for (i = 0; i < item_no; i++) {
|
||||
status[i] = (items[i]->selected == 1); /* ON */
|
||||
if ((!choice && status[i]) || items[i]->selected == 2) /* SELECTED */
|
||||
choice = i + 1;
|
||||
choice = i + 1;
|
||||
}
|
||||
if (choice)
|
||||
choice--;
|
||||
@@ -197,7 +197,7 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
|
||||
|
||||
/* Find length of longest item in order to center checklist */
|
||||
check_x = 0;
|
||||
for (i = 0; i < item_no; i++)
|
||||
for (i = 0; i < item_no; i++)
|
||||
check_x = MAX (check_x, + strlen (items[i]->name) + 4);
|
||||
|
||||
check_x = (list_width - check_x) / 2;
|
||||
@@ -226,12 +226,12 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
|
||||
while (key != ESC) {
|
||||
key = wgetch (dialog);
|
||||
|
||||
for (i = 0; i < max_choice; i++)
|
||||
if (toupper(key) == toupper(items[scroll + i]->name[0]))
|
||||
break;
|
||||
for (i = 0; i < max_choice; i++)
|
||||
if (toupper(key) == toupper(items[scroll + i]->name[0]))
|
||||
break;
|
||||
|
||||
|
||||
if ( i < max_choice || key == KEY_UP || key == KEY_DOWN ||
|
||||
if ( i < max_choice || key == KEY_UP || key == KEY_DOWN ||
|
||||
key == '+' || key == '-' ) {
|
||||
if (key == KEY_UP || key == '-') {
|
||||
if (!choice) {
|
||||
@@ -251,7 +251,7 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
|
||||
status[scroll], 0, TRUE);
|
||||
wnoutrefresh (list);
|
||||
|
||||
print_arrows(dialog, choice, item_no, scroll,
|
||||
print_arrows(dialog, choice, item_no, scroll,
|
||||
box_y, box_x + check_x + 5, list_height);
|
||||
|
||||
wrefresh (dialog);
|
||||
@@ -279,7 +279,7 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
|
||||
max_choice - 1, TRUE);
|
||||
wnoutrefresh (list);
|
||||
|
||||
print_arrows(dialog, choice, item_no, scroll,
|
||||
print_arrows(dialog, choice, item_no, scroll,
|
||||
box_y, box_x + check_x + 5, list_height);
|
||||
|
||||
wrefresh (dialog);
|
||||
@@ -342,11 +342,11 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
|
||||
}
|
||||
wnoutrefresh (list);
|
||||
wrefresh (dialog);
|
||||
|
||||
|
||||
for (i = 0; i < item_no; i++) {
|
||||
items[i]->selected = status[i];
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
for (i = 0; i < item_no; i++)
|
||||
items[i]->selected = 0;
|
||||
items[scroll + choice]->selected = 1;
|
||||
@@ -364,7 +364,7 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
|
||||
/* Now, update everything... */
|
||||
doupdate ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
delwin (dialog);
|
||||
free (status);
|
||||
|
@@ -89,7 +89,7 @@
|
||||
#define ACS_DARROW 'v'
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
* Attribute names
|
||||
*/
|
||||
#define screen_attr attributes[0]
|
||||
@@ -165,7 +165,7 @@ int dialog_msgbox (const char *title, const char *prompt, int height,
|
||||
int width, int pause);
|
||||
int dialog_textbox (const char *title, const char *file, int height, int width);
|
||||
int dialog_menu (const char *title, const char *prompt, int height, int width,
|
||||
int menu_height, const char *choice, int item_no,
|
||||
int menu_height, const char *choice, int item_no,
|
||||
struct dialog_list_item ** items);
|
||||
int dialog_checklist (const char *title, const char *prompt, int height,
|
||||
int width, int list_height, int item_no,
|
||||
|
@@ -26,7 +26,7 @@
|
||||
*
|
||||
* *) A bugfix for the Page-Down problem
|
||||
*
|
||||
* *) Formerly when I used Page Down and Page Up, the cursor would be set
|
||||
* *) Formerly when I used Page Down and Page Up, the cursor would be set
|
||||
* to the first position in the menu box. Now lxdialog is a bit
|
||||
* smarter and works more like other menu systems (just have a look at
|
||||
* it).
|
||||
@@ -78,8 +78,8 @@ print_item (WINDOW * win, const char *item, int choice, int selected, int hotkey
|
||||
wmove (win, choice, 0);
|
||||
#if OLD_NCURSES
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < menu_width; i++)
|
||||
int i;
|
||||
for (i = 0; i < menu_width; i++)
|
||||
waddch (win, ' ');
|
||||
}
|
||||
#else
|
||||
@@ -88,8 +88,8 @@ print_item (WINDOW * win, const char *item, int choice, int selected, int hotkey
|
||||
wattrset (win, selected ? item_selected_attr : item_attr);
|
||||
mvwaddstr (win, choice, item_x, menu_item);
|
||||
if (hotkey) {
|
||||
wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
|
||||
mvwaddch(win, choice, item_x+j, menu_item[j]);
|
||||
wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
|
||||
mvwaddch(win, choice, item_x+j, menu_item[j]);
|
||||
}
|
||||
if (selected) {
|
||||
wmove (win, choice, item_x+1);
|
||||
@@ -225,7 +225,7 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
|
||||
|
||||
/*
|
||||
* Find length of longest item in order to center menu.
|
||||
* Set 'choice' to default item.
|
||||
* Set 'choice' to default item.
|
||||
*/
|
||||
item_x = 0;
|
||||
for (i = 0; i < item_no; i++) {
|
||||
@@ -261,7 +261,7 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
|
||||
/* Print the menu */
|
||||
for (i=0; i < max_choice; i++) {
|
||||
print_item (menu, items[first_item + i]->name, i, i == choice,
|
||||
(items[first_item + i]->tag[0] != ':'));
|
||||
(items[first_item + i]->tag[0] != ':'));
|
||||
}
|
||||
|
||||
wnoutrefresh (menu);
|
||||
@@ -281,107 +281,107 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
|
||||
if (strchr("ynmh", key))
|
||||
i = max_choice;
|
||||
else {
|
||||
for (i = choice+1; i < max_choice; i++) {
|
||||
for (i = choice+1; i < max_choice; i++) {
|
||||
j = first_alpha(items[scroll + i]->name, "YyNnMmHh");
|
||||
if (key == tolower(items[scroll + i]->name[j]))
|
||||
break;
|
||||
break;
|
||||
}
|
||||
if (i == max_choice)
|
||||
for (i = 0; i < max_choice; i++) {
|
||||
for (i = 0; i < max_choice; i++) {
|
||||
j = first_alpha(items[scroll + i]->name, "YyNnMmHh");
|
||||
if (key == tolower(items[scroll + i]->name[j]))
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < max_choice ||
|
||||
key == KEY_UP || key == KEY_DOWN ||
|
||||
key == '-' || key == '+' ||
|
||||
key == KEY_PPAGE || key == KEY_NPAGE) {
|
||||
if (i < max_choice ||
|
||||
key == KEY_UP || key == KEY_DOWN ||
|
||||
key == '-' || key == '+' ||
|
||||
key == KEY_PPAGE || key == KEY_NPAGE) {
|
||||
|
||||
print_item (menu, items[scroll + choice]->name, choice, FALSE,
|
||||
(items[scroll + choice]->tag[0] != ':'));
|
||||
print_item (menu, items[scroll + choice]->name, choice, FALSE,
|
||||
(items[scroll + choice]->tag[0] != ':'));
|
||||
|
||||
if (key == KEY_UP || key == '-') {
|
||||
if (choice < 2 && scroll) {
|
||||
if (choice < 2 && scroll) {
|
||||
/* Scroll menu down */
|
||||
scrollok (menu, TRUE);
|
||||
wscrl (menu, -1);
|
||||
scrollok (menu, FALSE);
|
||||
scrollok (menu, TRUE);
|
||||
wscrl (menu, -1);
|
||||
scrollok (menu, FALSE);
|
||||
|
||||
scroll--;
|
||||
scroll--;
|
||||
|
||||
print_item (menu, items[scroll]->name, 0, FALSE,
|
||||
(items[scroll]->tag[0] != ':'));
|
||||
print_item (menu, items[scroll]->name, 0, FALSE,
|
||||
(items[scroll]->tag[0] != ':'));
|
||||
} else
|
||||
choice = MAX(choice - 1, 0);
|
||||
|
||||
} else if (key == KEY_DOWN || key == '+') {
|
||||
|
||||
print_item (menu, items[scroll + choice]->name, choice, FALSE,
|
||||
(items[scroll + choice]->tag[0] != ':'));
|
||||
(items[scroll + choice]->tag[0] != ':'));
|
||||
|
||||
if ((choice > max_choice-3) &&
|
||||
(scroll + max_choice < item_no)
|
||||
) {
|
||||
if ((choice > max_choice-3) &&
|
||||
(scroll + max_choice < item_no)
|
||||
) {
|
||||
/* Scroll menu up */
|
||||
scrollok (menu, TRUE);
|
||||
scroll (menu);
|
||||
scrollok (menu, FALSE);
|
||||
scroll (menu);
|
||||
scrollok (menu, FALSE);
|
||||
|
||||
scroll++;
|
||||
scroll++;
|
||||
|
||||
print_item (menu, items[scroll + max_choice - 1]->name,
|
||||
max_choice-1, FALSE,
|
||||
(items[scroll + max_choice - 1]->tag[0] != ':'));
|
||||
} else
|
||||
choice = MIN(choice+1, max_choice-1);
|
||||
print_item (menu, items[scroll + max_choice - 1]->name,
|
||||
max_choice-1, FALSE,
|
||||
(items[scroll + max_choice - 1]->tag[0] != ':'));
|
||||
} else
|
||||
choice = MIN(choice+1, max_choice-1);
|
||||
|
||||
} else if (key == KEY_PPAGE) {
|
||||
scrollok (menu, TRUE);
|
||||
for (i=0; (i < max_choice); i++) {
|
||||
if (scroll > 0) {
|
||||
wscrl (menu, -1);
|
||||
scroll--;
|
||||
print_item (menu, items[scroll]->name, 0, FALSE,
|
||||
(items[scroll]->tag[0] != ':'));
|
||||
} else {
|
||||
if (choice > 0)
|
||||
choice--;
|
||||
}
|
||||
}
|
||||
scrollok (menu, FALSE);
|
||||
for (i=0; (i < max_choice); i++) {
|
||||
if (scroll > 0) {
|
||||
wscrl (menu, -1);
|
||||
scroll--;
|
||||
print_item (menu, items[scroll]->name, 0, FALSE,
|
||||
(items[scroll]->tag[0] != ':'));
|
||||
} else {
|
||||
if (choice > 0)
|
||||
choice--;
|
||||
}
|
||||
}
|
||||
scrollok (menu, FALSE);
|
||||
|
||||
} else if (key == KEY_NPAGE) {
|
||||
for (i=0; (i < max_choice); i++) {
|
||||
if (scroll+max_choice < item_no) {
|
||||
} else if (key == KEY_NPAGE) {
|
||||
for (i=0; (i < max_choice); i++) {
|
||||
if (scroll+max_choice < item_no) {
|
||||
scrollok (menu, TRUE);
|
||||
scroll(menu);
|
||||
scrollok (menu, FALSE);
|
||||
scroll++;
|
||||
print_item (menu, items[scroll + max_choice - 1]->name,
|
||||
scroll++;
|
||||
print_item (menu, items[scroll + max_choice - 1]->name,
|
||||
max_choice-1, FALSE,
|
||||
(items[scroll + max_choice - 1]->tag[0] != ':'));
|
||||
} else {
|
||||
if (choice+1 < max_choice)
|
||||
choice++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else
|
||||
choice = i;
|
||||
} else
|
||||
choice = i;
|
||||
|
||||
print_item (menu, items[scroll + choice]->name, choice, TRUE,
|
||||
(items[scroll + choice]->tag[0] != ':'));
|
||||
print_item (menu, items[scroll + choice]->name, choice, TRUE,
|
||||
(items[scroll + choice]->tag[0] != ':'));
|
||||
|
||||
print_arrows(dialog, item_no, scroll,
|
||||
box_y, box_x+item_x+1, menu_height);
|
||||
print_arrows(dialog, item_no, scroll,
|
||||
box_y, box_x+item_x+1, menu_height);
|
||||
|
||||
wnoutrefresh (dialog);
|
||||
wrefresh (menu);
|
||||
wnoutrefresh (dialog);
|
||||
wrefresh (menu);
|
||||
|
||||
continue; /* wait for another key press */
|
||||
}
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
case KEY_LEFT:
|
||||
@@ -405,15 +405,15 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
|
||||
fclose(f);
|
||||
}
|
||||
delwin (dialog);
|
||||
items[scroll + choice]->selected = 1;
|
||||
switch (key) {
|
||||
case 's': return 3;
|
||||
case 'y': return 3;
|
||||
case 'n': return 4;
|
||||
case 'm': return 5;
|
||||
case ' ': return 6;
|
||||
case '/': return 7;
|
||||
}
|
||||
items[scroll + choice]->selected = 1;
|
||||
switch (key) {
|
||||
case 's': return 3;
|
||||
case 'y': return 3;
|
||||
case 'n': return 4;
|
||||
case 'm': return 5;
|
||||
case ' ': return 6;
|
||||
case '/': return 7;
|
||||
}
|
||||
return 0;
|
||||
case 'h':
|
||||
case '?':
|
||||
|
@@ -73,7 +73,7 @@ dialog_msgbox (const char *title, const char *prompt, int height, int width,
|
||||
|
||||
wrefresh (dialog);
|
||||
while (key != ESC && key != '\n' && key != ' ' &&
|
||||
key != 'O' && key != 'o' && key != 'X' && key != 'x')
|
||||
key != 'O' && key != 'o' && key != 'X' && key != 'x')
|
||||
key = wgetch (dialog);
|
||||
} else {
|
||||
key = '\n';
|
||||
|
@@ -472,8 +472,8 @@ print_line (WINDOW * win, int row, int width)
|
||||
/* Clear 'residue' of previous line */
|
||||
#if OLD_NCURSES
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < width - x; i++)
|
||||
int i;
|
||||
for (i = 0; i < width - x; i++)
|
||||
waddch (win, ' ');
|
||||
}
|
||||
#else
|
||||
|
@@ -29,7 +29,7 @@ const char *backtitle = NULL;
|
||||
|
||||
const char *dialog_result;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Attribute values, default is for mono display
|
||||
*/
|
||||
chtype attributes[] =
|
||||
@@ -127,13 +127,13 @@ void dialog_clear (void)
|
||||
attr_clear (stdscr, LINES, COLS, screen_attr);
|
||||
/* Display background title if it exists ... - SLH */
|
||||
if (backtitle != NULL) {
|
||||
int i;
|
||||
int i;
|
||||
|
||||
wattrset (stdscr, screen_attr);
|
||||
mvwaddstr (stdscr, 0, 1, (char *)backtitle);
|
||||
wmove (stdscr, 1, 1);
|
||||
for (i = 1; i < COLS - 1; i++)
|
||||
waddch (stdscr, ACS_HLINE);
|
||||
wattrset (stdscr, screen_attr);
|
||||
mvwaddstr (stdscr, 0, 1, (char *)backtitle);
|
||||
wmove (stdscr, 1, 1);
|
||||
for (i = 1; i < COLS - 1; i++)
|
||||
waddch (stdscr, ACS_HLINE);
|
||||
}
|
||||
wnoutrefresh (stdscr);
|
||||
}
|
||||
@@ -204,7 +204,7 @@ print_autowrap (WINDOW * win, const char *prompt, int width, int y, int x)
|
||||
strcpy (tempstr, prompt);
|
||||
|
||||
prompt_len = strlen(tempstr);
|
||||
|
||||
|
||||
/*
|
||||
* Remove newlines
|
||||
*/
|
||||
@@ -350,7 +350,7 @@ first_alpha(const char *string, const char *exempt)
|
||||
if (strchr("<[(", c)) ++in_paren;
|
||||
if (strchr(">])", c) && in_paren > 0) --in_paren;
|
||||
|
||||
if ((! in_paren) && isalpha(c) &&
|
||||
if ((! in_paren) && isalpha(c) &&
|
||||
strchr(exempt, c) == 0)
|
||||
return i;
|
||||
}
|
||||
|
@@ -333,7 +333,7 @@ union yyalloc
|
||||
#define YYUNDEFTOK 2
|
||||
#define YYMAXUTOK 296
|
||||
|
||||
#define YYTRANSLATE(YYX) \
|
||||
#define YYTRANSLATE(YYX) \
|
||||
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||||
|
||||
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
||||
@@ -709,7 +709,7 @@ do \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
{ \
|
||||
yyerror ("syntax error: cannot back up");\
|
||||
YYERROR; \
|
||||
} \
|
||||
@@ -762,7 +762,7 @@ do { \
|
||||
if (yydebug) \
|
||||
{ \
|
||||
YYFPRINTF (stderr, "%s ", Title); \
|
||||
yysymprint (stderr, \
|
||||
yysymprint (stderr, \
|
||||
Token, Value); \
|
||||
YYFPRINTF (stderr, "\n"); \
|
||||
} \
|
||||
|
Reference in New Issue
Block a user