Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Enumerations | Functions | Variables
windres.h File Reference
#include "ansidecl.h"
#include "winduni.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  res_directory
struct  res_id
struct  res_entry
struct  res_res_info
struct  res_coff_info
struct  res_resource
struct  accelerator
struct  cursor
struct  group_cursor
struct  dialog
struct  dialog_ex
struct  dialog_control
struct  fontdir
struct  group_icon
struct  menu
struct  menuitem
struct  rcdata_item
struct  stringtable
struct  versioninfo
struct  fixed_versioninfo
struct  ver_info
struct  ver_stringinfo
struct  ver_varinfo
struct  bindata
union  res_id.u
struct  res_id.u.n
union  res_entry.u
union  res_resource.u
struct  res_resource.u.data
union  rcdata_item.u
struct  rcdata_item.u.string
struct  rcdata_item.u.wstring
struct  rcdata_item.u.buffer
struct  stringtable.strings
union  ver_info.u
struct  ver_info.u.string
struct  ver_info.u.var

Defines

#define SUBLANG_SHIFT   10
#define MEMFLAG_MOVEABLE   0x10
#define MEMFLAG_PURE   0x20
#define MEMFLAG_PRELOAD   0x40
#define MEMFLAG_DISCARDABLE   0x1000
#define RT_CURSOR   1
#define RT_BITMAP   2
#define RT_ICON   3
#define RT_MENU   4
#define RT_DIALOG   5
#define RT_STRING   6
#define RT_FONTDIR   7
#define RT_FONT   8
#define RT_ACCELERATOR   9
#define RT_RCDATA   10
#define RT_MESSAGETABLE   11
#define RT_GROUP_CURSOR   12
#define RT_GROUP_ICON   14
#define RT_VERSION   16
#define RT_DLGINCLUDE   17
#define RT_PLUGPLAY   19
#define RT_VXD   20
#define RT_ANICURSOR   21
#define RT_ANIICON   22
#define ACC_VIRTKEY   0x01
#define ACC_NOINVERT   0x02
#define ACC_SHIFT   0x04
#define ACC_CONTROL   0x08
#define ACC_ALT   0x10
#define ACC_LAST   0x80
#define CW_USEDEFAULT   (0x80000000)
#define WS_BORDER   (0x800000L)
#define WS_CAPTION   (0xc00000L)
#define WS_CHILD   (0x40000000L)
#define WS_CHILDWINDOW   (0x40000000L)
#define WS_CLIPCHILDREN   (0x2000000L)
#define WS_CLIPSIBLINGS   (0x4000000L)
#define WS_DISABLED   (0x8000000L)
#define WS_DLGFRAME   (0x400000L)
#define WS_GROUP   (0x20000L)
#define WS_HSCROLL   (0x100000L)
#define WS_ICONIC   (0x20000000L)
#define WS_MAXIMIZE   (0x1000000L)
#define WS_MAXIMIZEBOX   (0x10000L)
#define WS_MINIMIZE   (0x20000000L)
#define WS_MINIMIZEBOX   (0x20000L)
#define WS_OVERLAPPED   (0L)
#define WS_OVERLAPPEDWINDOW   (0xcf0000L)
#define WS_POPUP   (0x80000000L)
#define WS_POPUPWINDOW   (0x80880000L)
#define WS_SIZEBOX   (0x40000L)
#define WS_SYSMENU   (0x80000L)
#define WS_TABSTOP   (0x10000L)
#define WS_THICKFRAME   (0x40000L)
#define WS_TILED   (0L)
#define WS_TILEDWINDOW   (0xcf0000L)
#define WS_VISIBLE   (0x10000000L)
#define WS_VSCROLL   (0x200000L)
#define MDIS_ALLCHILDSTYLES   (0x1)
#define BS_3STATE   (0x5L)
#define BS_AUTO3STATE   (0x6L)
#define BS_AUTOCHECKBOX   (0x3L)
#define BS_AUTORADIOBUTTON   (0x9L)
#define BS_BITMAP   (0x80L)
#define BS_BOTTOM   (0x800L)
#define BS_CENTER   (0x300L)
#define BS_CHECKBOX   (0x2L)
#define BS_DEFPUSHBUTTON   (0x1L)
#define BS_GROUPBOX   (0x7L)
#define BS_ICON   (0x40L)
#define BS_LEFT   (0x100L)
#define BS_LEFTTEXT   (0x20L)
#define BS_MULTILINE   (0x2000L)
#define BS_NOTIFY   (0x4000L)
#define BS_OWNERDRAW   (0xbL)
#define BS_PUSHBOX   (0xcL) /* FIXME! What should this be? */
#define BS_PUSHBUTTON   (0L)
#define BS_PUSHLIKE   (0x1000L)
#define BS_RADIOBUTTON   (0x4L)
#define BS_RIGHT   (0x200L)
#define BS_RIGHTBUTTON   (0x20L)
#define BS_TEXT   (0L)
#define BS_TOP   (0x400L)
#define BS_USERBUTTON   (0x8L)
#define BS_VCENTER   (0xc00L)
#define CBS_AUTOHSCROLL   (0x40L)
#define CBS_DISABLENOSCROLL   (0x800L)
#define CBS_DROPDOWN   (0x2L)
#define CBS_DROPDOWNLIST   (0x3L)
#define CBS_HASSTRINGS   (0x200L)
#define CBS_LOWERCASE   (0x4000L)
#define CBS_NOINTEGRALHEIGHT   (0x400L)
#define CBS_OEMCONVERT   (0x80L)
#define CBS_OWNERDRAWFIXED   (0x10L)
#define CBS_OWNERDRAWVARIABLE   (0x20L)
#define CBS_SIMPLE   (0x1L)
#define CBS_SORT   (0x100L)
#define CBS_UPPERCASE   (0x2000L)
#define ES_AUTOHSCROLL   (0x80L)
#define ES_AUTOVSCROLL   (0x40L)
#define ES_CENTER   (0x1L)
#define ES_LEFT   (0L)
#define ES_LOWERCASE   (0x10L)
#define ES_MULTILINE   (0x4L)
#define ES_NOHIDESEL   (0x100L)
#define ES_NUMBER   (0x2000L)
#define ES_OEMCONVERT   (0x400L)
#define ES_PASSWORD   (0x20L)
#define ES_READONLY   (0x800L)
#define ES_RIGHT   (0x2L)
#define ES_UPPERCASE   (0x8L)
#define ES_WANTRETURN   (0x1000L)
#define LBS_DISABLENOSCROLL   (0x1000L)
#define LBS_EXTENDEDSEL   (0x800L)
#define LBS_HASSTRINGS   (0x40L)
#define LBS_MULTICOLUMN   (0x200L)
#define LBS_MULTIPLESEL   (0x8L)
#define LBS_NODATA   (0x2000L)
#define LBS_NOINTEGRALHEIGHT   (0x100L)
#define LBS_NOREDRAW   (0x4L)
#define LBS_NOSEL   (0x4000L)
#define LBS_NOTIFY   (0x1L)
#define LBS_OWNERDRAWFIXED   (0x10L)
#define LBS_OWNERDRAWVARIABLE   (0x20L)
#define LBS_SORT   (0x2L)
#define LBS_STANDARD   (0xa00003L)
#define LBS_USETABSTOPS   (0x80L)
#define LBS_WANTKEYBOARDINPUT   (0x400L)
#define SBS_BOTTOMALIGN   (0x4L)
#define SBS_HORZ   (0L)
#define SBS_LEFTALIGN   (0x2L)
#define SBS_RIGHTALIGN   (0x4L)
#define SBS_SIZEBOX   (0x8L)
#define SBS_SIZEBOXBOTTOMRIGHTALIGN   (0x4L)
#define SBS_SIZEBOXTOPLEFTALIGN   (0x2L)
#define SBS_SIZEGRIP   (0x10L)
#define SBS_TOPALIGN   (0x2L)
#define SBS_VERT   (0x1L)
#define SS_BITMAP   (0xeL)
#define SS_BLACKFRAME   (0x7L)
#define SS_BLACKRECT   (0x4L)
#define SS_CENTER   (0x1L)
#define SS_CENTERIMAGE   (0x200L)
#define SS_ENHMETAFILE   (0xfL)
#define SS_ETCHEDFRAME   (0x12L)
#define SS_ETCHEDHORZ   (0x10L)
#define SS_ETCHEDVERT   (0x11L)
#define SS_GRAYFRAME   (0x8L)
#define SS_GRAYRECT   (0x5L)
#define SS_ICON   (0x3L)
#define SS_LEFT   (0L)
#define SS_LEFTNOWORDWRAP   (0xcL)
#define SS_NOPREFIX   (0x80L)
#define SS_NOTIFY   (0x100L)
#define SS_OWNERDRAW   (0xdL)
#define SS_REALSIZEIMAGE   (0x800L)
#define SS_RIGHT   (0x2L)
#define SS_RIGHTJUST   (0x400L)
#define SS_SIMPLE   (0xbL)
#define SS_SUNKEN   (0x1000L)
#define SS_USERITEM   (0xaL)
#define SS_WHITEFRAME   (0x9L)
#define SS_WHITERECT   (0x6L)
#define DS_3DLOOK   (0x4L)
#define DS_ABSALIGN   (0x1L)
#define DS_CENTER   (0x800L)
#define DS_CENTERMOUSE   (0x1000L)
#define DS_CONTEXTHELP   (0x2000L)
#define DS_CONTROL   (0x400L)
#define DS_FIXEDSYS   (0x8L)
#define DS_LOCALEDIT   (0x20L)
#define DS_MODALFRAME   (0x80L)
#define DS_NOFAILCREATE   (0x10L)
#define DS_NOIDLEMSG   (0x100L)
#define DS_SETFONT   (0x40L)
#define DS_SETFOREGROUND   (0x200L)
#define DS_SYSMODAL   (0x2L)
#define CTL_BUTTON   0x80
#define CTL_EDIT   0x81
#define CTL_STATIC   0x82
#define CTL_LISTBOX   0x83
#define CTL_SCROLLBAR   0x84
#define CTL_COMBOBOX   0x85
#define MENUITEM_GRAYED   0x001
#define MENUITEM_INACTIVE   0x002
#define MENUITEM_BITMAP   0x004
#define MENUITEM_OWNERDRAW   0x100
#define MENUITEM_CHECKED   0x008
#define MENUITEM_POPUP   0x010
#define MENUITEM_MENUBARBREAK   0x020
#define MENUITEM_MENUBREAK   0x040
#define MENUITEM_ENDMENU   0x080
#define MENUITEM_HELP   0x4000

