/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,2000 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
/*
Version Control
- $Revision: 1.29 $
+ $Revision: 1.32 $
--------------------------------------------------------------------------*/
/*
This program generates various record structures and constants from the
chtype_rep("Ch",A_CHARTEXT);
chtype_rep("Color",A_COLOR);
chtype_rep("Attr",(A_ATTRIBUTES&~A_COLOR));
- printf(" end record;\n for %s'Size use %d;\n",name,8*sizeof(chtype));
+ printf(" end record;\n for %s'Size use %ld;\n", name, (long)(8*sizeof(chtype)));
printf(" -- Please note: this rep. clause is generated and may be\n");
printf(" -- different on your system.\n");
}
static void gen_attr_set( const char *name )
{
+ /* All of the A_xxx symbols are defined in ncurses, but not all are nonzero
+ * if "configure --enable-widec" is specified.
+ */
static const name_attribute_pair nap[] = {
-#ifdef A_STANDOUT
+#if A_STANDOUT
{"Stand_Out", A_STANDOUT},
#endif
-#ifdef A_UNDERLINE
+#if A_UNDERLINE
{"Under_Line", A_UNDERLINE},
#endif
-#ifdef A_REVERSE
+#if A_REVERSE
{"Reverse_Video", A_REVERSE},
#endif
-#ifdef A_BLINK
+#if A_BLINK
{"Blink", A_BLINK},
#endif
-#ifdef A_DIM
+#if A_DIM
{"Dim_Character", A_DIM},
#endif
-#ifdef A_BOLD
+#if A_BOLD
{"Bold_Character", A_BOLD},
#endif
-#ifdef A_ALTCHARSET
+#if A_ALTCHARSET
{"Alternate_Character_Set", A_ALTCHARSET},
#endif
-#ifdef A_INVIS
+#if A_INVIS
{"Invisible_Character", A_INVIS},
#endif
-#ifdef A_PROTECT
+#if A_PROTECT
{"Protected_Character", A_PROTECT},
#endif
-#ifdef A_HORIZONTAL
+#if A_HORIZONTAL
{"Horizontal", A_HORIZONTAL},
#endif
-#ifdef A_LEFT
+#if A_LEFT
{"Left", A_LEFT},
#endif
-#ifdef A_LOW
+#if A_LOW
{"Low", A_LOW},
#endif
-#ifdef A_RIGHT
+#if A_RIGHT
{"Right", A_RIGHT},
#endif
-#ifdef A_TOP
+#if A_TOP
{"Top", A_TOP},
#endif
-#ifdef A_VERTICAL
+#if A_VERTICAL
{"Vertical", A_VERTICAL},
#endif
{(char *)0, 0}
*/
static void gen_linkopts (void)
{
- printf(" pragma Linker_Options (\"-lAdaCurses%s\");\n", model);
printf(" pragma Linker_Options (\"-lncurses%s\");\n", model);
}
return strlen(buf);
}
-#define GEN_OFFSET(member,itype) \
- if (sizeof(((WINDOW*)0)->member)==sizeof(itype)) { \
- o = offsetof(WINDOW, member); \
- if ((o%sizeof(itype) == 0)) { \
- printf(" Offset%-*s : constant Natural := %2d; -- %s\n", \
- 8, #member, o/sizeof(itype),#itype); \
- } \
+#define GEN_OFFSET(member,itype) \
+ if (sizeof(((WINDOW*)0)->member)==sizeof(itype)) { \
+ o = offsetof(WINDOW, member); \
+ if ((o%sizeof(itype) == 0)) { \
+ printf(" Offset%-*s : constant Natural := %2ld; -- %s\n", \
+ 8, #member, o/sizeof(itype),#itype); \
+ } \
}
static void
gen_offsets(void)
{
- int o;
+ long o;
const char* s_bool = "";
GEN_OFFSET(_maxy,short);
GEN_OFFSET(_scroll,int);
s_bool = "int";
}
- printf(" Sizeof%-*s : constant Natural := %2d; -- %s\n",
- 8, "_bool",sizeof(bool),"bool");
+ printf(" Sizeof%-*s : constant Natural := %2ld; -- %s\n",
+ 8, "_bool", (long) sizeof(bool),"bool");
/* In ncurses _maxy and _maxx needs an offset for the "public"
* value
*/