summaryrefslogtreecommitdiff
path: root/modules/graphics/includes/GetCommandArg.h
blob: d2606651efa40e6e98b8bc4396abefeeaac1101f (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/*
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2006 - INRIA - Fabrice Leray
 * Copyright (C) 2006 - INRIA - Jean-Baptiste Silvy
 *
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at
 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
 *
 */

/*------------------------------------------------------------------------*/
/* file: GetCommandArg.h                                                  */
/* desc : tools to retrieve parameters within the command line for        */
/*        graphic routines.                                               */
/*------------------------------------------------------------------------*/

#ifndef _GET_COMMAND_ARG_H_
#define _GET_COMMAND_ARG_H_

#include "dynlib_graphics.h"
#include "stack-c.h"
#include "BOOL.h"

/*------------------------------------------------------------------------*/
/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param n1
 * @param rhs_opts opts[]
 * @param style
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_style_arg(void* _pvCtx, char *fname, int pos, int n1, rhs_opts opts[], int ** style);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param rhs_opts opts[]
 * @param rect
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_rect_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], double ** rect);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param rhs_opts opts[]
 * @param strf
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_strf_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char ** strf);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param rhs_opts opts[]
 * @param legend
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_legend_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char ** legend);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param rhs_opts opts[]
 * @param labels
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_labels_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char ** labels);

/**
 * @TODO add comment
 *
 * @param pos
 * @param rhs_opts opts[]
 * @param nax
 * @param flagNax
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_nax_arg(void* _pvCtx, int pos, rhs_opts opts[], int ** nax, BOOL * flagNax);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param rhs_opts opts[]
 * @param zminmax
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_zminmax_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], double ** zminmax);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param rhs_opts opts[]
 * @param colminmax
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_colminmax_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], int ** colminmax);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param rhs_opts opts[]
 * @param colout
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_colout_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], int ** colout);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param rhs_opts opts[]
 * @param withMesh
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_with_mesh_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], BOOL * withMesh);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param rhs_opts opts[]
 * @param logFlags
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_logflags_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char ** logFlags);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param name
 * @param value
 * @param sz
 * @param  rhs_opts opts[]
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_optional_double_arg(void* _pvCtx, char * fname, int pos, char * name, double ** value, int sz, rhs_opts opts[]);

/**
 * @TODO add comment
 *
 * @param fname
 * @param pos
 * @param name
 * @param value
 * @param sz
 * @param  rhs_opts opts[]
 * @return <ReturnValue>
 */
GRAPHICS_IMPEXP int get_optional_int_arg(void* _pvCtx, char * fname, int pos, char * name, int ** value, int sz, rhs_opts opts[]);
/*------------------------------------------------------------------------*/
#define sciGetStyle(PVCTX,fname,pos,n1,opts,style) { if (get_style_arg(PVCTX,fname,pos,n1,opts,style) == 0) { return 0 ; } }
#define GetRect(PVCTX,fname,pos,opts,rect) { if (get_rect_arg(PVCTX,fname,pos,opts,rect) == 0) { return 0 ; } }
#define GetStrf(PVCTX,fname,pos,opts,strf) { if (get_strf_arg(PVCTX,fname,pos,opts,strf) == 0) { return 0 ; } }
#define GetLegend(PVCTX,fname,pos,opts,legend) { if (get_legend_arg(PVCTX,fname,pos,opts,legend) == 0) { return 0 ; } }
#define GetLabels(PVCTX,fname,pos,opts,labels) { if (get_labels_arg(PVCTX,fname,pos,opts,labels) == 0) { return 0 ; } }
#define GetNax(PVCTX,pos,opts,nax,flagNax) { if (get_nax_arg(PVCTX,pos,opts,nax,flagNax)==0) { return 0 ; } }
#define GetZminmax(PVCTX,fname,pos,opts,zminmax) { if (get_zminmax_arg(PVCTX,fname,pos,opts,zminmax) == 0) { return 0 ; } }
#define GetColminmax(PVCTX,fname,pos,opts,colminmax) { if (get_colminmax_arg(PVCTX,fname,pos,opts,colminmax)==0) { return 0 ; } }
#define GetColOut(PVCTX,fname,pos,opts,colout) { if (get_colout_arg(PVCTX,fname,pos,opts,colout)==0) { return 0 ; } }
#define GetWithMesh(PVCTX,fname,pos,opts,withMesh) { if (get_with_mesh_arg(PVCTX,fname,pos,opts,withMesh)==0) { return 0 ; } }
#define GetLogflags(PVCTX, fname,pos,opts,logFlags) { if (get_logflags_arg(PVCTX, fname,pos,opts,logFlags) == 0) { return 0 ; } }
#define GetOptionalDoubleArg(PVCTX,fname,pos,name,value,sz,opts) { if (get_optional_double_arg(PVCTX,fname,pos,name,value,sz,opts) == 0) { return 0 ; } }
#define GetOptionalIntArg(PVCTX,fname,pos,name,value,sz,opts) { if (get_optional_int_arg(PVCTX,fname,pos,name,value,sz,opts) == 0) { return 0 ; } }
/*------------------------------------------------------------------------*/

#endif /* _GET_COMMAND_ARG_H_ */