Enumerations

enum  res_type {
  RES_TYPE_UNINITIALIZED, RES_TYPE_ACCELERATOR, RES_TYPE_BITMAP, RES_TYPE_CURSOR,
  RES_TYPE_GROUP_CURSOR, RES_TYPE_DIALOG, RES_TYPE_FONT, RES_TYPE_FONTDIR,
  RES_TYPE_ICON, RES_TYPE_GROUP_ICON, RES_TYPE_MENU, RES_TYPE_MESSAGETABLE,
  RES_TYPE_RCDATA, RES_TYPE_STRINGTABLE, RES_TYPE_USERDATA, RES_TYPE_VERSIONINFO
}

Functions

struct res_directoryread_rc_file (const char *, const char *, const char *, int, int)
struct res_directoryread_res_file (const char *)
struct res_directoryread_coff_rsrc (const char *, const char *)
void write_rc_file (const char *, const struct res_directory *)
void write_res_file (const char *, const struct res_directory *)
void write_coff_file (const char *, const char *, const struct res_directory *)
struct res_resourcebin_to_res (struct res_id, const unsigned char *, unsigned long, int)
struct bindatares_to_bin (const struct res_resource *, int)
FILE * open_file_search (const char *, const char *, const char *, char **)
void * res_alloc (size_t)
void * reswr_alloc (size_t)
int res_id_cmp (struct res_id, struct res_id)
void res_id_print (FILE *, struct res_id, int)
void res_ids_print (FILE *, int, const struct res_id *)
void res_string_to_id (struct res_id *, const char *)
struct res_resourcedefine_resource (struct res_directory **, int, const struct res_id *, int)
struct res_resourcedefine_standard_resource (struct res_directory **, int, struct res_id, int, int)
int extended_dialog (const struct dialog *)
int extended_menu (const struct menu *)
int yyparse (void)
int yylex (void)
void yyerror (const char *)
void rcparse_warning (const char *)
void rcparse_set_language (int)
void rcparse_discard_strings (void)
void rcparse_rcdata (void)
void rcparse_normal (void)
void define_accelerator (struct res_id, const struct res_res_info *, struct accelerator *)
void define_bitmap (struct res_id, const struct res_res_info *, const char *)
void define_cursor (struct res_id, const struct res_res_info *, const char *)
void define_dialog (struct res_id, const struct res_res_info *, const struct dialog *)
struct dialog_controldefine_control (const struct res_id, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)
struct dialog_controldefine_icon_control (struct res_id, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, struct rcdata_item *, struct dialog_ex *)
void define_font (struct res_id, const struct res_res_info *, const char *)
void define_icon (struct res_id, const struct res_res_info *, const char *)
void define_menu (struct res_id, const struct res_res_info *, struct menuitem *)
struct menuitemdefine_menuitem (const char *, int, unsigned long, unsigned long, unsigned long, struct menuitem *)
void define_messagetable (struct res_id, const struct res_res_info *, const char *)
void define_rcdata (struct res_id, const struct res_res_info *, struct rcdata_item *)
void define_rcdata_file (struct res_id, const struct res_res_info *, const char *)
struct rcdata_itemdefine_rcdata_string (const char *, unsigned long)
struct rcdata_itemdefine_rcdata_number (unsigned long, int)
void define_stringtable (const struct res_res_info *, unsigned long, const char *)
void define_user_data (struct res_id, struct res_id, const struct res_res_info *, struct rcdata_item *)
void define_user_file (struct res_id, struct res_id, const struct res_res_info *, const char *)
void define_versioninfo (struct res_id, int, struct fixed_versioninfo *, struct ver_info *)
struct ver_infoappend_ver_stringfileinfo (struct ver_info *, const char *, struct ver_stringinfo *)
struct ver_infoappend_ver_varfileinfo (struct ver_info *, const char *, struct ver_varinfo *)
struct ver_stringinfoappend_verval (struct ver_stringinfo *, const char *, const char *)
struct ver_varinfoappend_vertrans (struct ver_varinfo *, unsigned long, unsigned long)

Variables

int verbose
int yydebug
FILE * yyin
char * rc_filename
int rc_lineno

Class Documentation

struct res_directory

Definition at line 34 of file windres.h.

Collaboration diagram for res_directory:
Class Members
unsigned long characteristics
struct res_entry * entries
unsigned short major
unsigned short minor
unsigned long time
struct res_id

Definition at line 51 of file windres.h.

Class Members
unsigned int named: 1
union res_id u
struct res_entry

Definition at line 75 of file windres.h.

Collaboration diagram for res_entry:
Class Members
struct res_entry * next
unsigned int subdir: 1
union res_entry u
struct res_res_info

Definition at line 120 of file windres.h.

Class Members
unsigned long characteristics
unsigned short language
unsigned short memflags
unsigned long version
struct res_coff_info

Definition at line 145 of file windres.h.

Class Members
unsigned long codepage
unsigned long reserved
struct res_resource

Definition at line 158 of file windres.h.

Class Members
enum res_type union res_resource u
struct accelerator

Definition at line 222 of file windres.h.

Collaboration diagram for accelerator:
Class Members
unsigned short flags
unsigned short id
unsigned short key
struct accelerator * next
struct cursor

Definition at line 246 of file windres.h.

Class Members
const unsigned char * data
unsigned long length
short xhotspot
short yhotspot
struct group_cursor

Definition at line 260 of file windres.h.

Collaboration diagram for group_cursor:
Class Members
unsigned short bits
unsigned long bytes
unsigned short height
unsigned short index
struct group_cursor * next
unsigned short planes
unsigned short width
struct dialog

Definition at line 280 of file windres.h.

Collaboration diagram for dialog:
Class Members
unichar * caption
struct dialog_control * controls
struct dialog_ex * ex
unsigned long exstyle
unichar * font
unsigned short height
unsigned short pointsize
unsigned long style
unsigned short width
unsigned short x
unsigned short y
struct dialog_ex

Definition at line 312 of file windres.h.

Class Members
unsigned char charset
unsigned long help
unsigned char italic
unsigned short weight
struct dialog_control

Definition at line 478 of file windres.h.

Collaboration diagram for dialog_control:
Class Members
struct rcdata_item * data
unsigned long exstyle
unsigned short height
unsigned long help
unsigned short id
struct dialog_control * next
unsigned long style
unsigned short width
unsigned short x
unsigned short y
struct fontdir

Definition at line 518 of file windres.h.

Collaboration diagram for fontdir:
Class Members
const unsigned char * data
short index
unsigned long length
struct fontdir * next
struct group_icon

Definition at line 531 of file windres.h.

Collaboration diagram for group_icon:
Class Members
unsigned short bits
unsigned long bytes
unsigned char colors
unsigned char height
unsigned short index
struct group_icon * next
unsigned short planes
unsigned char width
struct menu

Definition at line 553 of file windres.h.

Collaboration diagram for menu:
Class Members
unsigned long help
struct menuitem * items
struct menuitem

Definition at line 564 of file windres.h.

Collaboration diagram for menuitem:
Class Members
unsigned long help
unsigned short id
struct menuitem * next
struct menuitem * popup
unsigned long state
unichar * text
unsigned long type
struct stringtable

Definition at line 637 of file windres.h.

Class Members
struct stringtable strings
struct versioninfo

Definition at line 651 of file windres.h.

Collaboration diagram for versioninfo:
Class Members
struct fixed_versioninfo * fixed
struct ver_info * var
struct fixed_versioninfo

Definition at line 661 of file windres.h.

Class Members
unsigned long file_date_ls
unsigned long file_date_ms
unsigned long file_flags
unsigned long file_flags_mask
unsigned long file_os
unsigned long file_subtype
unsigned long file_type
unsigned long file_version_ls
unsigned long file_version_ms
unsigned long product_version_ls
unsigned long product_version_ms
struct ver_stringinfo

Definition at line 715 of file windres.h.

Collaboration diagram for ver_stringinfo:
Class Members
unichar * key
struct ver_stringinfo * next
unichar * value
struct ver_varinfo

Definition at line 727 of file windres.h.

Collaboration diagram for ver_varinfo:
Class Members
unsigned short charset
unsigned short language
struct ver_varinfo * next
struct bindata

Definition at line 740 of file windres.h.

Collaboration diagram for bindata:
Class Members
unsigned char * data
unsigned long length
struct bindata * next
union res_id.u

Definition at line 55 of file windres.h.

Class Members
unsigned long id
u n
struct res_id.u.n

Definition at line 58 of file windres.h.

Class Members
int length
unichar * name
union res_entry.u

Definition at line 83 of file windres.h.

Class Members
struct res_directory * dir
struct res_resource * res
union res_resource.u

Definition at line 163 of file windres.h.

Class Members
struct accelerator * acc
struct cursor * cursor
u data
struct dialog * dialog
struct fontdir * fontdir
struct group_cursor * group_cursor
struct group_icon * group_icon
struct menu * menu
struct rcdata_item * rcdata
struct stringtable * stringtable
struct rcdata_item * userdata
struct versioninfo * versioninfo
struct res_resource.u.data

Definition at line 165 of file windres.h.

Class Members
const unsigned char * data
unsigned long length
union rcdata_item.u

Definition at line 613 of file windres.h.

Class Members
u buffer
unsigned long dword
u string
unsigned int word
u wstring
struct rcdata_item.u.string

Definition at line 617 of file windres.h.

Class Members
unsigned long length
const char * s
struct rcdata_item.u.wstring

Definition at line 622 of file windres.h.

