source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/Superpixels/SourceCode/segment/mex.h @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 13.7 KB
Line 
1/*
2 * @(#)mex.h    generated by: makeheader 4.21  Fri Apr 23 18:16:45 2004
3 *
4 *              built from:     ../../src/include/copyright.h
5 *                              ../../src/include/pragma_interface.h
6 *                              mex_typedefs.h
7 *                              ./fmexapi.cpp
8 *                              ./fmexapiv5.cpp
9 *                              ./globals.cpp
10 *                              ./mexapi.cpp
11 *                              ./mexapiv4.cpp
12 *                              ./mexapiv5.cpp
13 *                              ./mexcbk.cpp
14 *                              ./mexdispatch.cpp
15 *                              ./mexintrf.cpp
16 *                              mexdbg.h
17 */
18
19#ifndef mex_h
20#define mex_h
21
22
23/*
24 * Copyright 1984-2003 The MathWorks, Inc.
25 * All Rights Reserved.
26 */
27
28
29
30/*
31 * Prevent g++ from making copies of vtable and typeinfo data
32 * in every compilation unit.  By allowing for only one, we can
33 * save space and prevent some situations where the linker fails
34 * to coalesce them properly into a single entry.
35 *
36 * References:
37 *    http://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html#Vague%20Linkage
38 *    http://gcc.gnu.org/onlinedocs/gcc/C---Interface.html
39 */
40
41#ifdef __cplusplus
42#  ifdef GLNX86
43#    pragma interface
44#  endif
45#endif
46
47
48
49/* $Revision: 1.7 $ */
50#ifndef mex_typedefs_h
51#define mex_typedefs_h
52typedef struct impl_info_tag *MEX_impl_info;
53
54#include "matrix.h"
55
56typedef struct mexGlobalTableEntry_Tag
57{
58    const char *name;             /* The name of the global */
59    mxArray    **variable;        /* A pointer to the variable */ 
60} mexGlobalTableEntry, *mexGlobalTable;
61
62#if defined(MSWIND)
63#define cicompare(s1,s2) utStrcmpi((s1),(s2))
64#else
65#define cicompare(s1,s2) strcmp((s1),(s2))
66#endif
67#define cscompare(s1,s2) strcmp((s1),(s2))
68
69typedef struct mexFunctionTableEntry_tag {
70  const char *  name;
71  mxFunctionPtr f;
72  int           nargin;
73  int           nargout;
74  struct _mexLocalFunctionTable *local_function_table;
75} mexFunctionTableEntry, *mexFunctionTable;
76
77typedef struct _mexLocalFunctionTable {
78  size_t           length;
79  mexFunctionTable entries;
80} _mexLocalFunctionTable, *mexLocalFunctionTable;
81
82typedef struct {
83  void (*initialize)(void);
84  void (*terminate)(void);
85} _mexInitTermTableEntry, *mexInitTermTableEntry;
86
87#define MEX_INFORMATION_VERSION 1
88
89typedef struct {
90  int                   version;
91  int                   file_function_table_length;
92  mexFunctionTable      file_function_table;
93  int                   global_variable_table_length;
94  mexGlobalTable        global_variable_table;
95  int                   npaths;
96  const char **         paths;
97  int                   init_term_table_length;
98  mexInitTermTableEntry init_term_table;
99} _mex_information, *mex_information;
100
101typedef mex_information(*fn_mex_file)(void);
102
103typedef void (*fn_clean_up_after_error)(void);
104typedef const char *(*fn_simple_function_to_string)(mxFunctionPtr f);
105
106typedef void (*fn_mex_enter_mex_library)(mex_information x);
107typedef fn_mex_enter_mex_library fn_mex_exit_mex_library;
108
109typedef mexLocalFunctionTable (*fn_mex_get_local_function_table)(void);
110typedef mexLocalFunctionTable (*fn_mex_set_local_function_table)(mexLocalFunctionTable);
111
112#endif
113
114
115/*
116 * This header file "mex.h" declares all the types, macros and
117 * functions necessary to interface mex files with the current
118 * version of MATLAB.  See the release notes for information on
119 * supporting syntax from earlier versions.
120 */ 
121#include "matrix.h"
122
123#include <stdio.h>
124
125
126
127#ifdef __cplusplus
128extern "C" {
129#endif
130/*
131 * mexFunction is the user defined C routine which is called upon invocation
132 * of a mex function.
133 */
134void mexFunction(
135    int           nlhs,           /* number of expected outputs */
136    mxArray       *plhs[],        /* array of pointers to output arguments */
137    int           nrhs,           /* number of inputs */
138    const mxArray *prhs[]         /* array of pointers to input arguments */
139);
140#ifdef __cplusplus
141}
142#endif
143
144#ifdef __cplusplus
145extern "C" {
146#endif
147/*
148 * Issue error message and return to MATLAB prompt
149 */
150extern void mexErrMsgTxt(
151    const char  *error_msg      /* string with error message */
152    );
153#ifdef __cplusplus
154}
155#endif
156
157#ifdef __cplusplus
158extern "C" {
159#endif
160/*
161 * Issue formatted error message with corresponding error identifier and return to MATLAB
162 * prompt.
163 */
164extern void mexErrMsgIdAndTxt(
165    const char * identifier, /* string with error message identifier */
166    const char * err_msg,    /* string with error message printf-style format */
167    ...                      /* any additional arguments */
168    );
169#ifdef __cplusplus
170}
171#endif
172
173#ifdef __cplusplus
174extern "C" {
175#endif
176/*
177 * Invoke an unidentified warning. Such warnings can only be affected by the M-code
178 * 'warning * all', since they have no specific identifier. See also mexWarnMsgIdAndTxt.
179 */
180extern void mexWarnMsgTxt(
181    const char  *warn_msg       /* string with warning message */
182    );
183#ifdef __cplusplus
184}
185#endif
186
187#ifdef __cplusplus
188extern "C" {
189#endif
190/*
191 * Invoke a warning with message identifier 'identifier' and message derived from 'fmt' and
192 * subsequent arguments. The warning may either get printed as is (if it is set to 'on'), or
193 * not actually get printed (if set to 'off'). See 'help warning' in MATLAB for more
194 * details.
195 */
196extern void mexWarnMsgIdAndTxt(
197    const char * identifier,    /* string with warning message identifer */
198    const char * warn_msg,      /* string with warning message printf-style format */
199    ...                         /* any additional arguments */
200    );
201#ifdef __cplusplus
202}
203#endif
204
205#ifdef __cplusplus
206extern "C" {
207#endif
208/*
209 * mex equivalent to MATLAB's "disp" function
210 */
211extern int mexPrintf(
212    const char  *fmt,   /* printf style format */
213    ...                         /* any additional arguments */
214    );
215#ifdef __cplusplus
216}
217#endif
218
219
220#define printf mexPrintf
221
222#ifdef __cplusplus
223extern "C" {
224#endif
225/*
226 * Remove all components of an array plus the array header itself
227 * from MATLAB's memory allocation list.  The array will now
228 * persist between calls to the mex function.  To destroy this
229 * array, you will need to explicitly call mxDestroyArray().
230 */
231extern void mexMakeArrayPersistent(
232    mxArray *pa              /* pointer to array */
233    );
234#ifdef __cplusplus
235}
236#endif
237
238#ifdef __cplusplus
239extern "C" {
240#endif
241/*
242 * Remove memory previously allocated via mxCalloc from MATLAB's
243 * memory allocation list.  To free this memory, you will need to
244 * explicitly call mxFree().
245 */
246extern void mexMakeMemoryPersistent(void *ptr);
247#ifdef __cplusplus
248}
249#endif
250
251#ifdef __cplusplus
252extern "C" {
253#endif
254/*
255 * Look up a function and return an opaque handle for use with
256 * mexCallMATLABFunction.
257 */
258extern void mexGetFunctionHandle(void);
259#ifdef __cplusplus
260}
261#endif
262
263#ifdef __cplusplus
264extern "C" {
265#endif
266/*
267 * Call a function whose handle was determined by mexGetFunctionHandle.
268 */
269extern void mexCallMATLABFunction(void);
270#ifdef __cplusplus
271}
272#endif
273
274#ifdef __cplusplus
275extern "C" {
276#endif
277/*
278 * Register a function pointer as a MATLAB-callable function.
279 */
280extern void mexRegisterFunction(void);
281#ifdef __cplusplus
282}
283#endif
284
285#ifdef __cplusplus
286extern "C" {
287#endif
288/*
289 * mex equivalent to MATLAB's "set" function
290 */
291extern int mexSet(double handle, const char *property, mxArray *value);
292#ifdef __cplusplus
293}
294#endif
295
296#ifdef __cplusplus
297extern "C" {
298#endif
299/* API interface which mimics the "get" function */
300extern const mxArray *mexGet(double handle, const char *property);
301#ifdef __cplusplus
302}
303#endif
304
305#ifdef __cplusplus
306extern "C" {
307#endif
308/*
309 * call MATLAB function
310 */
311extern int mexCallMATLAB(
312    int         nlhs,                   /* number of expected outputs */
313    mxArray     *plhs[],                /* pointer array to outputs */
314    int         nrhs,                   /* number of inputs */
315    mxArray     *prhs[],                /* pointer array to inputs */
316    const char  *fcn_name               /* name of function to execute */
317    );
318#ifdef __cplusplus
319}
320#endif
321
322#ifdef __cplusplus
323extern "C" {
324#endif
325/*
326 * set or clear mexCallMATLAB trap flag (if set then an error in 
327 * mexCallMATLAB is caught and mexCallMATLAB will return a status value,
328 * if not set an error will cause control to revert to MATLAB)
329 */
330extern void mexSetTrapFlag(int flag);
331#ifdef __cplusplus
332}
333#endif
334
335#ifdef __cplusplus
336extern "C" {
337#endif
338/*
339 * Perform in-place subscript assignment.
340 */
341extern void mexSubsAssign(
342      mxArray *plhs, /* pointer to lhs, to be modified in-place */
343      const mxArray *prhs, /* pointer to rhs */
344      const mxArray *subs[], /* array of subscripts for lhs */
345      int nsubs     /* number os subscripts */
346      );
347#ifdef __cplusplus
348}
349#endif
350
351#ifdef __cplusplus
352extern "C" {
353#endif
354/*
355 * Retrieve a specified subset of an array.
356 */
357extern mxArray *mexSubsReference(
358      const mxArray *prhs, /* pointer to rhs */
359      const mxArray *subs[], /* array of subscripts for rhs */
360      int nsubs /* number of subscripts */
361      );
362#ifdef __cplusplus
363}
364#endif
365
366#ifdef __cplusplus
367extern "C" {
368#endif
369/*
370 * Print an assertion-style error message and return control to the
371 * MATLAB command line.
372 */ 
373extern void mexPrintAssertion(
374                const char *test, 
375                const char *fname, 
376                int linenum, 
377                const char *message);
378#ifdef __cplusplus
379}
380#endif
381
382#ifdef __cplusplus
383extern "C" {
384#endif
385/*
386 * Tell whether or not a mxArray is in MATLAB's global workspace.
387 */
388extern bool mexIsGlobal(const mxArray *pA);
389#ifdef __cplusplus
390}
391#endif
392
393
394#define mexGetGlobal()    mexGetGlobal_is_obsolete
395#define mxSetString()     mxSetString_is_obsolete
396#define mxSetDispMode()   mxSetDispMode_is_obsolete
397#define mexGetMatrixPtr() mexGetMatrixPtr_is_obsolete
398#define mexGetMatrix()    mexGetMatrix_is_obsolete
399#define mexPutMatrix()    mexPutMatrix_is_obsolete
400#define mexPutFull()      mexPutFull_is_obsolete
401#define mexGetFull()      mexGetFull_is_obsolete
402#define mexGetEps()       mexGetEps_is_obsolete
403#define mexGetInf()       mexGetInf_is_obsolete
404#define mexGetNaN()       mexGetNaN_is_obsolete
405#define mexIsFinite()     mexIsFinite_is_obsolete
406#define mexIsInf()        mexIsInf_is_obsolete
407#define mexIsNaN()        mexIsNaN_is_obsolete
408
409
410/*
411 * mexAddFlops is no longer allowed. 
412 */
413#define mexAddFlops(x) mexAddFlops_is_obsolete
414
415#if defined(V5_COMPAT)
416#define mexPutArray(parray, workspace) mexPutVariable(workspace, mxGetName(parray), parray)
417#define mexGetArray(name, workspace) mexGetVariable(workspace, name)
418#define mexGetArrayPtr(name, workspace) mexGetVariablePtr(workspace, name)
419#else
420#define mexPutArray() mexPutArray_is_obsolete
421#define mexGetArray() mexGetArray_is_obsolete
422#define mexGetArrayPtr() mexGetArrayPtr_is_obsolete
423#endif /* defined(V5_COMPAT) */
424
425#ifdef __cplusplus
426extern "C" {
427#endif
428/*
429 * Place a copy of the array value into the specified workspace with the
430 * specified name
431 */
432extern int mexPutVariable(
433    const char *workspace,
434    const char *name,
435    const mxArray *parray               /* matrix to copy */
436    );
437#ifdef __cplusplus
438}
439#endif
440
441#ifdef __cplusplus
442extern "C" {
443#endif
444/*
445 * return a pointer to the array value with the specified variable
446 * name in the specified workspace
447 */
448extern const mxArray *mexGetVariablePtr(
449    const char *workspace,
450    const char *name            /* name of symbol */
451    );
452#ifdef __cplusplus
453}
454#endif
455
456#ifdef __cplusplus
457extern "C" {
458#endif
459/*
460 * return a copy of the array value with the specified variable
461 * name in the specified workspace
462 */
463extern mxArray *mexGetVariable(
464    const char  *workspace,             
465    const char  *name                /* name of variable in question */
466    );
467#ifdef __cplusplus
468}
469#endif
470
471#ifdef __cplusplus
472extern "C" {
473#endif
474/*
475 * Lock a MEX-function so that it cannot be cleared from memory.
476 */
477extern void mexLock(void);
478#ifdef __cplusplus
479}
480#endif
481
482#ifdef __cplusplus
483extern "C" {
484#endif
485/*
486 * Unlock a locked MEX-function so that it can be cleared from memory.
487 */
488extern void mexUnlock(void);
489#ifdef __cplusplus
490}
491#endif
492
493#ifdef __cplusplus
494extern "C" {
495#endif
496/*
497 * Return true if the MEX-function is currently locked, false otherwise.
498 */
499extern bool mexIsLocked(void);
500#ifdef __cplusplus
501}
502#endif
503
504#ifdef __cplusplus
505extern "C" {
506#endif
507/*
508 * Return the name of a the MEXfunction currently executing.
509 */
510extern const char *mexFunctionName(void);
511#ifdef __cplusplus
512}
513#endif
514
515#ifdef __cplusplus
516extern "C" {
517#endif
518/*
519 * Parse and execute MATLAB syntax in string.  Returns zero if successful,
520 * and a non zero value if an error occurs.
521 */
522extern int mexEvalString(
523   const char *str         /* matlab command string */
524);
525#ifdef __cplusplus
526}
527#endif
528
529#ifdef __cplusplus
530extern "C" {
531#endif
532/*
533 * Register Mex-file's At-Exit function (accessed via MEX callback)
534 */
535extern int mexAtExit(
536    void        (*exit_fcn)(void)
537    );
538#ifdef __cplusplus
539}
540#endif
541
542
543#define NEW_DISPATCHER_EVAL_CALLER 1
544
545
546/* $Revision: 1.9 $ */
547#ifdef ARGCHECK
548
549#include "mwdebug.h" /* Prototype _d versions of API functions */
550
551#define mexAtExit(exitfcn)                              mexAtExit_d(exitfcn, __FILE__, __LINE__)
552#define mexCallMATLAB(nlhs, plhs, nrhs, prhs, fcn) mexCallMATLAB_d(nlhs, plhs, nrhs, prhs, fcn, __FILE__, __LINE__)
553#define mexErrMsgTxt(errmsg)                    mexErrMsgTxt_d(errmsg, __FILE__, __LINE__)
554#define mexEvalString(str)                              mexEvalString_d(str, __FILE__, __LINE__)
555#define mexGet(handle, property)                mexGet_d(handle, property, __FILE__, __LINE__)
556#define mexGetVariable(workspace, name)         mexGetVariable_d(workspace, name, __FILE__, __LINE__)
557#define mexGetVariablePtr(workspace, name)      mexGetVariablePtr_d(workspace, name, __FILE__, __LINE__)
558#define mexIsGlobal(pa)                 mexIsGlobal_d(pa, __FILE__, __LINE__)
559#define mexMakeArrayPersistent(pa)              mexMakeArrayPersistent_d(pa, __FILE__, __LINE__)             
560#define mexMakeMemoryPersistent(ptr)    mexMakeMemoryPersistent_d(ptr, __FILE__, __LINE__)
561#define mexPutVariable(workspace, name, pa)     mexPutVariable_d(workspace, name, pa, __FILE__, __LINE__)
562#define mexSet(handle, property, value) mexSet_d(handle, property, value, __FILE__, __LINE__)
563#define mexSetTrapFlag(value)           mexSetTrapFlag_d(value, __FILE__, __LINE__)
564#define mexSubsAssign(plhs, sub, nsubs, rhs)    mexSubsAssign_d(plhs, sub, nsubs, rhs, __FILE__, __LINE__)
565#define mexSubsReference(prhs, sub, nsubs)    mexSubsReference_d(prhs, sub, nsubs, __FILE__, __LINE__)
566#define mexWarnMsgTxt(str)                              mexWarnMsgTxt_d(str, __FILE__, __LINE__)
567#endif
568
569#endif /* mex_h */
Note: See TracBrowser for help on using the repository browser.