11638Srgrimes/* windres.h -- header file for windres program.
21638Srgrimes   Copyright (C) 1997-2020 Free Software Foundation, Inc.
31638Srgrimes   Written by Ian Lance Taylor, Cygnus Support.
41638Srgrimes   Rewritten by Kai Tietz, Onevision.
51638Srgrimes
61638Srgrimes   This file is part of GNU Binutils.
71638Srgrimes
81638Srgrimes   This program is free software; you can redistribute it and/or modify
91638Srgrimes   it under the terms of the GNU General Public License as published by
101638Srgrimes   the Free Software Foundation; either version 3 of the License, or
111638Srgrimes   (at your option) any later version.
121638Srgrimes
131638Srgrimes   This program is distributed in the hope that it will be useful,
141638Srgrimes   but WITHOUT ANY WARRANTY; without even the implied warranty of
151638Srgrimes   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
161638Srgrimes   GNU General Public License for more details.
171638Srgrimes
181638Srgrimes   You should have received a copy of the GNU General Public License
191638Srgrimes   along with this program; if not, write to the Free Software
201638Srgrimes   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
211638Srgrimes   02110-1301, USA.  */
221638Srgrimes
231638Srgrimes#include "ansidecl.h"
241638Srgrimes
251638Srgrimes/* This is the header file for the windres program.  It defines
261638Srgrimes   structures and declares functions used within the program.  */
271638Srgrimes
281638Srgrimes#include "winduni.h"
291638Srgrimes#include "windint.h"
301638Srgrimes
311638Srgrimesextern int verbose;
321638Srgrimes
331638Srgrimes/* Function declarations.  */
341638Srgrimes
351638Srgrimesextern rc_res_directory *read_rc_file (const char *, const char *, const char *, int, int);
361638Srgrimesextern rc_res_directory *read_res_file (const char *);
371638Srgrimesextern rc_res_directory *read_coff_rsrc (const char *, const char *);
381638Srgrimesextern void write_rc_file (const char *, const rc_res_directory *);
391638Srgrimesextern void write_res_file (const char *, const rc_res_directory *);
401638Srgrimesextern void write_coff_file (const char *, const char *, const rc_res_directory *);
411638Srgrimes
421638Srgrimesextern rc_res_resource *bin_to_res (windres_bfd *, rc_res_id, const bfd_byte *,
431638Srgrimes				    rc_uint_type);
441638Srgrimesextern rc_uint_type res_to_bin (windres_bfd *, rc_uint_type, const rc_res_resource *);
451638Srgrimes
461638Srgrimesextern FILE *open_file_search (const char *, const char *, const char *, char **);
471638Srgrimes
481638Srgrimesextern void *res_alloc (rc_uint_type);
491638Srgrimesextern void *reswr_alloc (rc_uint_type);
501638Srgrimes
511638Srgrimes/* Resource ID handling.  */
521638Srgrimes
531638Srgrimesextern int res_id_cmp (rc_res_id, rc_res_id);
541638Srgrimesextern void res_id_print (FILE *, rc_res_id, int);
551638Srgrimesextern void res_ids_print (FILE *, int, const rc_res_id *);
561638Srgrimesextern void res_string_to_id (rc_res_id *, const char *);
57extern void res_unistring_to_id (rc_res_id *, const unichar *);
58
59/* Manipulation of the resource tree.  */
60
61extern rc_res_resource *define_resource (rc_res_directory **, int, const rc_res_id *,
62					 int);
63extern rc_res_resource *define_standard_resource (rc_res_directory **, int, rc_res_id,
64						  rc_uint_type, int);
65
66extern int extended_dialog (const rc_dialog *);
67extern int extended_menu (const rc_menu *);
68
69/* Communication between the rc file support and the parser and lexer.  */
70
71extern int yydebug;
72extern char *rc_filename;
73extern int rc_lineno;
74
75extern int yyparse (void);
76extern int yylex (void);
77extern void yyerror (const char *);
78extern void rcparse_warning (const char *);
79extern void rcparse_set_language (int);
80extern void rcparse_discard_strings (void);
81extern void rcparse_rcdata (void);
82extern void rcparse_normal (void);
83
84extern void define_accelerator (rc_res_id, const rc_res_res_info *, rc_accelerator *);
85extern void define_bitmap (rc_res_id, const rc_res_res_info *, const char *);
86extern void define_cursor (rc_res_id, const rc_res_res_info *, const char *);
87extern void define_dialog (rc_res_id, const rc_res_res_info *, const rc_dialog *);
88extern rc_dialog_control *define_control (const rc_res_id, rc_uint_type, rc_uint_type,
89					  rc_uint_type, rc_uint_type, rc_uint_type,
90					  const rc_res_id, rc_uint_type, rc_uint_type);
91extern rc_dialog_control *define_icon_control (rc_res_id, rc_uint_type, rc_uint_type,
92					       rc_uint_type, rc_uint_type, rc_uint_type,
93					       rc_uint_type, rc_rcdata_item *,
94					       rc_dialog_ex *);
95extern void define_font (rc_res_id, const rc_res_res_info *, const char *);
96extern void define_icon (rc_res_id, const rc_res_res_info *, const char *);
97extern void define_menu (rc_res_id, const rc_res_res_info *, rc_menuitem *);
98extern rc_menuitem *define_menuitem (const unichar *, rc_uint_type, rc_uint_type,
99				     rc_uint_type, rc_uint_type, rc_menuitem *);
100extern void define_messagetable (rc_res_id, const rc_res_res_info *, const char *);
101extern void define_rcdata (rc_res_id, const rc_res_res_info *, rc_rcdata_item *);
102extern void define_rcdata_file  (rc_res_id, const rc_res_res_info *, const char *);
103extern rc_rcdata_item *define_rcdata_string (const char *, rc_uint_type);
104extern rc_rcdata_item *define_rcdata_unistring (const unichar *, rc_uint_type);
105extern rc_rcdata_item *define_rcdata_number (rc_uint_type, int);
106extern void define_stringtable (const rc_res_res_info *, rc_uint_type, const unichar *, int);
107extern void define_user_data (rc_res_id, rc_res_id, const rc_res_res_info *, rc_rcdata_item *);
108extern void define_toolbar (rc_res_id, rc_res_res_info *, rc_uint_type ,rc_uint_type ,rc_toolbar_item *);
109extern void define_user_file (rc_res_id, rc_res_id, const rc_res_res_info *, const char *);
110extern void define_versioninfo (rc_res_id, rc_uint_type, rc_fixed_versioninfo *, rc_ver_info *);
111extern rc_ver_info *append_ver_stringfileinfo (rc_ver_info *, rc_ver_stringtable *);
112extern rc_ver_stringtable *append_ver_stringtable (rc_ver_stringtable *, const char *, rc_ver_stringinfo *);
113extern rc_ver_info *append_ver_varfileinfo (rc_ver_info *, const unichar *, rc_ver_varinfo *);
114extern rc_ver_stringinfo *append_verval (rc_ver_stringinfo *, const unichar *, const unichar *);
115extern rc_ver_varinfo *append_vertrans (rc_ver_varinfo *, rc_uint_type, rc_uint_type);
116
117extern bfd *windres_open_as_binary (const char *, int);
118extern void windres_add_include_dir (const char *);
119
120extern int wr_printcomment (FILE *, const char *, ...);
121extern int wr_print (FILE *, const char *, ...);
122#define wr_print_flush(FP)  wr_print ((FP),NULL)
123