Class Members
unsigned long length
const unichar * w
struct rcdata_item.u.buffer

Definition at line 627 of file windres.h.

Class Members
const unsigned char * data
unsigned long length
struct stringtable.strings

Definition at line 640 of file windres.h.

Class Members
int length
unichar * string
union ver_info.u

Definition at line 692 of file windres.h.

Class Members
u string
u var
struct ver_info.u.string

Definition at line 695 of file windres.h.

Class Members
unichar * language
struct ver_stringinfo * strings
struct ver_info.u.var

Definition at line 703 of file windres.h.

Class Members
unichar * key
struct ver_varinfo * var

Define Documentation

#define ACC_ALT   0x10

Definition at line 241 of file windres.h.

#define ACC_CONTROL   0x08

Definition at line 240 of file windres.h.

#define ACC_LAST   0x80

Definition at line 242 of file windres.h.

#define ACC_NOINVERT   0x02

Definition at line 238 of file windres.h.

#define ACC_SHIFT   0x04

Definition at line 239 of file windres.h.

#define ACC_VIRTKEY   0x01

Definition at line 237 of file windres.h.

#define BS_3STATE   (0x5L)

Definition at line 357 of file windres.h.

#define BS_AUTO3STATE   (0x6L)

Definition at line 358 of file windres.h.

#define BS_AUTOCHECKBOX   (0x3L)

Definition at line 359 of file windres.h.

#define BS_AUTORADIOBUTTON   (0x9L)

Definition at line 360 of file windres.h.

#define BS_BITMAP   (0x80L)

Definition at line 361 of file windres.h.

#define BS_BOTTOM   (0x800L)

Definition at line 362 of file windres.h.

#define BS_CENTER   (0x300L)

Definition at line 363 of file windres.h.

#define BS_CHECKBOX   (0x2L)

Definition at line 364 of file windres.h.

#define BS_DEFPUSHBUTTON   (0x1L)

Definition at line 365 of file windres.h.

#define BS_GROUPBOX   (0x7L)

Definition at line 366 of file windres.h.

#define BS_ICON   (0x40L)

Definition at line 367 of file windres.h.

#define BS_LEFT   (0x100L)

Definition at line 368 of file windres.h.

#define BS_LEFTTEXT   (0x20L)

Definition at line 369 of file windres.h.

#define BS_MULTILINE   (0x2000L)

Definition at line 370 of file windres.h.

#define BS_NOTIFY   (0x4000L)

Definition at line 371 of file windres.h.

#define BS_OWNERDRAW   (0xbL)

Definition at line 372 of file windres.h.

#define BS_PUSHBOX   (0xcL) /* FIXME! What should this be? */

Definition at line 373 of file windres.h.

#define BS_PUSHBUTTON   (0L)

Definition at line 374 of file windres.h.

#define BS_PUSHLIKE   (0x1000L)

Definition at line 375 of file windres.h.

#define BS_RADIOBUTTON   (0x4L)

Definition at line 376 of file windres.h.

#define BS_RIGHT   (0x200L)

Definition at line 377 of file windres.h.

#define BS_RIGHTBUTTON   (0x20L)

Definition at line 378 of file windres.h.

#define BS_TEXT   (0L)

Definition at line 379 of file windres.h.

#define BS_TOP   (0x400L)

Definition at line 380 of file windres.h.

#define BS_USERBUTTON   (0x8L)

Definition at line 381 of file windres.h.

#define BS_VCENTER   (0xc00L)

Definition at line 382 of file windres.h.

#define CBS_AUTOHSCROLL   (0x40L)

Definition at line 383 of file windres.h.

#define CBS_DISABLENOSCROLL   (0x800L)

Definition at line 384 of file windres.h.

#define CBS_DROPDOWN   (0x2L)

Definition at line 385 of file windres.h.

#define CBS_DROPDOWNLIST   (0x3L)

Definition at line 386 of file windres.h.

#define CBS_HASSTRINGS   (0x200L)

Definition at line 387 of file windres.h.

#define CBS_LOWERCASE   (0x4000L)

Definition at line 388 of file windres.h.

#define CBS_NOINTEGRALHEIGHT   (0x400L)

Definition at line 389 of file windres.h.

#define CBS_OEMCONVERT   (0x80L)

Definition at line 390 of file windres.h.

#define CBS_OWNERDRAWFIXED   (0x10L)

Definition at line 391 of file windres.h.

#define CBS_OWNERDRAWVARIABLE   (0x20L)

Definition at line 392 of file windres.h.

#define CBS_SIMPLE   (0x1L)

Definition at line 393 of file windres.h.

#define CBS_SORT   (0x100L)

Definition at line 394 of file windres.h.

#define CBS_UPPERCASE   (0x2000L)

Definition at line 395 of file windres.h.

#define CTL_BUTTON   0x80

Definition at line 509 of file windres.h.

#define CTL_COMBOBOX   0x85

Definition at line 514 of file windres.h.

#define CTL_EDIT   0x81

Definition at line 510 of file windres.h.

#define CTL_LISTBOX   0x83

Definition at line 512 of file windres.h.

#define CTL_SCROLLBAR   0x84

Definition at line 513 of file windres.h.

#define CTL_STATIC   0x82

Definition at line 511 of file windres.h.

#define CW_USEDEFAULT   (0x80000000)

Definition at line 328 of file windres.h.

#define DS_3DLOOK   (0x4L)

Definition at line 461 of file windres.h.

#define DS_ABSALIGN   (0x1L)

Definition at line 462 of file windres.h.

#define DS_CENTER   (0x800L)

Definition at line 463 of file windres.h.

#define DS_CENTERMOUSE   (0x1000L)

Definition at line 464 of file windres.h.

#define DS_CONTEXTHELP   (0x2000L)

Definition at line 465 of file windres.h.

#define DS_CONTROL   (0x400L)

Definition at line 466 of file windres.h.

#define DS_FIXEDSYS   (0x8L)

Definition at line 467 of file windres.h.

#define DS_LOCALEDIT   (0x20L)

Definition at line 468 of file windres.h.

#define DS_MODALFRAME   (0x80L)

Definition at line 469 of file windres.h.

#define DS_NOFAILCREATE   (0x10L)

Definition at line 470 of file windres.h.

#define DS_NOIDLEMSG   (0x100L)

Definition at line 471 of file windres.h.

#define DS_SETFONT   (0x40L)

Definition at line 472 of file windres.h.

#define DS_SETFOREGROUND   (0x200L)

Definition at line 473 of file windres.h.

#define DS_SYSMODAL   (0x2L)

Definition at line 474 of file windres.h.

#define ES_AUTOHSCROLL   (0x80L)

Definition at line 396 of file windres.h.

#define ES_AUTOVSCROLL   (0x40L)

Definition at line 397 of file windres.h.

#define ES_CENTER   (0x1L)

Definition at line 398 of file windres.h.

#define ES_LEFT   (0L)

Definition at line 399 of file windres.h.

#define ES_LOWERCASE   (0x10L)

Definition at line 400 of file windres.h.

#define ES_MULTILINE   (0x4L)

Definition at line 401 of file windres.h.

#define ES_NOHIDESEL   (0x100L)

Definition at line 402 of file windres.h.

#define ES_NUMBER   (0x2000L)

Definition at line 403 of file windres.h.

#define ES_OEMCONVERT   (0x400L)

Definition at line 404 of file windres.h.

#define ES_PASSWORD   (0x20L)

Definition at line 405 of file windres.h.

#define ES_READONLY   (0x800L)

Definition at line 406 of file windres.h.

#define ES_RIGHT   (0x2L)

Definition at line 407 of file windres.h.

#define ES_UPPERCASE   (0x8L)

Definition at line 408 of file windres.h.

#define ES_WANTRETURN   (0x1000L)

Definition at line 409 of file windres.h.

#define LBS_DISABLENOSCROLL   (0x1000L)

Definition at line 410 of file windres.h.

#define LBS_EXTENDEDSEL   (0x800L)

Definition at line 411 of file windres.h.

#define LBS_HASSTRINGS   (0x40L)

Definition at line 412 of file windres.h.

#define LBS_MULTICOLUMN   (0x200L)

Definition at line 413 of file windres.h.

#define LBS_MULTIPLESEL   (0x8L)

Definition at line 414 of file windres.h.

#define LBS_NODATA   (0x2000L)

Definition at line 415 of file windres.h.

#define LBS_NOINTEGRALHEIGHT   (0x100L)

Definition at line 416 of file windres.h.

#define LBS_NOREDRAW   (0x4L)

Definition at line 417 of file windres.h.

#define LBS_NOSEL   (0x4000L)

Definition at line 418 of file windres.h.

#define LBS_NOTIFY   (0x1L)

Definition at line 419 of file windres.h.

#define LBS_OWNERDRAWFIXED   (0x10L)

Definition at line 420 of file windres.h.

#define LBS_OWNERDRAWVARIABLE   (0x20L)

Definition at line 421 of file windres.h.

#define LBS_SORT   (0x2L)

Definition at line 422 of file windres.h.

#define LBS_STANDARD   (0xa00003L)

Definition at line 423 of file windres.h.

#define LBS_USETABSTOPS   (0x80L)

Definition at line 424 of file windres.h.

#define LBS_WANTKEYBOARDINPUT   (0x400L)

Definition at line 425 of file windres.h.

#define MDIS_ALLCHILDSTYLES   (0x1)

Definition at line 356 of file windres.h.

#define MEMFLAG_DISCARDABLE   0x1000

Definition at line 195 of file windres.h.

#define MEMFLAG_MOVEABLE   0x10

Definition at line 192 of file windres.h.

#define MEMFLAG_PRELOAD   0x40

Definition at line 194 of file windres.h.

#define MEMFLAG_PURE   0x20

Definition at line 193 of file windres.h.

#define MENUITEM_BITMAP   0x004

Definition at line 588 of file windres.h.

#define MENUITEM_CHECKED   0x008

Definition at line 590 of file windres.h.

#define MENUITEM_ENDMENU   0x080

Definition at line 594 of file windres.h.

