Ejemplo n.º 1
0
void print_typed_resources(TYPEINFO *type_ptr, enum print_types pt)
{
  struct print_def *pd = &print_defs[pt];
  NAMEINFO_NODE *info;
  int i;

  info = (NAMEINFO_NODE *)(type_ptr->rcsinfo);
  for (i = 0; i < type_ptr->rcscount; i++, info = info->next)
    (pd->printFunc)(i, &(info->data));

  COUTPUT(("static NAMEINFO %s_info[] = {\n", pd->title1));
  info = (NAMEINFO_NODE *)(type_ptr->rcsinfo);
  for (i = 0; i < type_ptr->rcscount; i++, info = info->next)
    {
      (pd->printNameFunc)(i, &(info->data), pd->title2);
      COUTPUT(( "0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, ",
		info->data.wType, 0 /* info->data.hGlobal */,
		0 /* info->data.rcsoffset */, info->data.rcslength, info->data.rcsflags,
		0 /* info->data.hRsrc */, 0 /* info->data.hObject */));
      print_num_or_str(info->data.rcsitemname);
      COUTPUT(( "},\n"));	
    }
  print_last_entry(9);
  COUTPUT(("};\n\n"));
}
Ejemplo n.º 2
0
void 
print_last_entry(int num)
{
        COUTPUT(("\t{"));
        while(--num)
                COUTPUT(("0, "));
        COUTPUT(("0 }\n"));
}
Ejemplo n.º 3
0
void
print_bmp_hdr(char *title, int id, BITMAPINFOHEADER *ptr)
{
	COUTPUT(( "static BITMAPINFOHEADER %s_bmp_hdr_%d[] = {\n\t{", title, id));
	COUTPUT(( " 0x%08lx,\n\t0x%08lx,\n\t0x%08lx,\n",
			ptr->biSize, ptr->biWidth, ptr->biHeight));
	COUTPUT(( "\t0x%04lx,\n\t0x%04lx,\n\t0x%08lx,\n",
			ptr->biPlanes, ptr->biBitCount, ptr->biCompression));
	COUTPUT(( "\t0x%08lx,\n\t0x%08lx,\n\t0x%08lx,\n",
			ptr->biSizeImage, ptr->biXPelsPerMeter, ptr->biYPelsPerMeter));
	COUTPUT(( "\t0x%08lx,\n\t0x%08lx }\n}\n;\n\n",
			ptr->biClrUsed, ptr->biClrImportant));
}
Ejemplo n.º 4
0
void
print_asciiz_string(char *str)
{
	int	i;
	int	counter = 0;
        if ((str == (char *)NULL) || (str[0] == 0)) {
                COUTPUT(("0 "));
                return;
        }
        COUTPUT(("\""));
        for (i = 0; str[i]; i++) {
                if (++counter == CHARS_PER_LINE)  {
                        COUTPUT(("\\\n"));
                        counter = 0;
                }
                if (str[i] == '\n')
                        COUTPUT(("\\n"));
                else if (str[i] == '\t')
                        COUTPUT(( "\\t"));
                else if (str[i] == '\"')
                        COUTPUT(( "\\\""));
                else
                        COUTPUT(( "%c", str[i]));
        }
        COUTPUT(( "\""));

}
Ejemplo n.º 5
0
void
print_rgb_quad(char *title, int id, RGBQUAD *ptr, int count)
{
	int	i;

        COUTPUT(( "static RGBQUAD %s_rgb_quad_%d[] = {\n",title, id));
        for (i = 0; i < count; i++) {
                COUTPUT(("\t{ 0x%02x, 0x%02x, 0x%02x, 0x00 },\n",
                        (BYTE)ptr->rgbBlue, (BYTE)ptr->rgbGreen, (BYTE)ptr->rgbRed));
                ptr++;
        }
        print_last_entry(4);
        COUTPUT(("};\n\n"));
}
Ejemplo n.º 6
0
void print_string_res(int i, NAMEINFO *info)
{
  STRING_DATA *str_data;
  int j;

  str_data = (STRING_DATA *) info->rcsdata;
  COUTPUT(( "static STRINGENTRY string_data_%d[16] = {\n",i));
  for (j = 0; j < 16; j++)
    {
      COUTPUT(("\t"));
      print_asciiz_string((*str_data)[j]);
      if (j == 15)
	COUTPUT(("\n};\n\n"));
      else
	COUTPUT((",\n"));
    }
}
Ejemplo n.º 7
0
void
print_num_or_str(char *str)
{
	if (HIWORD(str) == 0)
		COUTPUT(( "(char *) 0x%04x", (int)str));
	else
		print_asciiz_string(str);
}
Ejemplo n.º 8
0
void print_bitmap_res(int i, NAMEINFO *info)
{
  BITMAP_NODE *node;
  BITMAPIMAGE *image;
  int count;

  node = (BITMAP_NODE *)info->rcsdata;
  image = &(node->data);
  print_bmp_hdr("bitmap", i, image->bmp_hdr);
  count = bit_to_rgb(image->bmp_hdr->biBitCount);
  print_rgb_quad("bitmap", i, image->rgb_quad, count);
  count = image->bmp_hdr->biSizeImage;
  print_bits("bitmap_bits", i, (BYTE *)image->bitmap_bits, count);
  COUTPUT(( "static BITMAPIMAGE bitmap_data_%d = {\n",i));
  COUTPUT(("bitmap_bmp_hdr_%d, bitmap_rgb_quad_%d, ", i, i));
  COUTPUT(( "bitmap_bits_%d",i));
  COUTPUT(("};\n\n"));
}
Ejemplo n.º 9
0
void print_group_icon_res(int i, NAMEINFO *info)
{
  ICONDIR_NODE *nentry;
  ICONDIRENTRY *entry;

  nentry = (ICONDIR_NODE *) info->rcsdata;
  COUTPUT(( "static ICONDIRENTRY icon_dir_data_%d[] = {\n", i));
  while (nentry)
    {
      entry = &(nentry->data);
      if (entry->wOrdinalNumber == 0)
	break;
      COUTPUT(("\t{ 0x%02x, 0x%02x, 0x%02x, ", (BYTE)entry->bWidth, (BYTE) entry->bHeight, (BYTE)entry->bColorCount));
      COUTPUT(( "0x%04x, 0x%04x, ", entry->wPlanes, entry->wBitsPerPel));
      COUTPUT(( "0x%08x, 0x%04x },\n", entry->dwBytesInRes, entry->wOrdinalNumber));
      nentry = nentry->next;
    }
  print_last_entry(7);
  COUTPUT(( "};\n\n"));
}
Ejemplo n.º 10
0
void print_group_cursor_res(int i, NAMEINFO *info)
{
  CURSORDIR_NODE *nentry;
  CURSORDIRENTRY *entry;

  nentry = (CURSORDIR_NODE *) info->rcsdata;
  COUTPUT(( "static CURSORDIRENTRY cursor_dir_data_%d[] = {\n", i));
  while (nentry)
    {
      entry = &(nentry->data);
      if (entry->wOrdinalNumber == 0)
	break;
      COUTPUT(("\t{ 0x%02x, 0x%02x, ", (BYTE)entry->wWidth, (BYTE) entry->wHeight));
      COUTPUT(( "0x%04x, 0x%04x, ", entry->wPlanes, entry->wBitsPerPel));
      COUTPUT(( "0x%08x, 0x%04x },\n", entry->dwBytesInRes, entry->wOrdinalNumber));
      nentry = nentry->next;
  }
  print_last_entry(6);
  COUTPUT(( "};\n\n"));
}
Ejemplo n.º 11
0
void print_icon_res(int i, NAMEINFO *info)
{
  ICON_NODE *node;
  ICONIMAGE *image;
  int count;

  node = (ICON_NODE *)info->rcsdata;
  image = &(node->data);
  print_bmp_hdr("icon", i, image->icon_bmp_hdr);
  count = bit_to_rgb(image->icon_bmp_hdr->biBitCount);
  print_rgb_quad("icon", i, image->icon_rgb_quad, count);
  count = (int)(image->icon_bmp_hdr->biHeight * image->icon_bmp_hdr->biWidth * image->icon_bmp_hdr->biBitCount)/16;
  print_bits("icon_xor_bits", i, (BYTE *)image->icon_xor_mask, count);
  count = (image->icon_bmp_hdr->biHeight * image->icon_bmp_hdr->biWidth)/16;
  print_bits("icon_and_bits", i, (BYTE *)image->icon_and_mask, count);
  COUTPUT(( "static ICONIMAGE icon_data_%d = {\n",i));
  COUTPUT(("icon_bmp_hdr_%d, icon_rgb_quad_%d, ", i, i));
  COUTPUT(( "icon_xor_bits_%d, icon_and_bits_%d",i,i));
  COUTPUT(("};\n\n"));
}
Ejemplo n.º 12
0
void print_cursor_res(int i, NAMEINFO *info)
{
  CURSOR_NODE *node;
  CURSORIMAGE *image;
  int count;

  node = (CURSOR_NODE *)info->rcsdata;
  image = &(node->data);
  print_bmp_hdr("cursor", i, image->bmp_hdr);
  count = (int)bit_to_rgb(image->bmp_hdr->biBitCount);
  print_rgb_quad("cursor", i, image->rgb_quad, count);
  count = (image->bmp_hdr->biHeight * image->bmp_hdr->biWidth)/16;
  print_bits("cursor_xor_bits", i, (BYTE *)image->xor_mask, count);
  print_bits("cursor_and_bits", i, (BYTE *)image->and_mask, count);
  COUTPUT(( "static CURSORIMAGE cursor_data_%d = {\n",i));
  COUTPUT(("\t0x%04x, 0x%04x, ",image->wHotSpotX, image->wHotSpotY)); 
  COUTPUT(("cursor_bmp_hdr_%d, cursor_rgb_quad_%d, ", i, i));
  COUTPUT(("cursor_xor_bits_%d, cursor_and_bits_%d", i, i));
  COUTPUT(("};\n\n"));
}
Ejemplo n.º 13
0
void
print_str_bits(char *title, WORD id, BYTE *ptr, WORD count)
{
        WORD    i;
	int	line_length = 0;

        COUTPUT(( "static char  %s_data_%d[] = \"\\\n", title, id));
        for (i = 0; i < count; i++) {
		if (ptr[i] >= 32 && ptr[i] < 126) {
			if ((ptr[i] == '"') || 
			    (ptr[i] == '\'') || 
			    (ptr[i] == '\\')) {
				COUTPUT(("\\%c",ptr[i]));
				line_length += 2;
			} else {
				COUTPUT(("%c",ptr[i]));
				line_length += 1;
			}
		} else {
			COUTPUT(("\\%03o",ptr[i]));
			line_length += 4;
		}
		if (line_length >= 65) {
			COUTPUT(("\\\n"));
			line_length = 0;
		}
        }
	COUTPUT(("\";\n\n"));
}
Ejemplo n.º 14
0
void print_accel_res(int i, NAMEINFO *info)
{
  ACCEL_NODE *nentry;
  ACCELENTRY *accel_data;

  nentry = (ACCEL_NODE *) info->rcsdata;
  COUTPUT(("static ACCELENTRY accel_data_%d[] = {\n",i));
  while(nentry)
    {
      accel_data = &(nentry->data);
      if (nentry->next == NULL)
        accel_data->fFlags |= 0x80;
      COUTPUT(("\t{ 0x%02x, 0x%04x, 0x%04x },\n",
	       (BYTE)accel_data->fFlags, accel_data->wEvent,
	       accel_data->wId));
      if (accel_data->fFlags & 0x80)
	break;
      nentry = nentry->next;
    } 
  print_last_entry(3);
  COUTPUT(( "};\n\n"));
}
Ejemplo n.º 15
0
void doheader(void)
/* Output the header for the .def.c. */
{
  COUTPUT(("\n/*************************************\n"));
  COUTPUT((" * File: %s\n",filename));
  COUTPUT((" * Date: %s",ctime(&now)));
  COUTPUT((" **************************************/\n")); 
  COUTPUT(("\n"));

  COUTPUT(("#include \"ModTable.h\"\n"));
  COUTPUT(("#include \"Log.h\"\n"));
  COUTPUT(("\n"));


} /* doheader */
Ejemplo n.º 16
0
void print_dialog_res(int i, NAMEINFO *info)
{
  DIALOG_NODE *dlg_node;
  DIALOGDATA *dlg_data;

  dlg_node = (DIALOG_NODE *)(info->rcsdata);
  dlg_data = &(dlg_node->data);
  print_control_data(dlg_node->controlinfo, i, dlg_data->bNumberOfItems);
  COUTPUT(( "static DIALOGDATA dialog_data_%d = \n\t{", i));
  COUTPUT(( " 0x%08lx, 0x%08lx, 0x%04x, ",
	dlg_data->lStyle, dlg_data->dwExtStyle, dlg_data->bNumberOfItems));
  COUTPUT(( "0x%04x, 0x%04x, 0x%04x, 0x%04x, ",
	dlg_data->x, dlg_data->y, dlg_data->cx, dlg_data->cy));
  print_num_or_str(dlg_data->szMenuName);
  COUTPUT((", "));
  print_num_or_str(dlg_data->szClassName);
  COUTPUT((", "));
  print_asciiz_string(dlg_data->szCaption);
  COUTPUT((", "));
  COUTPUT(( "0x%04x, ", dlg_data->wPointSize));
  print_num_or_str(dlg_data->szFaceName);
  COUTPUT((", "));
  COUTPUT(( "control_data_%d };\n\n", i));
}
Ejemplo n.º 17
0
void
print_bits(char *title, int id, BYTE *ptr, int count)
{
        int    j;
 
        COUTPUT(( "static BYTE  %s_%d[] = {\n", title, id));
        for (j = 0; j < count; j++) {
                if ( (j % 8) == 0)
                        COUTPUT(("\n"));
                COUTPUT(("0x%02x",ptr[j]));
                if (j == (count - 1))
                        COUTPUT(("\n"));
                else
                        COUTPUT((", "));
        }
        COUTPUT(("\n};\n\n"));
}
Ejemplo n.º 18
0
void print_dlginit_res(int i, NAMEINFO *info)
{
  DLGINIT_NODE *dlginit_node;
  DLGINITDATA *dlginit_data;
  WORD j, k;

  dlginit_node = (DLGINIT_NODE *)(info->rcsdata);
  dlginit_data = &(dlginit_node->data);

  COUTPUT(("static BYTE u240_data_%d[] =\n", i));
  COUTPUT(("{\n"));
  for (j = 0; j < dlginit_data->wDataSize; j += k)
  {
    COUTPUT(("\t"));
    for (k = 0; (k < 16) && (j + k < dlginit_data->wDataSize); k++)
      COUTPUT(("%d,", dlginit_data->bData[j+k]));
    COUTPUT(("\n"));
  }
  COUTPUT(("};\n"));
  COUTPUT(("\n"));

}
Ejemplo n.º 19
0
void
print_menu_list(MENU_NODE *node)
{
  MENUDATA *current;
	
  COUTPUT(( "static MENUDATA m_%x[] = {\n", (int)node));
  while (node)
    {
      current = &(node->data);
      COUTPUT(( "MENUITEM( 0x%04x, 0x%04x, ", current->menuflag, current->menuid)); 
      print_asciiz_string(current->menuname);
      COUTPUT((", "));
      if (node->child)
	COUTPUT(( "m_%x )", (int)(node->child)));
      else 
	COUTPUT(( "0 )"));  
      node = node->next;
      COUTPUT((",\n"));
      if (current->menuflag & MF_END)
	break;
    };
  print_last_entry(4);
  COUTPUT(( "};\n\n"));
}
Ejemplo n.º 20
0
void
print_control_data(CONTROL_NODE *node, int id, int count)
{
  COUTPUT(( "static CONTROLDATA control_data_%d[] = {\n", id));

  while (count--)
    {
      CONTROLDATA *ptr = &(node->data);
      COUTPUT(( "\tCONTROLITEM( 0x%04x, 0x%04x, 0x%04x, 0x%04x, ",
	ptr->x, ptr->y, ptr->cx, ptr->cy));
      COUTPUT(( "0x%04x, 0x%08lx, 0x%08lx, ",
	ptr->wID, ptr->lStyle, ptr->dwExtStyle));    
      print_asciiz_string(ptr->szClass);	
      COUTPUT(( ", "));
      print_num_or_str(ptr->szText);
      COUTPUT(( " ),\n"));
      node = node->next;
    } 
  print_last_entry(8);
  COUTPUT(( "};\n\n"));
}
Ejemplo n.º 21
0
void
print_module()
{
  int n;
  struct table_point *tempentry;
  int   index;
 
  if(bResourceOnly) 
	return;

  /* Create new array out of linked list of entry points. */
  /* Check that there will be sufficient space in final array to
     contain both numbered and unnumbered entry points. */

  if (currentnum + 1 > max)
    max = currentnum + 1;
  functions=(char **)calloc(max+1,sizeof(char *));


  /* Set the default entry point name for libraries. */
  if ( *libentry_name == '\0' )
	strcpy(libentry_name, "LibMain");

  if (build_app_module)
      strcpy(libentry_name, "LibMainStub");

  /* Initialize table. */
  for(n=0;n<=max;n++)
    functions[n]=NULL;
  
  tempentry=entrytable;	/* Save copy of entrytable head before
			   traversing. */
  
  /* Fill in numbered entries. */
  while(entrytable)
    {
      if((entrytable->index)>0)
	functions[entrytable->index]= entrytable->name;
      entrytable=entrytable->next;
    }
  
  entrytable=tempentry;	/* Restore head of list. */
  
  /* Fill in non-numbered entries. */
  while(entrytable)
    {
      if((entrytable->index)<0)
	{
	  n=max;
	  while(functions[n])
	    n--;
	  functions[n]=entrytable->name;
	}
      entrytable=entrytable->next;
    }

  if (build_app_module) {
    n=max;
    while(functions[n])
      n--;
    functions[n]=malloc(strlen(modulename) + 9);
    strcpy(functions[n], modulename);
    strcat(functions[n], "_WinMain");
  }

  /* Print the .def.c header. */
  time(&now);
  
  doheader();
  
  /* Print out prototypes for entry points. */
  for(n=1;n<max+1;n++)
    if(functions[n] && strlen(functions[n]))
      COUTPUT(("extern long int %s(); \n",functions[n]));

  /* Print out actual entry point table. */
  if (IsLibrary) {
  	COUTPUT(("\n#include \"twindll.h\"\n\n"));
	COUTPUT(("long int %s();\n", libentry_name));
  }
  else if (build_app_module) {
  	COUTPUT(("\n#include \"twindll.h\"\n\n"));
	COUTPUT(("long int %s() {return 0;}\n", libentry_name));
  } else
	COUTPUT(("int PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);\n"));

  COUTPUT(("\nstatic ENTRYTAB entry_tab_default[] = \n{\n"));

  if (!description)
      description = modulename?modulename:"TWIN Application";
  if (build_app_module)
      description = libentry_name;

  COUTPUT(("\t/* 000 */ { \"%s\",0,0,%s},\n", 
	description,
	(IsLibrary||build_app_module)?libentry_name:"(void *)WinMain"));

  index = 8;
  for(n = 1;n<max+1;n++)
    {
      if((functions[n] == 0) || (strlen(functions[n]) == 0))
	COUTPUT(("\t/* %3.3x */\t{ \"\",0,0,0 },\n",n));
      else
	{
	  COUTPUT(("\t/* %3.3x */\t{ \"%s\",0x%4.4x,0x%4.4x,%s },\n",
		   n,functions[n],8,index,functions[n]));
	  EOUTPUT(("%s\n", functions[n]));
	}
      index += 8;
    }
  COUTPUT(("\t/* end */ { 0, 0, 0, 0 }\n};\n\n"));
  
  
  if(bSegmentTable)
  	COUTPUT(("extern SEGTAB %s%s[];\n",
		"SegmentTable",modulename?modulename:""));
  /* Print out remaining "standard" .def.c stuff. */
  COUTPUT(("static MODULEDSCR mod_dscr = \n"));
  COUTPUT(("{    \"%s\",\n",modulename?modulename:""));
  COUTPUT(("\tentry_tab_default,\n"));

  /* put out a segment table, with option modulename */
  if(bSegmentTable)
  	COUTPUT(("\t%s%s,\n","SegmentTable",modulename?modulename:""));
  else
  	COUTPUT(("\t0,\n"));
  COUTPUT(("\t(long *) &hsmt_resource_table\n};\n\n"));
  
  if(IsLibrary||build_app_module) 
	DoLibraryInfo();
  else {
	DoApplication();
  }

  /* Clean up allocated memory. */
  for(n=0;n<=max;n++)
    free(functions[n]);
  entrytable=tempentry;
  while(entrytable)
    {
      tempentry=entrytable->next;
      free(entrytable);	
      entrytable=tempentry;
    }
} /* domodule */
Ejemplo n.º 22
0
void
DoApplication()
{

  COUTPUT(("\n"));
  COUTPUT(("extern int LoadTwinModDscr(int,char **, ENTRYTAB *,MODULEDSCR *);\n"));
  COUTPUT(("extern ENTRYTAB TWIN_LibInitTable[];\n"));
  COUTPUT(("\n"));

  {
    COUTPUT(("int\nmain(int argc, char **argv)\n"));
    COUTPUT(("{\n"));
    COUTPUT(("\tint    rc;\n"));
    COUTPUT(("\textern BOOL bIsXWin;\n"));
    COUTPUT(("\textern BOOL bIsBinaryApp;\n"));
    COUTPUT(("\n"));
    COUTPUT(("\tbIsBinaryApp = bIsXWin;\n"));
    COUTPUT(("\n"));
    COUTPUT(("\trc = LoadTwinModDscr(argc,argv,TWIN_LibInitTable,&mod_dscr);\n"));
    COUTPUT(("\n"));
    COUTPUT(("\treturn ExitWindows(rc==WM_QUIT?0:rc,0);\n"));

    COUTPUT(("}\n"));
  }
  
  COUTPUT(("\n"));
}
Ejemplo n.º 23
0
void
DoLibraryInfo()
{
  int n;
  char entry_name[255];
  char class_name[255];
  int i,j,k;
  int cpp_exists;

  if (build_app_module)
    strcpy(entry_name, "TWIN_AppEntry_");
  else
    strcpy(entry_name, "TWIN_LibEntry_");

  strcpy(class_name, "TWIN_InitClass_");
#if !defined(macintosh)
  if (!build_app_module)
  {
    /*
     *  Entry point name includes "lib" for Unix platforms.
     */
    strcat(entry_name, "lib");
    strcat(class_name, "lib");
  }
#endif

  if (strlen(cpp_module_name) > 0)
    cpp_exists = 1;
  else
    cpp_exists = 0;
  i = strlen(entry_name);
  j = 0;
  k = strlen(class_name);
  while (modulename[j] != 0)
  {
    if (isupper(modulename[j]))
	entry_name[i] = tolower(modulename[j]);
    else
        entry_name[i] = modulename[j];
    class_name[k] = entry_name[i];
    i++;
    j++;
    k++;
  }
  entry_name[i] = 0;
  class_name[k] = 0;

  COUTPUT(("static MODULETAB ModuleDescriptorTable = {\n"));
  COUTPUT(("\tMODULE_SYSTEM, &mod_dscr\n};\n\n"));
 
  /*
   *  Do some platform-specific init code here, for those platforms
   *  that need it.  Do -not- do this if we are also creating a
   *  C++ init module.
   */ 
#if defined(linux)
  if (!cpp_exists && !build_app_module)
  {
    COUTPUT(("LIBENTRY_DECL(%s);\n",entry_name));
#ifdef LATER
    COUTPUT(("void %s()", entry_name));
    COUTPUT((" __attribute__ ((section(\".init\")));\n"));
#endif
  }
#endif
  COUTPUT(("HINSTANCE    InternalLoadDLL(MODULETAB *);\n"));
  COUTPUT(("\n"));
#if defined (macintosh)
  COUTPUT(("short\n"));
#else
  COUTPUT(("void\n"));
#endif
  COUTPUT(("%s()\n", entry_name));
  COUTPUT(("{\n"));
  COUTPUT(("\tLOGSTR((LF_CONSOLE,\"LoadLibrary: %%s \\n\",\n"));
  COUTPUT(("\t       ModuleDescriptorTable.dscr->name));\n"));
#if defined(linux)
  /*
   * On linux, -Bsymbolic does not do the right thing for
   * for symbols stored as initialized data, so we have to
   * make sure we set the functions dynamically before using
   * the table.
   */
  COUTPUT(("\tentry_tab_default[0].fun = %s;\n", libentry_name));
  for(n = 1;n<max+1;n++)
    if(functions[n] && (strlen(functions[n]) != 0))
      COUTPUT(("\tentry_tab_default[%d].fun = %s;\n", n, functions[n]));
#endif
  COUTPUT(("\tInternalLoadDLL(&ModuleDescriptorTable);\n"));
#if defined (macintosh)
  COUTPUT(("return(0);\n"));
#endif
  COUTPUT(("}\n"));

  EOUTPUT(("%s\n", entry_name));

  /*
   *  Now write out the C++ init code, if a C++ module has been requested.
   *  This creates a dummy class with a single static global instance
   *  of that class.  The constructor will call our init routine, which
   *  will initialize us when the library is loaded, due to global
   *  constructors being called.
   */
  if (cpp_exists)
  {
    CPPOUTPUT(("extern \"C\" void %s();\n", entry_name));
    CPPOUTPUT(("class %s\n", class_name));
    CPPOUTPUT(("{\n"));
    CPPOUTPUT(("public:\n"));
    CPPOUTPUT(("    %s();\n", class_name));
    CPPOUTPUT(("};\n"));
    CPPOUTPUT(("static %s TWIN_dummy;\n", class_name));
    CPPOUTPUT(("%s::%s()\n", class_name, class_name));
    CPPOUTPUT(("{\n"));
    CPPOUTPUT(("    %s();\n", entry_name));
    CPPOUTPUT(("}\n"));
  }
}
Ejemplo n.º 24
0
void print_resources(void)
{
  TYPEINFO *type_ptr;
  int i;

  COUTPUT(("/* TWIN Resource Compiler Version " RC_VERSION " */\n"));
  COUTPUT(("\n"));
  COUTPUT(("#define NOAPIPROTO\n"));
  COUTPUT(("\n"));
  COUTPUT(("#include \"windows.h\"\n"));
  COUTPUT(("#include \"Resources.h\"\n"));
  COUTPUT(("\n"));
  for(i = 0; i < MAX_TYPES; i++)
  {
    type_ptr = resource_table + i;
    if (type_ptr->rcscount > 0 )
      print_func(type_ptr);
  }
  
  parse_module();      /* Load the Module Definition file */

  COUTPUT(("%sTYPEINFO hsmt_resource_%s[] = {\n",
      (strlen(tbl_name))?"":"static ",
      (strlen(tbl_name))?tbl_name:"table"));

  for (i = 0; i < MAX_TYPES; i++)
    {
      type_ptr = resource_table + i;
      if (type_ptr->rcscount > 0 )
	{
	  if (HIWORD((DWORD)type_ptr->rcstypename) == 0)
	    COUTPUT(( "\t{ (char *) %d, ", LOWORD((DWORD)type_ptr->rcstypename)));
	  else
	    COUTPUT(( "\t{ \"%s\", ", type_ptr->rcstypename));
	  COUTPUT(( " %d, ", type_ptr->rcscount));
	  if ((HIWORD((DWORD)type_ptr->rcstypename) == 0) &&
	      (LOWORD((DWORD)type_ptr->rcstypename) < 16))
	    COUTPUT(( " %s },\n", info_name_tbl[LOWORD((DWORD)type_ptr->rcstypename) - 1]));
	  else
	    if (HIWORD(type_ptr->rcstypename) == 0)
	      COUTPUT(( "u%d_info},\n", (int)type_ptr->rcstypename));
	    else
	      COUTPUT(( "%s_info},\n", type_ptr->rcstypename));
	  
	}
    }
  print_last_entry(3);
  COUTPUT(("};\n\n"));
  print_module();
}
Ejemplo n.º 25
0
void print_menu_name(int i, NAMEINFO *info, char *title)
{
  COUTPUT(( "\t{ (LPBYTE)%s_%x, ", title, (int)(info->rcsdata)));
}
Ejemplo n.º 26
0
void print_name(int i, NAMEINFO *info, char *title)
{
  COUTPUT(( "\t{ (LPBYTE)%s_data_%d, ", title, i));
}
Ejemplo n.º 27
0
void print_toolbar_res(int i, NAMEINFO *info)
{
  TOOLBAR_NODE *toolbar_node;
  TOOLBARDATA *toolbar_data;
  WORD item;

  toolbar_node = (TOOLBAR_NODE *)(info->rcsdata);
  toolbar_data = &(toolbar_node->data);

  COUTPUT(("static TOOLBARDATA u241_data_%d =\n", i));
  COUTPUT(("{\n"));
  COUTPUT(("\t%d,\t/* wVersion   */\n", toolbar_data->wVersion));
  COUTPUT(("\t%d,\t/* wWidth     */\n", toolbar_data->wWidth));
  COUTPUT(("\t%d,\t/* wHeight    */\n", toolbar_data->wHeight));
  COUTPUT(("\t%d,\t/* wItemCount */\n", toolbar_data->wItemCount));
  if (toolbar_data->wItemCount != 0)
    COUTPUT(("\t{\t/* aItems[]   */\n"));
  for (item = 0; item < toolbar_data->wItemCount; item++)
    COUTPUT(("\t\t%d,\n", toolbar_data->aItems[item]));
  if (toolbar_data->wItemCount != 0)
    COUTPUT(("\t}\n"));
  COUTPUT(("};\n"));
  COUTPUT(("\n"));

}