summaryrefslogtreecommitdiff
path: root/iup/srcledc/ledc.h
blob: 782cf1f8731a3a7f788c402366b5f3f530efc038 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/** \file
 * \brief LEDC definitions.
 *
 * See Copyright Notice in iup.h
 * $Id: ledc.h,v 1.2 2009/06/22 15:47:16 scuri Exp $
 */
 
#ifndef __LEDC_H 
#define __LEDC_H

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _elemlist {
  struct _elemlist *next;
  void         *data;
} Telemlist;

typedef struct {
  Telemlist* first;
  int size;
} Tlist;

typedef struct {
  char *name;
  char *value;
} Tattr;

typedef struct _Telem  Telem;
typedef struct _Tparam Tparam;

struct _Telem {
  char*   name;
  char*   elemname;
  Tlist*  attrs;
  Tparam**params;
  int     nparams;
  int     elemidx;
  char   *codename;
  union {
    struct { int w, h; } image;
  } data;
};

struct _Tparam {
  enum { NAME_PARAM, STRING_PARAM, ELEM_PARAM } tag;
  union {
    char  *name;
    Telem *elem;
  } data;
};

Tattr*  attr( char* name, char* value );
Tparam* param( int tag, void* value );
Telem*  elem( char* name, Tlist* attrs, Tlist* params );
Tlist*  list( void );
Tlist*  addlist( Tlist* l, void* data );
Tlist*  revertlist( Tlist* l );
Tparam** list2paramvector( Tlist* l );
void    cleanlist( Tlist* l );

void decl( Telem* e );

void use( char* name );
void named( char* name );

void init(void);
void finish(void);

void error( char* fmt, ... );

extern int yylineno;

extern char* filename;
extern char* outname;
extern char* funcname;
extern int   nocode;

#ifdef __cplusplus
}
#endif

#endif