~bkerensa/ubuntu/raring/yasm/fix-for-1064341

« back to all changes in this revision

Viewing changes to libyasm/valparam.h

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar
  • Date: 2009-07-14 08:23:59 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090714082359-10x8mjty41gzkshs
Tags: 0.8.0-1
* New upstream release (Closes: #531047).
* Removed all tasm patches, they’ve been merged upstream.
* debian/control: set debhelper dependency to 5.0 and policy to 3.8.2.
* debian/control: mention TASM in the long description.
* debian/compat: set debhelper level to 5.
* debian/links: link tasm to ytasm and tasm.1.gz to ytasm.1.gz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * \brief YASM value/parameter interface.
4
4
 *
5
5
 * \rcs
6
 
 * $Id: valparam.h 2010 2007-11-14 08:33:32Z peter $
 
6
 * $Id: valparam.h 2101 2008-05-23 06:46:51Z peter $
7
7
 * \endrcs
8
8
 *
9
9
 * \license
34
34
#ifndef YASM_VALPARAM_H
35
35
#define YASM_VALPARAM_H
36
36
 
 
37
#ifndef YASM_LIB_DECL
 
38
#define YASM_LIB_DECL
 
39
#endif
 
40
 
37
41
/** Value/parameter pair.  \internal */
38
42
struct yasm_valparam {
39
43
    /*@reldef@*/ STAILQ_ENTRY(yasm_valparam) link;  /**< Next pair in list */
101
105
 * \param objext_valparams      object format-specific value/parameters
102
106
 * \param line                  virtual line (from yasm_linemap)
103
107
 */
 
108
YASM_LIB_DECL
104
109
void yasm_call_directive(const yasm_directive *directive, yasm_object *object,
105
110
                         yasm_valparamhead *valparams,
106
111
                         yasm_valparamhead *objext_valparams,
112
117
 * \param id_prefix     identifier prefix for raw identifiers
113
118
 * \return Newly allocated valparam.
114
119
 */
 
120
YASM_LIB_DECL
115
121
yasm_valparam *yasm_vp_create_id(/*@keep@*/ char *v, /*@keep@*/ char *p,
116
122
                                 int id_prefix);
117
123
 
120
126
 * \param p     parameter
121
127
 * \return Newly allocated valparam.
122
128
 */
 
129
YASM_LIB_DECL
123
130
yasm_valparam *yasm_vp_create_string(/*@keep@*/ char *v, /*@keep@*/ char *p);
124
131
 
125
132
/** Create a new valparam with expression parameter.
127
134
 * \param p     parameter
128
135
 * \return Newly allocated valparam.
129
136
 */
 
137
YASM_LIB_DECL
130
138
yasm_valparam *yasm_vp_create_expr(/*@keep@*/ char *v,
131
139
                                   /*@keep@*/ yasm_expr *p);
132
140
 
138
146
 * \return Expression, or NULL if vp is NULL or the parameter cannot be
139
147
 *         converted to an expression.
140
148
 */
 
149
YASM_LIB_DECL
141
150
/*@null@*/ /*@only@*/ yasm_expr *yasm_vp_expr
142
151
    (const yasm_valparam *vp, yasm_symtab *symtab, unsigned long line);
143
152
 
147
156
 * \return String, or NULL if vp is NULL or the parameter cannot be realized
148
157
 *         as a string.
149
158
 */
 
159
YASM_LIB_DECL
150
160
/*@null@*/ /*@dependent@*/ const char *yasm_vp_string(const yasm_valparam *vp);
151
161
 
152
162
/** Get a valparam parameter as an identifier.
154
164
 * \return Identifier (string), or NULL if vp is NULL or the parameter is not
155
165
 *         an identifier.
156
166
 */
 
167
YASM_LIB_DECL
157
168
/*@null@*/ /*@dependent@*/ const char *yasm_vp_id(const yasm_valparam *vp);
158
169
 
159
170
/** Create a new linked list of valparams.
160
171
 * \return Newly allocated valparam list.
161
172
 */
 
173
YASM_LIB_DECL
162
174
yasm_valparamhead *yasm_vps_create(void);
163
175
 
164
176
/** Destroy a list of valparams (created with yasm_vps_create).
165
177
 * \param headp         list of valparams
166
178
 */
 
179
YASM_LIB_DECL
167
180
void yasm_vps_destroy(yasm_valparamhead *headp);
168
181
 
169
182
/** Initialize linked list of valparams.
179
192
 * \warning Deletes val/params.
180
193
 * \param headp linked list
181
194
 */
 
195
YASM_LIB_DECL
182
196
void yasm_vps_delete(yasm_valparamhead *headp);
183
197
 
184
198
/** Append valparam to tail of linked list.
225
239
 * \param f     file
226
240
 * \param headp linked list
227
241
 */
 
242
YASM_LIB_DECL
228
243
void yasm_vps_print(/*@null@*/ const yasm_valparamhead *headp, FILE *f);
229
244
 
230
245
/** Directive valparam parse helper structure. */
280
295
 * \return -1 on error, 1 if any arguments matched (including via
281
296
 *         catch-all callback), 0 if no match.
282
297
 */
 
298
YASM_LIB_DECL
283
299
int yasm_dir_helper(void *obj, yasm_valparam *vp_first, unsigned long line,
284
300
                    const yasm_dir_help *help, size_t nhelp, void *data,
285
301
                    int (*helper_valparam) (void *object,
297
313
 * \param arg   flag to set
298
314
 * \return 0
299
315
 */
 
316
YASM_LIB_DECL
300
317
int yasm_dir_helper_flag_set(void *obj, yasm_valparam *vp, unsigned long line,
301
318
                             void *data, uintptr_t arg);
302
319
 
310
327
 * \param arg   flag to OR
311
328
 * \return 0
312
329
 */
 
330
YASM_LIB_DECL
313
331
int yasm_dir_helper_flag_or(void *obj, yasm_valparam *vp, unsigned long line,
314
332
                            void *data, uintptr_t arg);
315
333
 
323
341
 * \param arg   flag to AND
324
342
 * \return 0
325
343
 */
 
344
YASM_LIB_DECL
326
345
int yasm_dir_helper_flag_and(void *obj, yasm_valparam *vp, unsigned long line,
327
346
                             void *data, uintptr_t arg);
328
347
 
340
359
 * \param arg   unused argument
341
360
 * \return -1 on error, 0 otherwise.
342
361
 */
 
362
YASM_LIB_DECL
343
363
int yasm_dir_helper_expr(void *obj, yasm_valparam *vp, unsigned long line,
344
364
                         void *data, uintptr_t arg);
345
365
 
357
377
 * \param arg   unused argument
358
378
 * \return -1 on error, 0 otherwise.
359
379
 */
 
380
YASM_LIB_DECL
360
381
int yasm_dir_helper_intn(void *obj, yasm_valparam *vp, unsigned long line,
361
382
                         void *data, uintptr_t arg);
362
383
 
373
394
 * \param arg   unused
374
395
 * \return -1 on error, 0 otherwise.
375
396
 */
 
397
YASM_LIB_DECL
376
398
int yasm_dir_helper_string(void *obj, yasm_valparam *vp, unsigned long line,
377
399
                           void *data, uintptr_t arg);
378
400
 
384
406
 * \param data  unused
385
407
 * \return 0
386
408
 */
 
409
YASM_LIB_DECL
387
410
int yasm_dir_helper_valparam_warn(void *obj, yasm_valparam *vp,
388
411
                                  unsigned long line, void *data);
389
412
#endif