-static void
-gen_field_opt_rep(const char *name)
-{
- static const name_attribute_pair nap[] =
- {
-#ifdef O_VISIBLE
- {"Visible", O_VISIBLE},
-#endif
-#ifdef O_ACTIVE
- {"Active", O_ACTIVE},
-#endif
-#ifdef O_PUBLIC
- {"Public", O_PUBLIC},
-#endif
-#ifdef O_EDIT
- {"Edit", O_EDIT},
-#endif
-#ifdef O_WRAP
- {"Wrap", O_WRAP},
-#endif
-#ifdef O_BLANK
- {"Blank", O_BLANK},
-#endif
-#ifdef O_AUTOSKIP
- {"Auto_Skip", O_AUTOSKIP},
-#endif
-#ifdef O_NULLOK
- {"Null_Ok", O_NULLOK},
-#endif
-#ifdef O_PASSOK
- {"Pass_Ok", O_PASSOK},
-#endif
-#ifdef O_STATIC
- {"Static", O_STATIC},
-#endif
- {(char *)0, 0}
- };
- gen_reps(nap, name, sizeof(int), 0);
-}
-
-/*
- * Generate a single key code constant definition.
- */
-static void
-keydef(const char *name, const char *old_name, int value, int mode)
-{
- if (mode == 0) /* Generate the new name */
- printf(" %-30s : constant Special_Key_Code := 8#%3o#;\n", name, value);
- else
- {
- const char *s = old_name;
- const char *t = name;
-
- /* generate the old name, but only if it doesn't conflict with the old
- * name (Ada95 isn't case sensitive!)
- */
- while (*s && *t && (toupper(UChar(*s++)) == toupper(UChar(*t++))));
- if (*s || *t)
- printf(" %-16s : Special_Key_Code renames %s;\n", old_name, name);
- }
-}
-
-/*
- * Generate constants for the key codes. When called with mode==0, a
- * complete list with nice constant names in proper casing style will
- * be generated. Otherwise a list of old (i.e. C-style) names will be
- * generated, given that the name wasn't already defined in the "nice"
- * list.
- */
-static void
-gen_keydefs(int mode)
-{
- char buf[16];
- char obuf[16];
- int i;
-
-#ifdef KEY_CODE_YES
- keydef("Key_Code_Yes", "KEY_CODE_YES", KEY_CODE_YES, mode);
-#endif
-#ifdef KEY_MIN
- keydef("Key_Min", "KEY_MIN", KEY_MIN, mode);
-#endif
-#ifdef KEY_BREAK
- keydef("Key_Break", "KEY_BREAK", KEY_BREAK, mode);
-#endif
-#ifdef KEY_DOWN
- keydef("Key_Cursor_Down", "KEY_DOWN", KEY_DOWN, mode);
-#endif
-#ifdef KEY_UP
- keydef("Key_Cursor_Up", "KEY_UP", KEY_UP, mode);
-#endif
-#ifdef KEY_LEFT
- keydef("Key_Cursor_Left", "KEY_LEFT", KEY_LEFT, mode);
-#endif
-#ifdef KEY_RIGHT
- keydef("Key_Cursor_Right", "KEY_RIGHT", KEY_RIGHT, mode);
-#endif
-#ifdef KEY_HOME
- keydef("Key_Home", "KEY_HOME", KEY_HOME, mode);
-#endif
-#ifdef KEY_BACKSPACE
- keydef("Key_Backspace", "KEY_BACKSPACE", KEY_BACKSPACE, mode);
-#endif
-#ifdef KEY_F0
- keydef("Key_F0", "KEY_F0", KEY_F0, mode);
-#endif
-#ifdef KEY_F
- for (i = 1; i <= 24; i++)
- {
- sprintf(buf, "Key_F%d", i);
- sprintf(obuf, "KEY_F%d", i);
- keydef(buf, obuf, KEY_F(i), mode);
- }
-#endif
-#ifdef KEY_DL
- keydef("Key_Delete_Line", "KEY_DL", KEY_DL, mode);
-#endif
-#ifdef KEY_IL
- keydef("Key_Insert_Line", "KEY_IL", KEY_IL, mode);
-#endif
-#ifdef KEY_DC
- keydef("Key_Delete_Char", "KEY_DC", KEY_DC, mode);
-#endif
-#ifdef KEY_IC
- keydef("Key_Insert_Char", "KEY_IC", KEY_IC, mode);
-#endif
-#ifdef KEY_EIC
- keydef("Key_Exit_Insert_Mode", "KEY_EIC", KEY_EIC, mode);
-#endif
-#ifdef KEY_CLEAR
- keydef("Key_Clear_Screen", "KEY_CLEAR", KEY_CLEAR, mode);
-#endif
-#ifdef KEY_EOS
- keydef("Key_Clear_End_Of_Screen", "KEY_EOS", KEY_EOS, mode);
-#endif
-#ifdef KEY_EOL
- keydef("Key_Clear_End_Of_Line", "KEY_EOL", KEY_EOL, mode);
-#endif
-#ifdef KEY_SF
- keydef("Key_Scroll_1_Forward", "KEY_SF", KEY_SF, mode);
-#endif
-#ifdef KEY_SR
- keydef("Key_Scroll_1_Backward", "KEY_SR", KEY_SR, mode);
-#endif
-#ifdef KEY_NPAGE
- keydef("Key_Next_Page", "KEY_NPAGE", KEY_NPAGE, mode);
-#endif
-#ifdef KEY_PPAGE
- keydef("Key_Previous_Page", "KEY_PPAGE", KEY_PPAGE, mode);
-#endif
-#ifdef KEY_STAB
- keydef("Key_Set_Tab", "KEY_STAB", KEY_STAB, mode);
-#endif
-#ifdef KEY_CTAB
- keydef("Key_Clear_Tab", "KEY_CTAB", KEY_CTAB, mode);
-#endif
-#ifdef KEY_CATAB
- keydef("Key_Clear_All_Tabs", "KEY_CATAB", KEY_CATAB, mode);
-#endif
-#ifdef KEY_ENTER
- keydef("Key_Enter_Or_Send", "KEY_ENTER", KEY_ENTER, mode);
-#endif
-#ifdef KEY_SRESET
- keydef("Key_Soft_Reset", "KEY_SRESET", KEY_SRESET, mode);
-#endif
-#ifdef KEY_RESET
- keydef("Key_Reset", "KEY_RESET", KEY_RESET, mode);
-#endif
-#ifdef KEY_PRINT
- keydef("Key_Print", "KEY_PRINT", KEY_PRINT, mode);
-#endif
-#ifdef KEY_LL
- keydef("Key_Bottom", "KEY_LL", KEY_LL, mode);
-#endif
-#ifdef KEY_A1
- keydef("Key_Upper_Left_Of_Keypad", "KEY_A1", KEY_A1, mode);
-#endif
-#ifdef KEY_A3
- keydef("Key_Upper_Right_Of_Keypad", "KEY_A3", KEY_A3, mode);
-#endif
-#ifdef KEY_B2
- keydef("Key_Center_Of_Keypad", "KEY_B2", KEY_B2, mode);
-#endif
-#ifdef KEY_C1
- keydef("Key_Lower_Left_Of_Keypad", "KEY_C1", KEY_C1, mode);
-#endif
-#ifdef KEY_C3
- keydef("Key_Lower_Right_Of_Keypad", "KEY_C3", KEY_C3, mode);
-#endif
-#ifdef KEY_BTAB
- keydef("Key_Back_Tab", "KEY_BTAB", KEY_BTAB, mode);
-#endif
-#ifdef KEY_BEG
- keydef("Key_Beginning", "KEY_BEG", KEY_BEG, mode);
-#endif
-#ifdef KEY_CANCEL
- keydef("Key_Cancel", "KEY_CANCEL", KEY_CANCEL, mode);
-#endif
-#ifdef KEY_CLOSE
- keydef("Key_Close", "KEY_CLOSE", KEY_CLOSE, mode);
-#endif
-#ifdef KEY_COMMAND
- keydef("Key_Command", "KEY_COMMAND", KEY_COMMAND, mode);
-#endif
-#ifdef KEY_COPY
- keydef("Key_Copy", "KEY_COPY", KEY_COPY, mode);
-#endif
-#ifdef KEY_CREATE
- keydef("Key_Create", "KEY_CREATE", KEY_CREATE, mode);
-#endif
-#ifdef KEY_END
- keydef("Key_End", "KEY_END", KEY_END, mode);
-#endif
-#ifdef KEY_EXIT
- keydef("Key_Exit", "KEY_EXIT", KEY_EXIT, mode);
-#endif
-#ifdef KEY_FIND
- keydef("Key_Find", "KEY_FIND", KEY_FIND, mode);
-#endif
-#ifdef KEY_HELP
- keydef("Key_Help", "KEY_HELP", KEY_HELP, mode);
-#endif
-#ifdef KEY_MARK
- keydef("Key_Mark", "KEY_MARK", KEY_MARK, mode);
-#endif
-#ifdef KEY_MESSAGE
- keydef("Key_Message", "KEY_MESSAGE", KEY_MESSAGE, mode);
-#endif
-#ifdef KEY_MOVE
- keydef("Key_Move", "KEY_MOVE", KEY_MOVE, mode);
-#endif
-#ifdef KEY_NEXT
- keydef("Key_Next", "KEY_NEXT", KEY_NEXT, mode);
-#endif
-#ifdef KEY_OPEN
- keydef("Key_Open", "KEY_OPEN", KEY_OPEN, mode);
-#endif
-#ifdef KEY_OPTIONS
- keydef("Key_Options", "KEY_OPTIONS", KEY_OPTIONS, mode);
-#endif
-#ifdef KEY_PREVIOUS
- keydef("Key_Previous", "KEY_PREVIOUS", KEY_PREVIOUS, mode);
-#endif
-#ifdef KEY_REDO
- keydef("Key_Redo", "KEY_REDO", KEY_REDO, mode);
-#endif
-#ifdef KEY_REFERENCE
- keydef("Key_Reference", "KEY_REFERENCE", KEY_REFERENCE, mode);
-#endif
-#ifdef KEY_REFRESH
- keydef("Key_Refresh", "KEY_REFRESH", KEY_REFRESH, mode);
-#endif
-#ifdef KEY_REPLACE
- keydef("Key_Replace", "KEY_REPLACE", KEY_REPLACE, mode);
-#endif
-#ifdef KEY_RESTART
- keydef("Key_Restart", "KEY_RESTART", KEY_RESTART, mode);
-#endif
-#ifdef KEY_RESUME
- keydef("Key_Resume", "KEY_RESUME", KEY_RESUME, mode);
-#endif
-#ifdef KEY_SAVE
- keydef("Key_Save", "KEY_SAVE", KEY_SAVE, mode);
-#endif
-#ifdef KEY_SBEG
- keydef("Key_Shift_Begin", "KEY_SBEG", KEY_SBEG, mode);
-#endif
-#ifdef KEY_SCANCEL
- keydef("Key_Shift_Cancel", "KEY_SCANCEL", KEY_SCANCEL, mode);
-#endif
-#ifdef KEY_SCOMMAND
- keydef("Key_Shift_Command", "KEY_SCOMMAND", KEY_SCOMMAND, mode);
-#endif
-#ifdef KEY_SCOPY
- keydef("Key_Shift_Copy", "KEY_SCOPY", KEY_SCOPY, mode);
-#endif
-#ifdef KEY_SCREATE
- keydef("Key_Shift_Create", "KEY_SCREATE", KEY_SCREATE, mode);
-#endif
-#ifdef KEY_SDC
- keydef("Key_Shift_Delete_Char", "KEY_SDC", KEY_SDC, mode);
-#endif
-#ifdef KEY_SDL
- keydef("Key_Shift_Delete_Line", "KEY_SDL", KEY_SDL, mode);
-#endif
-#ifdef KEY_SELECT
- keydef("Key_Select", "KEY_SELECT", KEY_SELECT, mode);
-#endif
-#ifdef KEY_SEND
- keydef("Key_Shift_End", "KEY_SEND", KEY_SEND, mode);
-#endif
-#ifdef KEY_SEOL
- keydef("Key_Shift_Clear_End_Of_Line", "KEY_SEOL", KEY_SEOL, mode);
-#endif
-#ifdef KEY_SEXIT
- keydef("Key_Shift_Exit", "KEY_SEXIT", KEY_SEXIT, mode);
-#endif
-#ifdef KEY_SFIND
- keydef("Key_Shift_Find", "KEY_SFIND", KEY_SFIND, mode);
-#endif
-#ifdef KEY_SHELP
- keydef("Key_Shift_Help", "KEY_SHELP", KEY_SHELP, mode);
-#endif
-#ifdef KEY_SHOME
- keydef("Key_Shift_Home", "KEY_SHOME", KEY_SHOME, mode);
-#endif
-#ifdef KEY_SIC
- keydef("Key_Shift_Insert_Char", "KEY_SIC", KEY_SIC, mode);
-#endif
-#ifdef KEY_SLEFT
- keydef("Key_Shift_Cursor_Left", "KEY_SLEFT", KEY_SLEFT, mode);
-#endif
-#ifdef KEY_SMESSAGE
- keydef("Key_Shift_Message", "KEY_SMESSAGE", KEY_SMESSAGE, mode);
-#endif
-#ifdef KEY_SMOVE
- keydef("Key_Shift_Move", "KEY_SMOVE", KEY_SMOVE, mode);
-#endif
-#ifdef KEY_SNEXT
- keydef("Key_Shift_Next_Page", "KEY_SNEXT", KEY_SNEXT, mode);
-#endif
-#ifdef KEY_SOPTIONS
- keydef("Key_Shift_Options", "KEY_SOPTIONS", KEY_SOPTIONS, mode);
-#endif
-#ifdef KEY_SPREVIOUS
- keydef("Key_Shift_Previous_Page", "KEY_SPREVIOUS", KEY_SPREVIOUS, mode);
-#endif
-#ifdef KEY_SPRINT
- keydef("Key_Shift_Print", "KEY_SPRINT", KEY_SPRINT, mode);
-#endif
-#ifdef KEY_SREDO
- keydef("Key_Shift_Redo", "KEY_SREDO", KEY_SREDO, mode);
-#endif
-#ifdef KEY_SREPLACE
- keydef("Key_Shift_Replace", "KEY_SREPLACE", KEY_SREPLACE, mode);
-#endif
-#ifdef KEY_SRIGHT
- keydef("Key_Shift_Cursor_Right", "KEY_SRIGHT", KEY_SRIGHT, mode);
-#endif
-#ifdef KEY_SRSUME
- keydef("Key_Shift_Resume", "KEY_SRSUME", KEY_SRSUME, mode);
-#endif
-#ifdef KEY_SSAVE
- keydef("Key_Shift_Save", "KEY_SSAVE", KEY_SSAVE, mode);
-#endif
-#ifdef KEY_SSUSPEND
- keydef("Key_Shift_Suspend", "KEY_SSUSPEND", KEY_SSUSPEND, mode);
-#endif
-#ifdef KEY_SUNDO
- keydef("Key_Shift_Undo", "KEY_SUNDO", KEY_SUNDO, mode);
-#endif
-#ifdef KEY_SUSPEND
- keydef("Key_Suspend", "KEY_SUSPEND", KEY_SUSPEND, mode);
-#endif
-#ifdef KEY_UNDO
- keydef("Key_Undo", "KEY_UNDO", KEY_UNDO, mode);
-#endif
-#ifdef KEY_MOUSE
- keydef("Key_Mouse", "KEY_MOUSE", KEY_MOUSE, mode);
-#endif
-#ifdef KEY_RESIZE
- keydef("Key_Resize", "KEY_RESIZE", KEY_RESIZE, mode);
-#endif
-}
-
-/*
- * Generate a constant with the given name. The second parameter
- * is a reference to the ACS character in the acs_map[] array and
- * will be translated into an index.
- */
-static void
-acs_def(const char *name, chtype *a)
-{
- int c = (int)(a - &acs_map[0]);
-
- printf(" %-24s : constant Character := ", name);
- if (isprint(UChar(c)) && (c != '`'))
- printf("'%c';\n", c);
- else
- printf("Character'Val (%d);\n", c);
-}
-
-/*
- * Generate the constants for the ACS characters
- */
-static void
-gen_acs(void)
-{
- printf(" type C_ACS_Map is array (Character'Val (0) .. Character'Val (127))\n");
- printf(" of Attributed_Character;\n");
-#if USE_REENTRANT || BROKEN_LINKER
- printf(" type C_ACS_Ptr is access C_ACS_Map;\n");
- printf(" function ACS_Map return C_ACS_Ptr;\n");
- printf(" pragma Import (C, ACS_Map, \""
- NCURSES_WRAP_PREFIX
- "acs_map\");\n");
-#else
- printf(" ACS_Map : C_ACS_Map;\n");
- printf(" pragma Import (C, ACS_Map, \"acs_map\");\n");
-#endif
- printf(" --\n");
- printf(" --\n");
- printf(" -- Constants for several characters from the Alternate Character Set\n");
- printf(" -- You must use these constants as indices into the ACS_Map array\n");
- printf(" -- to get the corresponding attributed character at runtime.\n");
- printf(" --\n");
-
-#ifdef ACS_ULCORNER
- acs_def("ACS_Upper_Left_Corner", &ACS_ULCORNER);
-#endif
-#ifdef ACS_LLCORNER
- acs_def("ACS_Lower_Left_Corner", &ACS_LLCORNER);
-#endif
-#ifdef ACS_URCORNER
- acs_def("ACS_Upper_Right_Corner", &ACS_URCORNER);
-#endif
-#ifdef ACS_LRCORNER
- acs_def("ACS_Lower_Right_Corner", &ACS_LRCORNER);
-#endif
-#ifdef ACS_LTEE
- acs_def("ACS_Left_Tee", &ACS_LTEE);
-#endif
-#ifdef ACS_RTEE
- acs_def("ACS_Right_Tee", &ACS_RTEE);
-#endif
-#ifdef ACS_BTEE
- acs_def("ACS_Bottom_Tee", &ACS_BTEE);
-#endif
-#ifdef ACS_TTEE
- acs_def("ACS_Top_Tee", &ACS_TTEE);
-#endif
-#ifdef ACS_HLINE
- acs_def("ACS_Horizontal_Line", &ACS_HLINE);
-#endif
-#ifdef ACS_VLINE
- acs_def("ACS_Vertical_Line", &ACS_VLINE);
-#endif
-#ifdef ACS_PLUS
- acs_def("ACS_Plus_Symbol", &ACS_PLUS);
-#endif
-#ifdef ACS_S1
- acs_def("ACS_Scan_Line_1", &ACS_S1);
-#endif
-#ifdef ACS_S9
- acs_def("ACS_Scan_Line_9", &ACS_S9);
-#endif
-#ifdef ACS_DIAMOND
- acs_def("ACS_Diamond", &ACS_DIAMOND);
-#endif
-#ifdef ACS_CKBOARD
- acs_def("ACS_Checker_Board", &ACS_CKBOARD);
-#endif
-#ifdef ACS_DEGREE
- acs_def("ACS_Degree", &ACS_DEGREE);
-#endif
-#ifdef ACS_PLMINUS
- acs_def("ACS_Plus_Minus", &ACS_PLMINUS);
-#endif
-#ifdef ACS_BULLET
- acs_def("ACS_Bullet", &ACS_BULLET);
-#endif
-#ifdef ACS_LARROW
- acs_def("ACS_Left_Arrow", &ACS_LARROW);
-#endif
-#ifdef ACS_RARROW
- acs_def("ACS_Right_Arrow", &ACS_RARROW);
-#endif
-#ifdef ACS_DARROW
- acs_def("ACS_Down_Arrow", &ACS_DARROW);
-#endif
-#ifdef ACS_UARROW
- acs_def("ACS_Up_Arrow", &ACS_UARROW);
-#endif
-#ifdef ACS_BOARD
- acs_def("ACS_Board_Of_Squares", &ACS_BOARD);
-#endif
-#ifdef ACS_LANTERN
- acs_def("ACS_Lantern", &ACS_LANTERN);
-#endif
-#ifdef ACS_BLOCK
- acs_def("ACS_Solid_Block", &ACS_BLOCK);
-#endif
-#ifdef ACS_S3
- acs_def("ACS_Scan_Line_3", &ACS_S3);
-#endif
-#ifdef ACS_S7
- acs_def("ACS_Scan_Line_7", &ACS_S7);
-#endif
-#ifdef ACS_LEQUAL
- acs_def("ACS_Less_Or_Equal", &ACS_LEQUAL);
-#endif
-#ifdef ACS_GEQUAL
- acs_def("ACS_Greater_Or_Equal", &ACS_GEQUAL);
-#endif
-#ifdef ACS_PI
- acs_def("ACS_PI", &ACS_PI);
-#endif
-#ifdef ACS_NEQUAL
- acs_def("ACS_Not_Equal", &ACS_NEQUAL);
-#endif
-#ifdef ACS_STERLING
- acs_def("ACS_Sterling", &ACS_STERLING);
-#endif
-}
-
-#define GEN_EVENT(name,value) \
- printf(" %-25s : constant Event_Mask := 8#%011lo#;\n", \
- #name, value)
-
-#define GEN_MEVENT(name) \
- printf(" %-25s : constant Event_Mask := 8#%011lo#;\n", \
- #name, name)
-
-static void
-gen_mouse_events(void)
-{
- mmask_t all1 = 0;
- mmask_t all2 = 0;
- mmask_t all3 = 0;
- mmask_t all4 = 0;
-
-#ifdef BUTTON1_RELEASED
- GEN_MEVENT(BUTTON1_RELEASED);
- all1 |= BUTTON1_RELEASED;
-#endif
-#ifdef BUTTON1_PRESSED
- GEN_MEVENT(BUTTON1_PRESSED);
- all1 |= BUTTON1_PRESSED;
-#endif
-#ifdef BUTTON1_CLICKED
- GEN_MEVENT(BUTTON1_CLICKED);
- all1 |= BUTTON1_CLICKED;
-#endif
-#ifdef BUTTON1_DOUBLE_CLICKED
- GEN_MEVENT(BUTTON1_DOUBLE_CLICKED);
- all1 |= BUTTON1_DOUBLE_CLICKED;
-#endif
-#ifdef BUTTON1_TRIPLE_CLICKED
- GEN_MEVENT(BUTTON1_TRIPLE_CLICKED);
- all1 |= BUTTON1_TRIPLE_CLICKED;
-#endif
-#ifdef BUTTON1_RESERVED_EVENT
- GEN_MEVENT(BUTTON1_RESERVED_EVENT);
- all1 |= BUTTON1_RESERVED_EVENT;
-#endif
-#ifdef BUTTON2_RELEASED
- GEN_MEVENT(BUTTON2_RELEASED);
- all2 |= BUTTON2_RELEASED;
-#endif
-#ifdef BUTTON2_PRESSED
- GEN_MEVENT(BUTTON2_PRESSED);
- all2 |= BUTTON2_PRESSED;
-#endif
-#ifdef BUTTON2_CLICKED
- GEN_MEVENT(BUTTON2_CLICKED);
- all2 |= BUTTON2_CLICKED;
-#endif
-#ifdef BUTTON2_DOUBLE_CLICKED
- GEN_MEVENT(BUTTON2_DOUBLE_CLICKED);
- all2 |= BUTTON2_DOUBLE_CLICKED;
-#endif
-#ifdef BUTTON2_TRIPLE_CLICKED
- GEN_MEVENT(BUTTON2_TRIPLE_CLICKED);
- all2 |= BUTTON2_TRIPLE_CLICKED;
-#endif
-#ifdef BUTTON2_RESERVED_EVENT
- GEN_MEVENT(BUTTON2_RESERVED_EVENT);
- all2 |= BUTTON2_RESERVED_EVENT;
-#endif
-#ifdef BUTTON3_RELEASED
- GEN_MEVENT(BUTTON3_RELEASED);
- all3 |= BUTTON3_RELEASED;
-#endif
-#ifdef BUTTON3_PRESSED
- GEN_MEVENT(BUTTON3_PRESSED);
- all3 |= BUTTON3_PRESSED;
-#endif
-#ifdef BUTTON3_CLICKED
- GEN_MEVENT(BUTTON3_CLICKED);
- all3 |= BUTTON3_CLICKED;
-#endif
-#ifdef BUTTON3_DOUBLE_CLICKED
- GEN_MEVENT(BUTTON3_DOUBLE_CLICKED);
- all3 |= BUTTON3_DOUBLE_CLICKED;
-#endif
-#ifdef BUTTON3_TRIPLE_CLICKED
- GEN_MEVENT(BUTTON3_TRIPLE_CLICKED);
- all3 |= BUTTON3_TRIPLE_CLICKED;
-#endif
-#ifdef BUTTON3_RESERVED_EVENT
- GEN_MEVENT(BUTTON3_RESERVED_EVENT);
- all3 |= BUTTON3_RESERVED_EVENT;
-#endif
-#ifdef BUTTON4_RELEASED
- GEN_MEVENT(BUTTON4_RELEASED);
- all4 |= BUTTON4_RELEASED;
-#endif
-#ifdef BUTTON4_PRESSED
- GEN_MEVENT(BUTTON4_PRESSED);
- all4 |= BUTTON4_PRESSED;
-#endif
-#ifdef BUTTON4_CLICKED
- GEN_MEVENT(BUTTON4_CLICKED);
- all4 |= BUTTON4_CLICKED;
-#endif
-#ifdef BUTTON4_DOUBLE_CLICKED
- GEN_MEVENT(BUTTON4_DOUBLE_CLICKED);
- all4 |= BUTTON4_DOUBLE_CLICKED;
-#endif
-#ifdef BUTTON4_TRIPLE_CLICKED
- GEN_MEVENT(BUTTON4_TRIPLE_CLICKED);
- all4 |= BUTTON4_TRIPLE_CLICKED;
-#endif
-#ifdef BUTTON4_RESERVED_EVENT
- GEN_MEVENT(BUTTON4_RESERVED_EVENT);
- all4 |= BUTTON4_RESERVED_EVENT;
-#endif
-#ifdef BUTTON_CTRL
- GEN_MEVENT(BUTTON_CTRL);
-#endif
-#ifdef BUTTON_SHIFT
- GEN_MEVENT(BUTTON_SHIFT);
-#endif
-#ifdef BUTTON_ALT
- GEN_MEVENT(BUTTON_ALT);
-#endif
-#ifdef REPORT_MOUSE_POSITION
- GEN_MEVENT(REPORT_MOUSE_POSITION);
-#endif
-#ifdef ALL_MOUSE_EVENTS
- GEN_MEVENT(ALL_MOUSE_EVENTS);
-#endif
-
- GEN_EVENT(BUTTON1_EVENTS, all1);
- GEN_EVENT(BUTTON2_EVENTS, all2);
- GEN_EVENT(BUTTON3_EVENTS, all3);
- GEN_EVENT(BUTTON4_EVENTS, all4);
-}
-
-static void
-wrap_one_var(const char *c_var,
- const char *c_type,
- const char *ada_func,
- const char *ada_type)
-{
-#if USE_REENTRANT
- /* must wrap variables */
- printf("\n");
- printf(" function %s return %s\n", ada_func, ada_type);
- printf(" is\n");
- printf(" function Result return %s;\n", c_type);
- printf(" pragma Import (C, Result, \"" NCURSES_WRAP_PREFIX "%s\");\n", c_var);
- printf(" begin\n");
- if (strcmp(c_type, ada_type))
- printf(" return %s (Result);\n", ada_type);
- else
- printf(" return Result;\n");
- printf(" end %s;\n", ada_func);
-#else
- /* global variables are really global */
- printf("\n");
- printf(" function %s return %s\n", ada_func, ada_type);
- printf(" is\n");
- printf(" Result : %s;\n", c_type);
- printf(" pragma Import (C, Result, \"%s\");\n", c_var);
- printf(" begin\n");
- if (strcmp(c_type, ada_type))
- printf(" return %s (Result);\n", ada_type);
- else
- printf(" return Result;\n");
- printf(" end %s;\n", ada_func);
-#endif
-}
-
-#define GEN_PUBLIC_VAR(c_var, c_type, ada_func, ada_type) \
- wrap_one_var(#c_var, #c_type, #ada_func, #ada_type)
-
-static void
-gen_public_vars(void)
-{
- GEN_PUBLIC_VAR(stdscr, Window, Standard_Window, Window);
- GEN_PUBLIC_VAR(curscr, Window, Current_Window, Window);
- GEN_PUBLIC_VAR(LINES, C_Int, Lines, Line_Count);
- GEN_PUBLIC_VAR(COLS, C_Int, Columns, Column_Count);
- GEN_PUBLIC_VAR(TABSIZE, C_Int, Tab_Size, Natural);
- GEN_PUBLIC_VAR(COLORS, C_Int, Number_Of_Colors, Natural);
- GEN_PUBLIC_VAR(COLOR_PAIRS, C_Int, Number_Of_Color_Pairs, Natural);
-}
-
-/*
- * Output some comment lines indicating that the file is generated.
- * The name parameter is the name of the facility to be used in
- * the comment.
- */
-static void
-prologue(const char *name)
-{
- printf("-- %s binding.\n", name);
- printf("-- This module is generated. Please don't change it manually!\n");
- printf("-- Run the generator instead.\n-- |");
-
- printf("define(`M4_BIT_ORDER',`%s_Order_First')",
- little_endian ? "Low" : "High");
-}
-
-/*
- * Write the prologue for the curses facility and make sure that
- * KEY_MIN and KEY_MAX are defined for the rest of this source.
- */
-static void
-basedefs(void)
-{
- prologue("curses");