#define MENUITEM_GRAYED   0x001

Definition at line 586 of file windres.h.

#define MENUITEM_HELP   0x4000

Definition at line 595 of file windres.h.

#define MENUITEM_INACTIVE   0x002

Definition at line 587 of file windres.h.

#define MENUITEM_MENUBARBREAK   0x020

Definition at line 592 of file windres.h.

#define MENUITEM_MENUBREAK   0x040

Definition at line 593 of file windres.h.

#define MENUITEM_OWNERDRAW   0x100

Definition at line 589 of file windres.h.

#define MENUITEM_POPUP   0x010

Definition at line 591 of file windres.h.

#define RT_ACCELERATOR   9

Definition at line 208 of file windres.h.

#define RT_ANICURSOR   21

Definition at line 217 of file windres.h.

#define RT_ANIICON   22

Definition at line 218 of file windres.h.

#define RT_BITMAP   2

Definition at line 201 of file windres.h.

#define RT_CURSOR   1

Definition at line 200 of file windres.h.

#define RT_DIALOG   5

Definition at line 204 of file windres.h.

#define RT_DLGINCLUDE   17

Definition at line 214 of file windres.h.

#define RT_FONT   8

Definition at line 207 of file windres.h.

#define RT_FONTDIR   7

Definition at line 206 of file windres.h.

#define RT_GROUP_CURSOR   12

Definition at line 211 of file windres.h.

#define RT_GROUP_ICON   14

Definition at line 212 of file windres.h.

#define RT_ICON   3

Definition at line 202 of file windres.h.

#define RT_MENU   4

Definition at line 203 of file windres.h.

#define RT_MESSAGETABLE   11

Definition at line 210 of file windres.h.

#define RT_PLUGPLAY   19

Definition at line 215 of file windres.h.

#define RT_RCDATA   10

Definition at line 209 of file windres.h.

#define RT_STRING   6

Definition at line 205 of file windres.h.

#define RT_VERSION   16

Definition at line 213 of file windres.h.

#define RT_VXD   20

Definition at line 216 of file windres.h.

#define SBS_BOTTOMALIGN   (0x4L)

Definition at line 426 of file windres.h.

#define SBS_HORZ   (0L)

Definition at line 427 of file windres.h.

#define SBS_LEFTALIGN   (0x2L)

Definition at line 428 of file windres.h.

#define SBS_RIGHTALIGN   (0x4L)

Definition at line 429 of file windres.h.

#define SBS_SIZEBOX   (0x8L)

Definition at line 430 of file windres.h.

#define SBS_SIZEBOXBOTTOMRIGHTALIGN   (0x4L)

Definition at line 431 of file windres.h.

#define SBS_SIZEBOXTOPLEFTALIGN   (0x2L)

Definition at line 432 of file windres.h.

#define SBS_SIZEGRIP   (0x10L)

Definition at line 433 of file windres.h.

#define SBS_TOPALIGN   (0x2L)

Definition at line 434 of file windres.h.

#define SBS_VERT   (0x1L)

Definition at line 435 of file windres.h.

#define SS_BITMAP   (0xeL)

Definition at line 436 of file windres.h.

#define SS_BLACKFRAME   (0x7L)

Definition at line 437 of file windres.h.

#define SS_BLACKRECT   (0x4L)

Definition at line 438 of file windres.h.

#define SS_CENTER   (0x1L)

Definition at line 439 of file windres.h.

#define SS_CENTERIMAGE   (0x200L)

Definition at line 440 of file windres.h.

#define SS_ENHMETAFILE   (0xfL)

Definition at line 441 of file windres.h.

#define SS_ETCHEDFRAME   (0x12L)

Definition at line 442 of file windres.h.

#define SS_ETCHEDHORZ   (0x10L)

Definition at line 443 of file windres.h.

#define SS_ETCHEDVERT   (0x11L)

Definition at line 444 of file windres.h.

#define SS_GRAYFRAME   (0x8L)

Definition at line 445 of file windres.h.

#define SS_GRAYRECT   (0x5L)

Definition at line 446 of file windres.h.

#define SS_ICON   (0x3L)

Definition at line 447 of file windres.h.

#define SS_LEFT   (0L)

Definition at line 448 of file windres.h.

#define SS_LEFTNOWORDWRAP   (0xcL)

Definition at line 449 of file windres.h.

#define SS_NOPREFIX   (0x80L)

Definition at line 450 of file windres.h.

#define SS_NOTIFY   (0x100L)

Definition at line 451 of file windres.h.

#define SS_OWNERDRAW   (0xdL)

Definition at line 452 of file windres.h.

#define SS_REALSIZEIMAGE   (0x800L)

Definition at line 453 of file windres.h.

#define SS_RIGHT   (0x2L)

Definition at line 454 of file windres.h.

#define SS_RIGHTJUST   (0x400L)

Definition at line 455 of file windres.h.

#define SS_SIMPLE   (0xbL)

Definition at line 456 of file windres.h.

#define SS_SUNKEN   (0x1000L)

Definition at line 457 of file windres.h.

#define SS_USERITEM   (0xaL)

Definition at line 458 of file windres.h.

#define SS_WHITEFRAME   (0x9L)

Definition at line 459 of file windres.h.

#define SS_WHITERECT   (0x6L)

Definition at line 460 of file windres.h.

#define SUBLANG_SHIFT   10

Definition at line 188 of file windres.h.

#define WS_BORDER   (0x800000L)

Definition at line 329 of file windres.h.

#define WS_CAPTION   (0xc00000L)

Definition at line 330 of file windres.h.

#define WS_CHILD   (0x40000000L)

Definition at line 331 of file windres.h.

#define WS_CHILDWINDOW   (0x40000000L)

Definition at line 332 of file windres.h.

#define WS_CLIPCHILDREN   (0x2000000L)

Definition at line 333 of file windres.h.

#define WS_CLIPSIBLINGS   (0x4000000L)

Definition at line 334 of file windres.h.

#define WS_DISABLED   (0x8000000L)

Definition at line 335 of file windres.h.

#define WS_DLGFRAME   (0x400000L)

Definition at line 336 of file windres.h.

#define WS_GROUP   (0x20000L)

Definition at line 337 of file windres.h.

#define WS_HSCROLL   (0x100000L)

Definition at line 338 of file windres.h.

#define WS_ICONIC   (0x20000000L)

Definition at line 339 of file windres.h.

#define WS_MAXIMIZE   (0x1000000L)

Definition at line 340 of file windres.h.

#define WS_MAXIMIZEBOX   (0x10000L)

Definition at line 341 of file windres.h.

#define WS_MINIMIZE   (0x20000000L)

Definition at line 342 of file windres.h.

#define WS_MINIMIZEBOX   (0x20000L)

Definition at line 343 of file windres.h.

#define WS_OVERLAPPED   (0L)

Definition at line 344 of file windres.h.

#define WS_OVERLAPPEDWINDOW   (0xcf0000L)

Definition at line 345 of file windres.h.

#define WS_POPUP   (0x80000000L)

Definition at line 346 of file windres.h.

#define WS_POPUPWINDOW   (0x80880000L)

Definition at line 347 of file windres.h.

#define WS_SIZEBOX   (0x40000L)

Definition at line 348 of file windres.h.

#define WS_SYSMENU   (0x80000L)

Definition at line 349 of file windres.h.

#define WS_TABSTOP   (0x10000L)

Definition at line 350 of file windres.h.

#define WS_THICKFRAME   (0x40000L)

Definition at line 351 of file windres.h.

#define WS_TILED   (0L)

Definition at line 352 of file windres.h.

#define WS_TILEDWINDOW   (0xcf0000L)

Definition at line 353 of file windres.h.

#define WS_VISIBLE   (0x10000000L)

Definition at line 354 of file windres.h.

#define WS_VSCROLL   (0x200000L)

Definition at line 355 of file windres.h.


Enumeration Type Documentation

enum res_type
Enumerator:
RES_TYPE_UNINITIALIZED 
RES_TYPE_ACCELERATOR 
RES_TYPE_BITMAP 
RES_TYPE_CURSOR 
RES_TYPE_GROUP_CURSOR 
RES_TYPE_DIALOG 
RES_TYPE_FONT 
RES_TYPE_FONTDIR 
RES_TYPE_ICON 
RES_TYPE_GROUP_ICON 
RES_TYPE_MENU 
RES_TYPE_MESSAGETABLE 
RES_TYPE_RCDATA 
RES_TYPE_STRINGTABLE 
RES_TYPE_USERDATA 
RES_TYPE_VERSIONINFO 

Definition at line 96 of file windres.h.


Function Documentation

Definition at line 1355 of file resrc.c.

{
  struct ver_info *vi, **pp;

  vi = (struct ver_info *) res_alloc (sizeof *vi);
  vi->next = NULL;
  vi->type = VERINFO_STRING;
  unicode_from_ascii ((int *) NULL, &vi->u.string.language, language);
  vi->u.string.strings = strings;

  for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next)
    ;
  *pp = vi;

  return verinfo;
}

Here is the call graph for this function:

Definition at line 1376 of file resrc.c.

{
  struct ver_info *vi, **pp;

  vi = (struct ver_info *) res_alloc (sizeof *vi);
  vi->next = NULL;
  vi->type = VERINFO_VAR;
  unicode_from_ascii ((int *) NULL, &vi->u.var.key, key);
  vi->u.var.var = var;

  for (pp = &verinfo; *pp != NULL; pp = &(*pp)->next)
    ;
  *pp = vi;

  return verinfo;
}

Here is the call graph for this function:

Definition at line 1417 of file resrc.c.

{
  struct ver_varinfo *vv, **pp;

  vv = (struct ver_varinfo *) res_alloc (sizeof *vv);
  vv->next = NULL;
  vv->language = language;
  vv->charset = charset;

  for (pp = &var; *pp != NULL; pp = &(*pp)->next)
    ;
  *pp = vv;

  return var;
}

Here is the call graph for this function:

struct ver_stringinfo* append_verval ( struct ver_stringinfo ,
const char *  ,
const char *   
) [read]

