Debian Codegraph @

gui/GraphLib/libsrc/uimxR5/include/types.h

raw
1 /* @(#)types.h 17.1 (ESO-IPG) 01/25/02 17:26:05 */
2 /*---------------------------------------------------------------------
3 * $Date: 2003-06-04 14:49:18 $ $Revision: 1.1.1.1 $
4 *---------------------------------------------------------------------
5 *
6 *
7 * Copyright (c) 1992, Visual Edge Software Ltd.
8 *
9 * ALL RIGHTS RESERVED. Permission to use, copy, modify, and
10 * distribute this software and its documentation for any purpose
11 * and without fee is hereby granted, provided that the above
12 * copyright notice appear in all copies and that both that
13 * copyright notice and this permission notice appear in supporting
14 * documentation, and that the name of Visual Edge Software not be
15 * used in advertising or publicity pertaining to distribution of
16 * the software without specific, written prior permission. The year
17 * included in the notice is the year of the creation of the work.
18 *-------------------------------------------------------------------*/
19
20 #ifndef _TYPES_INCLUDED
21 #define _TYPES_INCLUDED
22
23 #include "uxproto.h"
24
25 #define NO_TYPE 0
26 #define RANGE 1
27 #define VALUES 2
28
29 typedef struct {
30 float min;
31 int has_min;
32 float max;
33 int has_max;
34 } Range;
35
36 typedef struct {
37 int num_values;
38 char **values;
39 } Values;
40
41 typedef struct {
42 char *name;
43 unsigned int size;
44 int interp_type;
45 int domain_type;
46 union {
47 Range range;
48 Values values;
49 } domain;
50 } UIMXType;
51
52 typedef struct {
53 char *name;
54 unsigned int size;
55 int domain_type;
56 union {
57 Range range;
58 Values values;
59 } domain;
60 } XType;
61
62 typedef struct {
63 char **strings;
64 unsigned char *values;
65 int size;
66 } conversion;
67
68 #define BLOCK_SIZE 100
69
70 #define u_name(tp) UxUIMX_types[tp]->name
71 #define u_size(tp) UxUIMX_types[tp]->size
72 #define u_interp_type(tp) UxUIMX_types[tp]->interp_type
73 #define u_domain_type(tp) UxUIMX_types[tp]->domain_type
74 #define u_num_values(tp) UxUIMX_types[tp]->domain.values.num_values
75 #define u_values(tp) UxUIMX_types[tp]->domain.values.values
76 #define u_min(tp) UxUIMX_types[tp]->domain.range.min
77 #define u_has_min(tp) UxUIMX_types[tp]->domain.range.has_min
78 #define u_max(tp) UxUIMX_types[tp]->domain.range.max
79 #define u_has_max(tp) UxUIMX_types[tp]->domain.range.has_max
80 #define x_name(tp) UxX_types[tp]->name
81 #define x_size(tp) UxX_types[tp]->size
82 #define x_domain_type(tp) UxX_types[tp]->domain_type
83 #define x_num_values(tp) UxX_types[tp]->domain.values.num_values
84 #define x_values(tp) UxX_types[tp]->domain.values.values
85 #define x_min(tp) UxX_types[tp]->domain.range.min
86 #define x_has_min(tp) UxX_types[tp]->domain.range.has_min
87 #define x_max(tp) UxX_types[tp]->domain.range.max
88 #define x_has_max(tp) UxX_types[tp]->domain.range.has_max
89
90 typedef int (*UIMX_conv)();
91 extern UIMX_conv **UxUimx_x;
92 extern UIMXType **UxUIMX_types;
93 extern XType **UxX_types;
94 extern conversion *UxStr_conv;
95
96 #define UIMX_TYPE 0
97 #define X_TYPE 1
98
99 extern int UxAdd_utype UXPROTO((char *name, int size, int interp_type));
100 extern int UxAddXtype UXPROTO((char *name, int size));
101 extern void UxAddConv UXPROTO((int utypei, int xtypei, UIMX_conv conv));
102 extern void UxAdd_values UXPROTO((int x_or_uimx, int type, int num_values, char **values));
103 extern void UxAddXvalues UXPROTO((int type, char **uvals, unsigned char *xvals, int size));
104
105 #endif /* _TYPES_INCLUDED */