core/matlab/include/engine.h

00001 /*
00002  * @(#)engine.h    generated by: makeheader 5.1.3  Thu Jan 11 15:47:30 2007
00003  *
00004  *      built from: ../../src/include/copyright.h
00005  *              ../../src/include/pragma_interface.h
00006  *              ./engapi.cpp
00007  *              ./engapiv4.cpp
00008  *              ./engapiv5.cpp
00009  *              ./fengapi.cpp
00010  *              ./fengapi_stdcall.cpp
00011  *              ./fengapiv5.cpp
00012  */
00013 
00014 #if defined(_MSC_VER) || __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)
00015 #pragma once
00016 #endif
00017 
00018 #ifndef engine_h
00019 #define engine_h
00020 
00021 
00022 /*
00023  * Copyright 1984-2003 The MathWorks, Inc.
00024  * All Rights Reserved.
00025  */
00026 
00027 
00028 
00029 /* Copyright 2003-2004 The MathWorks, Inc. */
00030 
00031 /* Only define EXTERN_C if it hasn't been defined already. This allows
00032  * individual modules to have more control over managing their exports.
00033  */
00034 #ifndef EXTERN_C
00035 
00036 #ifdef __cplusplus
00037   #define EXTERN_C extern "C"
00038 #else
00039   #define EXTERN_C extern
00040 #endif
00041 
00042 #endif
00043 
00044 
00045 #include "matrix.h"     /* mx Routines used in module */
00046 
00047 
00048 typedef struct engine Engine;   /* Incomplete definition for Engine */
00049 
00050 
00051 /*
00052  * Execute matlab statement
00053  */
00054 EXTERN_C int engEvalString(
00055     Engine  *ep,        /* engine pointer */
00056     const char *string  /* string for matlab t execute */
00057     );
00058 
00059 
00060 /*
00061  * Start matlab process for single use.
00062  * Not currently supported on UNIX.
00063  */
00064 EXTERN_C Engine *engOpenSingleUse(
00065              const char *startcmd, /* exec command string used to start matlab */
00066              void *reserved, /* reserved for future use, must be NULL */
00067              int *retstatus /* return status */
00068 );
00069 
00070 
00071 /*
00072  * SetVisible, do nothing since this function is only for NT 
00073  */ 
00074 EXTERN_C int engSetVisible( 
00075           Engine *ep,        /* engine pointer */ 
00076           bool newVal 
00077           );
00078 
00079 
00080 /* 
00081  * GetVisible, do nothing since this function is only for NT 
00082  */ 
00083 EXTERN_C int engGetVisible( 
00084           Engine *ep,        /* engine pointer */ 
00085           bool* bVal 
00086           );
00087 
00088 
00089 /* 
00090  * Start matlab process
00091  */
00092 EXTERN_C Engine *engOpen(
00093     const char *startcmd /* exec command string used to start matlab */
00094     );
00095 
00096 
00097 /*
00098  * Close down matlab server
00099  */
00100 EXTERN_C int engClose(
00101     Engine  *ep         /* engine pointer */
00102     );
00103 
00104 
00105 /*
00106  * Get a variable with the specified name from MATLAB's workspace
00107  */
00108 EXTERN_C mxArray *engGetVariable(
00109     Engine  *ep,        /* engine pointer */
00110     const char *name    /* name of variable to get */
00111     );
00112 
00113 
00114 /*
00115  * Put a variable into MATLAB's workspace with the specified name
00116  */
00117 EXTERN_C int engPutVariable(
00118            Engine   *ep,        /* engine pointer */
00119            const char *var_name,
00120            const mxArray *ap   /* array pointer */
00121            );
00122 
00123 
00124 /*
00125  * register a buffer to hold matlab text output
00126  */
00127 EXTERN_C int engOutputBuffer(
00128     Engine  *ep,        /* engine pointer */
00129     char    *buffer,    /* character array to hold output */
00130     int     buflen      /* buffer array length */
00131     );
00132 
00133 
00134 #define engOpenV4()      cannot_call_engOpenV4
00135 
00136 
00137 #define engGetFull()     engGetFull_is_obsolete
00138 #define engPutFull()     engPutFull_is_obsolete
00139 #define engGetMatrix()   engGetMatrix_is_obsolete
00140 #define engPutMatrix()   engPutMatrix_is_obsolete
00141 
00142 
00143 #if defined(V5_COMPAT)
00144 #define engPutArray(ep, ap)   engPutVariable(ep, mxGetName(ap), ap)
00145 #define engGetArray(ep, name) engGetVariable(ep, name)
00146 #else
00147 #define engPutArray() engPutArray_is_obsolete
00148 #define engGetArray() engGetArray_is_obsolete
00149 #endif /* defined(V5_COMPAT) */
00150 
00151 #endif /* engine_h */

GridLAB-DTM Version 1.0
An open-source project initiated by the US Department of Energy