Definition at line 1397 of file resrc.c.

{
  struct ver_stringinfo *vs, **pp;

  vs = (struct ver_stringinfo *) res_alloc (sizeof *vs);
  vs->next = NULL;
  unicode_from_ascii ((int *) NULL, &vs->key, key);
  unicode_from_ascii ((int *) NULL, &vs->value, value);

  for (pp = &strings; *pp != NULL; pp = &(*pp)->next)
    ;
  *pp = vs;

  return strings;
}

Here is the call graph for this function:

struct res_resource* bin_to_res ( struct res_id  ,
const unsigned char *  ,
unsigned  long,
int   
) [read]

Definition at line 84 of file resbin.c.

{
  if (type.named)
    return bin_to_res_userdata (data, length, big_endian);
  else
    {
      switch (type.u.id)
       {
       default:
         return bin_to_res_userdata (data, length, big_endian);
       case RT_CURSOR:
         return bin_to_res_cursor (data, length, big_endian);
       case RT_BITMAP:
         return bin_to_res_generic (RES_TYPE_BITMAP, data, length);
       case RT_ICON:
         return bin_to_res_generic (RES_TYPE_ICON, data, length);
       case RT_MENU:
         return bin_to_res_menu (data, length, big_endian);
       case RT_DIALOG:
         return bin_to_res_dialog (data, length, big_endian);
       case RT_STRING:
         return bin_to_res_string (data, length, big_endian);
       case RT_FONTDIR:
         return bin_to_res_fontdir (data, length, big_endian);
       case RT_FONT:
         return bin_to_res_generic (RES_TYPE_FONT, data, length);
       case RT_ACCELERATOR:
         return bin_to_res_accelerators (data, length, big_endian);
       case RT_RCDATA:
         return bin_to_res_rcdata (data, length, big_endian);
       case RT_MESSAGETABLE:
         return bin_to_res_generic (RES_TYPE_MESSAGETABLE, data, length);
       case RT_GROUP_CURSOR:
         return bin_to_res_group_cursor (data, length, big_endian);
       case RT_GROUP_ICON:
         return bin_to_res_group_icon (data, length, big_endian);
       case RT_VERSION:
         return bin_to_res_version (data, length, big_endian);
       }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 592 of file resrc.c.

{
  struct res_resource *r;

  r = define_standard_resource (&resources, RT_ACCELERATOR, id,
                            resinfo->language, 0);
  r->type = RES_TYPE_ACCELERATOR;
  r->u.acc = data;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

void define_bitmap ( struct res_id  ,
const struct res_res_info ,
const char *   
)

Definition at line 611 of file resrc.c.

{
  FILE *e;
  char *real_filename;
  struct stat s;
  unsigned char *data;
  int i;
  struct res_resource *r;

  e = open_file_search (filename, FOPEN_RB, "bitmap file", &real_filename);

  if (stat (real_filename, &s) < 0)
    fatal (_("stat failed on bitmap file `%s': %s"), real_filename,
          strerror (errno));

  data = (unsigned char *) res_alloc (s.st_size - BITMAP_SKIP);

  for (i = 0; i < BITMAP_SKIP; i++)
    getc (e);

  get_data (e, data, s.st_size - BITMAP_SKIP, real_filename);

  fclose (e);
  free (real_filename);

  r = define_standard_resource (&resources, RT_BITMAP, id,
                            resinfo->language, 0);

  r->type = RES_TYPE_BITMAP;
  r->u.data.length = s.st_size - BITMAP_SKIP;
  r->u.data.data = data;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

struct dialog_control* define_control ( const struct res_id  ,
unsigned  long,
unsigned  long,
unsigned  long,
unsigned  long,
unsigned  long,
unsigned  long,
unsigned  long,
unsigned  long 
) [read]

Definition at line 791 of file resrc.c.

{
  struct dialog_control *n;

  n = (struct dialog_control *) res_alloc (sizeof *n);
  n->next = NULL;
  n->id = id;
  n->style = style;
  n->exstyle = exstyle;
  n->x = x;
  n->y = y;
  n->width = width;
  n->height = height;
  n->class.named = 0;
  n->class.u.id = class;
  n->text = iid;
  n->data = NULL;
  n->help = 0;

  return n;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void define_cursor ( struct res_id  ,
const struct res_res_info ,
const char *   
)

Definition at line 653 of file resrc.c.

{
  FILE *e;
  char *real_filename;
  int type, count, i;
  struct icondir *icondirs;
  int first_cursor;
  struct res_resource *r;
  struct group_cursor *first, **pp;

  e = open_file_search (filename, FOPEN_RB, "cursor file", &real_filename);

  /* A cursor file is basically an icon file.  The start of the file
     is a three word structure.  The first word is ignored.  The
     second word is the type of data.  The third word is the number of
     entries.  */

  get_word (e, real_filename);
  type = get_word (e, real_filename);
  count = get_word (e, real_filename);
  if (type != 2)
    fatal (_("cursor file `%s' does not contain cursor data"), real_filename);

  /* Read in the icon directory entries.  */

  icondirs = (struct icondir *) xmalloc (count * sizeof *icondirs);

  for (i = 0; i < count; i++)
    {
      icondirs[i].width = getc (e);
      icondirs[i].height = getc (e);
      icondirs[i].colorcount = getc (e);
      getc (e);
      icondirs[i].u.cursor.xhotspot = get_word (e, real_filename);
      icondirs[i].u.cursor.yhotspot = get_word (e, real_filename);
      icondirs[i].bytes = get_long (e, real_filename);
      icondirs[i].offset = get_long (e, real_filename);

      if (feof (e))
       unexpected_eof (real_filename);
    }

  /* Define each cursor as a unique resource.  */

  first_cursor = cursors;

  for (i = 0; i < count; i++)
    {
      unsigned char *data;
      struct res_id name;
      struct cursor *c;

      if (fseek (e, icondirs[i].offset, SEEK_SET) != 0)
       fatal (_("%s: fseek to %lu failed: %s"), real_filename,
              icondirs[i].offset, strerror (errno));

      data = (unsigned char *) res_alloc (icondirs[i].bytes);

      get_data (e, data, icondirs[i].bytes, real_filename);

      c = (struct cursor *) res_alloc (sizeof *c);
      c->xhotspot = icondirs[i].u.cursor.xhotspot;
      c->yhotspot = icondirs[i].u.cursor.yhotspot;
      c->length = icondirs[i].bytes;
      c->data = data;

      ++cursors;

      name.named = 0;
      name.u.id = cursors;

      r = define_standard_resource (&resources, RT_CURSOR, name,
                                resinfo->language, 0);
      r->type = RES_TYPE_CURSOR;
      r->u.cursor = c;
      r->res_info = *resinfo;
    }

  fclose (e);
  free (real_filename);

  /* Define a cursor group resource.  */

  first = NULL;
  pp = &first;
  for (i = 0; i < count; i++)
    {
      struct group_cursor *cg;

      cg = (struct group_cursor *) res_alloc (sizeof *cg);
      cg->next = NULL;
      cg->width = icondirs[i].width;
      cg->height = 2 * icondirs[i].height;

      /* FIXME: What should these be set to?  */
      cg->planes = 1;
      cg->bits = 1;

      cg->bytes = icondirs[i].bytes + 4;
      cg->index = first_cursor + i + 1;

      *pp = cg;
      pp = &(*pp)->next;
    }

  free (icondirs);

  r = define_standard_resource (&resources, RT_GROUP_CURSOR, id,
                            resinfo->language, 0);
  r->type = RES_TYPE_GROUP_CURSOR;
  r->u.group_cursor = first;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

Definition at line 771 of file resrc.c.

{
  struct dialog *copy;
  struct res_resource *r;

  copy = (struct dialog *) res_alloc (sizeof *copy);
  *copy = *dialog;

  r = define_standard_resource (&resources, RT_DIALOG, id,
                            resinfo->language, 0);
  r->type = RES_TYPE_DIALOG;
  r->u.dialog = copy;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

void define_font ( struct res_id  ,
const struct res_res_info ,
const char *   
)

Definition at line 843 of file resrc.c.

{
  FILE *e;
  char *real_filename;
  struct stat s;
  unsigned char *data;
  struct res_resource *r;
  long offset;
  long fontdatalength;
  unsigned char *fontdata;
  struct fontdir *fd;
  const char *device, *face;
  struct fontdir **pp;

  e = open_file_search (filename, FOPEN_RB, "font file", &real_filename);

  if (stat (real_filename, &s) < 0)
    fatal (_("stat failed on font file `%s': %s"), real_filename,
          strerror (errno));

  data = (unsigned char *) res_alloc (s.st_size);

  get_data (e, data, s.st_size, real_filename);

  fclose (e);
  free (real_filename);

  r = define_standard_resource (&resources, RT_FONT, id,
                            resinfo->language, 0);

  r->type = RES_TYPE_FONT;
  r->u.data.length = s.st_size;
  r->u.data.data = data;
  r->res_info = *resinfo;

  /* For each font resource, we must add an entry in the FONTDIR
     resource.  The FONTDIR resource includes some strings in the font
     file.  To find them, we have to do some magic on the data we have
     read.  */

  offset = ((((((data[47] << 8)
              | data[46]) << 8)
             | data[45]) << 8)
           | data[44]);
  if (offset > 0 && offset < s.st_size)
    device = (char *) data + offset;
  else
    device = "";

  offset = ((((((data[51] << 8)
              | data[50]) << 8)
             | data[49]) << 8)
           | data[48]);
  if (offset > 0 && offset < s.st_size)
    face = (char *) data + offset;
  else
    face = "";

  ++fonts;

  fontdatalength = 58 + strlen (device) + strlen (face);
  fontdata = (unsigned char *) res_alloc (fontdatalength);
  memcpy (fontdata, data, 56);
  strcpy ((char *) fontdata + 56, device);
  strcpy ((char *) fontdata + 57 + strlen (device), face);

  fd = (struct fontdir *) res_alloc (sizeof *fd);
  fd->next = NULL;
  fd->index = fonts;
  fd->length = fontdatalength;
  fd->data = fontdata;

  for (pp = &fontdirs; *pp != NULL; pp = &(*pp)->next)
    ;
  *pp = fd;

  /* For the single fontdirs resource, we always use the resource
     information of the last font.  I don't know what else to do.  */
  fontdirs_resinfo = *resinfo;
}

Here is the call graph for this function:

void define_icon ( struct res_id  ,
const struct res_res_info ,
const char *   
)

Definition at line 951 of file resrc.c.

{
  FILE *e;
  char *real_filename;
  int type, count, i;
  struct icondir *icondirs;
  int first_icon;
  struct res_resource *r;
  struct group_icon *first, **pp;

  e = open_file_search (filename, FOPEN_RB, "icon file", &real_filename);

  /* The start of an icon file is a three word structure.  The first
     word is ignored.  The second word is the type of data.  The third
     word is the number of entries.  */

  get_word (e, real_filename);
  type = get_word (e, real_filename);
  count = get_word (e, real_filename);
  if (type != 1)
    fatal (_("icon file `%s' does not contain icon data"), real_filename);

  /* Read in the icon directory entries.  */

  icondirs = (struct icondir *) xmalloc (count * sizeof *icondirs);

  for (i = 0; i < count; i++)
    {
      icondirs[i].width = getc (e);
      icondirs[i].height = getc (e);
      icondirs[i].colorcount = getc (e);
      getc (e);
      icondirs[i].u.icon.planes = get_word (e, real_filename);
      icondirs[i].u.icon.bits = get_word (e, real_filename);
      icondirs[i].bytes = get_long (e, real_filename);
      icondirs[i].offset = get_long (e, real_filename);

      if (feof (e))
       unexpected_eof (real_filename);
    }

  /* Define each icon as a unique resource.  */

  first_icon = icons;

  for (i = 0; i < count; i++)
    {
      unsigned char *data;
      struct res_id name;

      if (fseek (e, icondirs[i].offset, SEEK_SET) != 0)
       fatal (_("%s: fseek to %lu failed: %s"), real_filename,
              icondirs[i].offset, strerror (errno));

      data = (unsigned char *) res_alloc (icondirs[i].bytes);

      get_data (e, data, icondirs[i].bytes, real_filename);

      ++icons;

      name.named = 0;
      name.u.id = icons;

      r = define_standard_resource (&resources, RT_ICON, name,
                                resinfo->language, 0);
      r->type = RES_TYPE_ICON;
      r->u.data.length = icondirs[i].bytes;
      r->u.data.data = data;
      r->res_info = *resinfo;
    }

  fclose (e);
  free (real_filename);

  /* Define an icon group resource.  */

  first = NULL;
  pp = &first;
  for (i = 0; i < count; i++)
    {
      struct group_icon *cg;

      /* For some reason, at least in some files the planes and bits
         are zero.  We instead set them from the color.  This is
         copied from rcl.  */

      cg = (struct group_icon *) res_alloc (sizeof *cg);
      cg->next = NULL;
      cg->width = icondirs[i].width;
      cg->height = icondirs[i].height;
      cg->colors = icondirs[i].colorcount;

      if (icondirs[i].u.icon.planes)
       cg->planes = icondirs[i].u.icon.planes;
      else
       cg->planes = 1;

      if (icondirs[i].u.icon.bits)
       cg->bits = icondirs[i].u.icon.bits;
      else
       {
         cg->bits = 0;

         while ((1L << cg->bits) < cg->colors)
           ++cg->bits;
       }

      cg->bytes = icondirs[i].bytes;
      cg->index = first_icon + i + 1;

      *pp = cg;
      pp = &(*pp)->next;
    }

  free (icondirs);

  r = define_standard_resource (&resources, RT_GROUP_ICON, id,
                            resinfo->language, 0);
  r->type = RES_TYPE_GROUP_ICON;
  r->u.group_icon = first;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

struct dialog_control* define_icon_control ( struct res_id  ,
unsigned  long,
unsigned  long,
unsigned  long,
unsigned  long,
unsigned  long,
unsigned  long,
struct rcdata_item ,
struct dialog_ex  
) [read]

Definition at line 817 of file resrc.c.

{
  struct dialog_control *n;
  struct res_id tid;

  if (style == 0)
    style = SS_ICON | WS_CHILD | WS_VISIBLE;
  res_string_to_id (&tid, "");
  n = define_control (tid, id, x, y, 0, 0, CTL_STATIC, style, exstyle);
  n->text = iid;
  if (help && !ex)
    rcparse_warning (_("help ID requires DIALOGEX"));
  if (data && !ex)
    rcparse_warning (_("control data requires DIALOGEX"));
  n->help = help;
  n->data = data;

  return n;
}

Here is the call graph for this function:

Definition at line 1078 of file resrc.c.

{
  struct menu *m;
  struct res_resource *r;

  m = (struct menu *) res_alloc (sizeof *m);
  m->items = menuitems;
  m->help = 0;

  r = define_standard_resource (&resources, RT_MENU, id, resinfo->language, 0);
  r->type = RES_TYPE_MENU;
  r->u.menu = m;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

struct menuitem* define_menuitem ( const char *  ,
int  ,
unsigned  long,
unsigned  long,
unsigned  long,
struct menuitem  
) [read]

Definition at line 1098 of file resrc.c.

{
  struct menuitem *mi;

  mi = (struct menuitem *) res_alloc (sizeof *mi);
  mi->next = NULL;
  mi->type = type;
  mi->state = state;
  mi->id = menuid;
  if (text == NULL)
    mi->text = NULL;
  else
    unicode_from_ascii ((int *) NULL, &mi->text, text);
  mi->help = help;
  mi->popup = menuitems;
  return mi;
}

Here is the call graph for this function:

Definition at line 1121 of file resrc.c.

{
  FILE *e;
  char *real_filename;
  struct stat s;
  unsigned char *data;
  struct res_resource *r;

  e = open_file_search (filename, FOPEN_RB, "messagetable file",
                     &real_filename);

  if (stat (real_filename, &s) < 0)
    fatal (_("stat failed on bitmap file `%s': %s"), real_filename,
          strerror (errno));

  data = (unsigned char *) res_alloc (s.st_size);

  get_data (e, data, s.st_size, real_filename);

  fclose (e);
  free (real_filename);

  r = define_standard_resource (&resources, RT_MESSAGETABLE, id,
                            resinfo->language, 0);

  r->type = RES_TYPE_MESSAGETABLE;
  r->u.data.length = s.st_size;
  r->u.data.data = data;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

Definition at line 1156 of file resrc.c.

{
  struct res_resource *r;

  r = define_standard_resource (&resources, RT_RCDATA, id,
                            resinfo->language, 0);
  r->type = RES_TYPE_RCDATA;
  r->u.rcdata = data;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void define_rcdata_file ( struct res_id  ,
const struct res_res_info ,
const char *   
)

Definition at line 1260 of file resrc.c.

{
  struct rcdata_item *ri;
  FILE *e;
  char *real_filename;
  struct stat s;
  unsigned char *data;

  e = open_file_search (filename, FOPEN_RB, "file", &real_filename);


  if (stat (real_filename, &s) < 0)
    fatal (_("stat failed on file `%s': %s"), real_filename,
          strerror (errno));

  data = (unsigned char *) res_alloc (s.st_size);

  get_data (e, data, s.st_size, real_filename);

  fclose (e);
  free (real_filename);

  ri = (struct rcdata_item *) res_alloc (sizeof *ri);
  ri->next = NULL;
  ri->type = RCDATA_BUFFER;
  ri->u.buffer.length = s.st_size;
  ri->u.buffer.data = data;

  define_rcdata (id, resinfo, ri);
}

Here is the call graph for this function:

Definition at line 1190 of file resrc.c.

{
  struct rcdata_item *ri;

  ri = (struct rcdata_item *) res_alloc (sizeof *ri);
  ri->next = NULL;
  ri->type = dword ? RCDATA_DWORD : RCDATA_WORD;
  ri->u.word = val;

  return ri;
}

Here is the call graph for this function:

struct rcdata_item* define_rcdata_string ( const char *  ,
unsigned  long 
) [read]

Definition at line 1171 of file resrc.c.

{
  struct rcdata_item *ri;
  char *s;

  ri = (struct rcdata_item *) res_alloc (sizeof *ri);
  ri->next = NULL;
  ri->type = RCDATA_STRING;
  ri->u.string.length = len;
  s = (char *) res_alloc (len);
  memcpy (s, string, len);
  ri->u.string.s = s;

  return ri;
}

Here is the call graph for this function:

Definition at line 310 of file windres.c.

{
  struct res_entry *re = NULL;
  int i;

  assert (cids > 0);
  for (i = 0; i < cids; i++)
    {
      struct res_entry **pp;

      if (*resources == NULL)
       {
         static unsigned long timeval;

         /* Use the same timestamp for every resource created in a
             single run.  */
         if (timeval == 0)
           timeval = time (NULL);

         *resources = ((struct res_directory *)
                     res_alloc (sizeof **resources));
         (*resources)->characteristics = 0;
         (*resources)->time = timeval;
         (*resources)->major = 0;
         (*resources)->minor = 0;
         (*resources)->entries = NULL;
       }

      for (pp = &(*resources)->entries; *pp != NULL; pp = &(*pp)->next)
       if (res_id_cmp ((*pp)->id, ids[i]) == 0)
         break;

      if (*pp != NULL)
       re = *pp;
      else
       {
         re = (struct res_entry *) res_alloc (sizeof *re);
         re->next = NULL;
         re->id = ids[i];
         if ((i + 1) < cids)
           {
             re->subdir = 1;
             re->u.dir = NULL;
           }
         else
           {
             re->subdir = 0;
             re->u.res = NULL;
           }

         *pp = re;
       }

      if ((i + 1) < cids)
       {
         if (! re->subdir)
           {
             fprintf (stderr, "%s: ", program_name);
             res_ids_print (stderr, i, ids);
             fprintf (stderr, _(": expected to be a directory\n"));
             xexit (1);
           }

         resources = &re->u.dir;
       }
    }

  if (re->subdir)
    {
      fprintf (stderr, "%s: ", program_name);
      res_ids_print (stderr, cids, ids);
      fprintf (stderr, _(": expected to be a leaf\n"));
      xexit (1);
    }

  if (re->u.res != NULL)
    {
      if (dupok)
       return re->u.res;

      fprintf (stderr, _("%s: warning: "), program_name);
      res_ids_print (stderr, cids, ids);
      fprintf (stderr, _(": duplicate value\n"));
    }

  re->u.res = ((struct res_resource *)
              res_alloc (sizeof (struct res_resource)));
  memset (re->u.res, 0, sizeof (struct res_resource));

  re->u.res->type = RES_TYPE_UNINITIALIZED;
  return re->u.res;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 408 of file windres.c.

{
  struct res_id a[3];

  a[0].named = 0;
  a[0].u.id = type;
  a[1] = name;
  a[2].named = 0;
  a[2].u.id = language;
  return define_resource (resources, 3, a, dupok);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void define_stringtable ( const struct res_res_info ,
unsigned  long,
const char *   
)

Definition at line 1206 of file resrc.c.

{
  struct res_id id;
  struct res_resource *r;

  id.named = 0;
  id.u.id = (stringid >> 4) + 1;
  r = define_standard_resource (&resources, RT_STRING, id,
                            resinfo->language, 1);

  if (r->type == RES_TYPE_UNINITIALIZED)
    {
      int i;

      r->type = RES_TYPE_STRINGTABLE;
      r->u.stringtable = ((struct stringtable *)
                       res_alloc (sizeof (struct stringtable)));
      for (i = 0; i < 16; i++)
       {
         r->u.stringtable->strings[i].length = 0;
         r->u.stringtable->strings[i].string = NULL;
       }

      r->res_info = *resinfo;
    }

  unicode_from_ascii (&r->u.stringtable->strings[stringid & 0xf].length,
                    &r->u.stringtable->strings[stringid & 0xf].string,
                    string);
}

Here is the call graph for this function:

Definition at line 1241 of file resrc.c.

{
  struct res_id ids[3];
  struct res_resource *r;

  ids[0] = type;
  ids[1] = id;
  ids[2].named = 0;
  ids[2].u.id = resinfo->language;

  r = define_resource (& resources, 3, ids, 0);
  r->type = RES_TYPE_USERDATA;
  r->u.userdata = data;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

Definition at line 1295 of file resrc.c.

{
  FILE *e;
  char *real_filename;
  struct stat s;
  unsigned char *data;
  struct res_id ids[3];
  struct res_resource *r;

  e = open_file_search (filename, FOPEN_RB, "file", &real_filename);

  if (stat (real_filename, &s) < 0)
    fatal (_("stat failed on file `%s': %s"), real_filename,
          strerror (errno));

  data = (unsigned char *) res_alloc (s.st_size);

  get_data (e, data, s.st_size, real_filename);

  fclose (e);
  free (real_filename);

  ids[0] = type;
  ids[1] = id;
  ids[2].named = 0;
  ids[2].u.id = resinfo->language;

  r = define_resource (&resources, 3, ids, 0);
  r->type = RES_TYPE_USERDATA;
  r->u.userdata = ((struct rcdata_item *)
                 res_alloc (sizeof (struct rcdata_item)));
  r->u.userdata->next = NULL;
  r->u.userdata->type = RCDATA_BUFFER;
  r->u.userdata->u.buffer.length = s.st_size;
  r->u.userdata->u.buffer.data = data;
  r->res_info = *resinfo;
}

Here is the call graph for this function:

Definition at line 1337 of file resrc.c.

{
  struct res_resource *r;

  r = define_standard_resource (&resources, RT_VERSION, id, language, 0);
  r->type = RES_TYPE_VERSIONINFO;
  r->u.versioninfo = ((struct versioninfo *)
                    res_alloc (sizeof (struct versioninfo)));
  r->u.versioninfo->fixed = fixedverinfo;
  r->u.versioninfo->var = verinfo;
  r->res_info.language = language;
}

Here is the call graph for this function:

Definition at line 478 of file windres.c.

{
  const struct dialog_control *c;

  if (dialog->ex != NULL)
    return 1;

  for (c = dialog->controls; c != NULL; c = c->next)
    if (c->data != NULL || c->help != 0)
      return 1;

  return 0;
}

Here is the caller graph for this function:

Definition at line 495 of file windres.c.

{
  return extended_menuitems (menu->items);
}

Here is the call graph for this function:

Here is the caller graph for this function:

FILE* open_file_search ( const char *  ,
const char *  ,
const char *  ,
char **   
)

Definition at line 171 of file windres.c.

{
  FILE *e;
  struct include_dir *d;

  e = fopen (filename, mode);
  if (e != NULL)
    {
      *real_filename = xstrdup (filename);
      return e;
    }

  if (errno == ENOENT)
    {
      for (d = include_dirs; d != NULL; d = d->next)
       {
         char *n;

         n = (char *) xmalloc (strlen (d->dir) + strlen (filename) + 2);
         sprintf (n, "%s/%s", d->dir, filename);
         e = fopen (n, mode);
         if (e != NULL)
           {
             *real_filename = n;
             return e;
           }

         if (errno != ENOENT)
           break;
       }
    }

  fatal (_("can't open %s `%s': %s"), errmsg, filename, strerror (errno));

  /* Return a value to avoid a compiler warning.  */
  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void rcparse_discard_strings ( void  )

Here is the caller graph for this function:

void rcparse_normal ( void  )
void rcparse_rcdata ( void  )

Here is the caller graph for this function:

void rcparse_warning ( const char *  )

Definition at line 527 of file resrc.c.

{
  fprintf (stderr, _("%s:%d: %s\n"), rc_filename, rc_lineno, msg);
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct res_directory* read_coff_rsrc ( const char *  ,
const char *   
) [read]

Definition at line 116 of file rescoff.c.

{
  bfd *abfd;
  char **matching;
  asection *sec;
  bfd_size_type size;
  bfd_byte *data;
  struct coff_file_info finfo;

  if (filename == NULL)
    fatal (_("filename required for COFF input"));

  abfd = bfd_openr (filename, target);
  if (abfd == NULL)
    bfd_fatal (filename);

  if (! bfd_check_format_matches (abfd, bfd_object, &matching))
    {
      bfd_nonfatal (bfd_get_filename (abfd));
      if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
       list_matching_formats (matching);
      xexit (1);
    }

  sec = bfd_get_section_by_name (abfd, ".rsrc");
  if (sec == NULL)
    {
      fatal (_("%s: no resource section"), filename);
    }

  size = bfd_section_size (abfd, sec);
  data = (bfd_byte *) res_alloc (size);

  if (! bfd_get_section_contents (abfd, sec, data, 0, size))
    bfd_fatal (_("can't read resource section"));

  finfo.filename = filename;
  finfo.data = data;
  finfo.data_end = data + size;
  finfo.secaddr = (bfd_get_section_vma (abfd, sec)
                 - pe_data (abfd)->pe_opthdr.ImageBase);
  finfo.big_endian = bfd_big_endian (abfd);

  bfd_close (abfd);

  /* Now just read in the top level resource directory.  Note that we
     don't free data, since we create resource entries that point into
     it.  If we ever want to free up the resource information we read,
     this will have to be cleaned up.  */

  return read_coff_res_dir (data, &finfo, (const struct res_id *) NULL, 0);
}

Here is the call graph for this function:

struct res_directory* read_rc_file ( const char *  ,
const char *  ,
const char *  ,
int  ,
int   
) [read]

Definition at line 382 of file resrc.c.

{
  char *cmd;

  istream_type = (use_temp_file) ? ISTREAM_FILE : ISTREAM_PIPE;

  if (preprocargs == NULL)
    preprocargs = "";
  if (filename == NULL)
    filename = "-";

  if (preprocessor)
    {
      cmd = xmalloc (strlen (preprocessor)
                   + strlen (preprocargs)
                   + strlen (filename)
                   + 10);
      sprintf (cmd, "%s %s %s", preprocessor, preprocargs, filename);

      cpp_pipe = open_input_stream (cmd);
    }
  else
    {
      char *dash, *slash, *cp;

      preprocessor = DEFAULT_PREPROCESSOR;

      cmd = xmalloc (strlen (program_name)
                   + strlen (preprocessor)
                   + strlen (preprocargs)
                   + strlen (filename)
#ifdef HAVE_EXECUTABLE_SUFFIX
                   + strlen (EXECUTABLE_SUFFIX)
#endif
                   + 10);


      dash = slash = 0;
      for (cp = program_name; *cp; cp++)
       {
         if (*cp == '-')
           dash = cp;
         if (
#if defined (__DJGPP__) || defined (__CYGWIN__) || defined(_WIN32)
             *cp == ':' || *cp == '\\' ||
#endif
             *cp == '/')
           {
             slash = cp;
             dash = 0;
           }
       }

      cpp_pipe = 0;

      if (dash)
       {
         /* First, try looking for a prefixed gcc in the windres
            directory, with the same prefix as windres */

         cpp_pipe = look_for_default (cmd, program_name, dash-program_name+1,
                                   preprocargs, filename);
       }

      if (slash && !cpp_pipe)
       {
         /* Next, try looking for a gcc in the same directory as
             that windres */

         cpp_pipe = look_for_default (cmd, program_name, slash-program_name+1,
                                   preprocargs, filename);
       }

      if (!cpp_pipe)
       {
         /* Sigh, try the default */

         cpp_pipe = look_for_default (cmd, "", 0, preprocargs, filename);
       }

    }

  free (cmd);

  rc_filename = xstrdup (filename);
  rc_lineno = 1;
  if (language != -1)
    rcparse_set_language (language);
  yyin = cpp_pipe;
  yyparse ();
  rcparse_discard_strings ();

  close_input_stream ();

  if (fontdirs != NULL)
    define_fontdirs ();

  free (rc_filename);
  rc_filename = NULL;

  return resources;
}

Here is the call graph for this function:

struct res_directory* read_res_file ( const char *  ) [read]
void* res_alloc ( size_t  )

Definition at line 142 of file windres.c.

{
  return (void *) obstack_alloc (&res_obstack, bytes);
}

Here is the call graph for this function:

Definition at line 215 of file windres.c.

{
  if (! a.named)
    {
      if (b.named)
       return 1;
      if (a.u.id > b.u.id)
       return 1;
      else if (a.u.id < b.u.id)
       return -1;
      else
       return 0;
    }
  else
    {
      unichar *as, *ase, *bs, *bse;

      if (! b.named)
       return -1;

      as = a.u.n.name;
      ase = as + a.u.n.length;
      bs = b.u.n.name;
      bse = bs + b.u.n.length;

      while (as < ase)
       {
         int i;

         if (bs >= bse)
           return 1;
         i = (int) *as - (int) *bs;
         if (i != 0)
           return i;
         ++as;
         ++bs;
       }

      if (bs < bse)
       return -1;

      return 0;
    }
}

Here is the caller graph for this function:

void res_id_print ( FILE *  ,
struct res_id  ,
int   
)

Definition at line 263 of file windres.c.

{
  if (! id.named)
    fprintf (stream, "%lu", id.u.id);
  else
    {
      if (quote)
       putc ('"', stream);
      unicode_print (stream, id.u.n.name, id.u.n.length);
      if (quote)
       putc ('"', stream);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void res_ids_print ( FILE *  ,
int  ,
const struct res_id  
)

Definition at line 280 of file windres.c.

{
  int i;

  for (i = 0; i < cids; i++)
    {
      res_id_print (stream, ids[i], 1);
      if (i + 1 < cids)
       fprintf (stream, ": ");
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void res_string_to_id ( struct res_id ,
const char *   
)

Definition at line 295 of file windres.c.

{
  res_id->named = 1;
  unicode_from_ascii (&res_id->u.n.length, &res_id->u.n.name, string);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1257 of file resbin.c.

{
  switch (res->type)
    {
    default:
      abort ();
    case RES_TYPE_BITMAP:
    case RES_TYPE_FONT:
    case RES_TYPE_ICON:
    case RES_TYPE_MESSAGETABLE:
      return res_to_bin_generic (res->u.data.length, res->u.data.data);
    case RES_TYPE_ACCELERATOR:
      return res_to_bin_accelerator (res->u.acc, big_endian);
    case RES_TYPE_CURSOR:
      return res_to_bin_cursor (res->u.cursor, big_endian);
    case RES_TYPE_GROUP_CURSOR:
      return res_to_bin_group_cursor (res->u.group_cursor, big_endian);
    case RES_TYPE_DIALOG:
      return res_to_bin_dialog (res->u.dialog, big_endian);
    case RES_TYPE_FONTDIR:
      return res_to_bin_fontdir (res->u.fontdir, big_endian);
    case RES_TYPE_GROUP_ICON:
      return res_to_bin_group_icon (res->u.group_icon, big_endian);
    case RES_TYPE_MENU:
      return res_to_bin_menu (res->u.menu, big_endian);
    case RES_TYPE_RCDATA:
      return res_to_bin_rcdata (res->u.rcdata, big_endian);
    case RES_TYPE_STRINGTABLE:
      return res_to_bin_stringtable (res->u.stringtable, big_endian);
    case RES_TYPE_USERDATA:
      return res_to_bin_rcdata (res->u.rcdata, big_endian);
    case RES_TYPE_VERSIONINFO:
      return res_to_bin_versioninfo (res->u.versioninfo, big_endian);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* reswr_alloc ( size_t  )

Definition at line 163 of file windres.c.

{
  return (void *) obstack_alloc (&reswr_obstack, bytes);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void write_coff_file ( const char *  ,
const char *  ,
const struct res_directory  
)

Definition at line 417 of file rescoff.c.

{
  bfd *abfd;
  asection *sec;
  struct coff_write_info cwi;
  struct bindata *d;
  unsigned long length, offset;

  if (filename == NULL)
    fatal (_("filename required for COFF output"));

  abfd = bfd_openw (filename, target);
  if (abfd == NULL)
    bfd_fatal (filename);

  if (! bfd_set_format (abfd, bfd_object))
    bfd_fatal ("bfd_set_format");

#if defined DLLTOOL_SH
  if (! bfd_set_arch_mach (abfd, bfd_arch_sh, 0))
    bfd_fatal ("bfd_set_arch_mach(sh)");
#elif defined DLLTOOL_MIPS
  if (! bfd_set_arch_mach (abfd, bfd_arch_mips, 0))
    bfd_fatal ("bfd_set_arch_mach(mips)");
#elif defined DLLTOOL_ARM
  if (! bfd_set_arch_mach (abfd, bfd_arch_arm, 0))
    bfd_fatal ("bfd_set_arch_mach(arm)");
#else
  /* FIXME: This is obviously i386 specific.  */
  if (! bfd_set_arch_mach (abfd, bfd_arch_i386, 0))
    bfd_fatal ("bfd_set_arch_mach(i386)");
#endif

  if (! bfd_set_file_flags (abfd, HAS_SYMS | HAS_RELOC))
    bfd_fatal ("bfd_set_file_flags");

  sec = bfd_make_section (abfd, ".rsrc");
  if (sec == NULL)
    bfd_fatal ("bfd_make_section");

  if (! bfd_set_section_flags (abfd, sec,
                            (SEC_HAS_CONTENTS | SEC_ALLOC
                            | SEC_LOAD | SEC_DATA)))
    bfd_fatal ("bfd_set_section_flags");

  if (! bfd_set_symtab (abfd, sec->symbol_ptr_ptr, 1))
    bfd_fatal ("bfd_set_symtab");

  /* Requiring this is probably a bug in BFD.  */
  sec->output_section = sec;

  /* The order of data in the .rsrc section is
       resource directory tables and entries
       resource directory strings
       resource data entries
       actual resource data

     We build these different types of data in different lists.  */

  cwi.abfd = abfd;
  cwi.big_endian = bfd_big_endian (abfd);
  cwi.sympp = sec->symbol_ptr_ptr;
  cwi.dirsize = 0;
  cwi.dirstrsize = 0;
  cwi.dataentsize = 0;
  cwi.dirs.d = NULL;
  cwi.dirs.last = NULL;
  cwi.dirs.length = 0;
  cwi.dirstrs.d = NULL;
  cwi.dirstrs.last = NULL;
  cwi.dirstrs.length = 0;
  cwi.dataents.d = NULL;
  cwi.dataents.last = NULL;
  cwi.dataents.length = 0;
  cwi.resources.d = NULL;
  cwi.resources.last = NULL;
  cwi.resources.length = 0;
  cwi.relocs = NULL;
  cwi.reloc_count = 0;

  /* Work out the sizes of the resource directory entries, so that we
     know the various offsets we will need.  */
  coff_bin_sizes (resources, &cwi);

  /* Force the directory strings to be 32 bit aligned.  Every other
     structure is 32 bit aligned anyhow.  */
  cwi.dirstrsize = (cwi.dirstrsize + 3) &~ 3;

  /* Actually convert the resources to binary.  */
  coff_to_bin (resources, &cwi);

  /* Add another 2 bytes to the directory strings if needed for
     alignment.  */
  if ((cwi.dirstrs.length & 3) != 0)
    {
      unsigned char *ex;

      ex = coff_alloc (&cwi.dirstrs, 2);
      ex[0] = 0;
      ex[1] = 0;
    }

  /* Make sure that the data we built came out to the same size as we
     calculated initially.  */
  assert (cwi.dirs.length == cwi.dirsize);
  assert (cwi.dirstrs.length == cwi.dirstrsize);
  assert (cwi.dataents.length == cwi.dataentsize);

  length = (cwi.dirsize
           + cwi.dirstrsize
           + cwi.dataentsize
           + cwi.resources.length);

  if (! bfd_set_section_size (abfd, sec, length))
    bfd_fatal ("bfd_set_section_size");

  bfd_set_reloc (abfd, sec, cwi.relocs, cwi.reloc_count);

  offset = 0;
  for (d = cwi.dirs.d; d != NULL; d = d->next)
    {
      if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
       bfd_fatal ("bfd_set_section_contents");
      offset += d->length;
    }
  for (d = cwi.dirstrs.d; d != NULL; d = d->next)
    {
      if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
       bfd_fatal ("bfd_set_section_contents");
      offset += d->length;
    }
  for (d = cwi.dataents.d; d != NULL; d = d->next)
    {
      if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
       bfd_fatal ("bfd_set_section_contents");
      offset += d->length;
    }
  for (d = cwi.resources.d; d != NULL; d = d->next)
    {
      if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
       bfd_fatal ("bfd_set_section_contents");
      offset += d->length;
    }

  assert (offset == length);

  if (! bfd_close (abfd))
    bfd_fatal ("bfd_close");

  /* We allocated the relocs array using malloc.  */
  free (cwi.relocs);
}

Here is the call graph for this function:

void write_rc_file ( const char *  ,
const struct res_directory  
)

Definition at line 1483 of file resrc.c.

{
  FILE *e;
  int language;

  if (filename == NULL)
    e = stdout;
  else
    {
      e = fopen (filename, FOPEN_WT);
      if (e == NULL)
       fatal (_("can't open `%s' for output: %s"), filename, strerror (errno));
    }

  language = -1;
  write_rc_directory (e, resources, (const struct res_id *) NULL,
                    (const struct res_id *) NULL, &language, 1);
}

Here is the call graph for this function:

void write_res_file ( const char *  ,
const struct res_directory  
)
void yyerror ( const char *  )

Definition at line 519 of file resrc.c.

{
  fatal ("%s:%d: %s", rc_filename, rc_lineno, msg);
}
int yylex ( void  )
int yyparse ( void  )

Variable Documentation

char* rc_filename

Definition at line 120 of file resrc.c.

Definition at line 124 of file resrc.c.

Definition at line 88 of file ar.c.

FILE* yyin