MATLAB Production Server C Client R2026a component: mds_c_client, module directory: deployment_server/client/c/mps, copyright: MathWorks |

Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
1
4#ifndef MATHWORKS_MPS_CLIENT
5#define MATHWORKS_MPS_CLIENT
6
7#define MPS_CLIENT_1_0 0x00010000
8#define MPS_CLIENT_1_1 0x00010001
9
10#ifndef MPS_MAX_VER
11#define MPS_MAX_VER MPS_CLIENT_1_1
12#endif
13
14#ifdef _MSC_VER
15#define MPS_DLL_EXPORT_SYM __declspec(dllexport)
16#define MPS_DLL_IMPORT_SYM __declspec(dllimport)
17#elif __GNUC__ >= 4
18#define MPS_DLL_EXPORT_SYM __attribute__((visibility("default")))
19#define MPS_DLL_IMPORT_SYM __attribute__((visibility("default")))
20#else
21#define MPS_DLL_EXPORT_SYM
22#define MPS_DLL_IMPORT_SYM
23#endif
24
25#if defined(BUILDING_MPSCLIENT)
26#define MPSCLIENT_PUBLISHED_API MPS_DLL_EXPORT_SYM
27#else
28#define MPSCLIENT_PUBLISHED_API MPS_DLL_IMPORT_SYM
29#endif
30
31#ifdef __cplusplus
32#define MPSCLIENT_PUBLISHED_API_EXTERN_C extern "C" MPSCLIENT_PUBLISHED_API
33#else
34#define MPSCLIENT_PUBLISHED_API_EXTERN_C extern MPSCLIENT_PUBLISHED_API
35#endif
36
37#include <limits.h>
38
39#ifdef _MSC_VER
40 typedef unsigned __int64 uint64;
41#else
42#include <stddef.h>
43#include <stdint.h>
44 typedef uint64_t uint64;
45#endif
46
48 typedef uint64 mpsSize;
49
51 typedef uint64 mpsIndex;
52
55 typedef struct mpsArray mpsArray;
56
61 typedef struct mpsClientConfig mpsClientConfig;
62
69 typedef struct mpsClientContext mpsClientContext;
70
71#ifndef TMW_BITS_PER_INT
72#if INT_MAX == 0x7FL
73#define TMW_BITS_PER_INT 8
74#elif INT_MAX == 0x7FFFL
75#define TMW_BITS_PER_INT 16
76#elif INT_MAX == 0x7FFFFFFFL
77#define TMW_BITS_PER_INT 32
78#else
79#define TMW_BITS_PER_INT -1
80#endif
81#endif
82
83#ifndef TMW_BITS_PER_LONG
84#if LONG_MAX == 0x7FL
85#define TMW_BITS_PER_LONG 8
86#elif LONG_MAX == 0x7FFFL
87#define TMW_BITS_PER_LONG 16
88#elif LONG_MAX == 0x7FFFFFFFL
89#define TMW_BITS_PER_LONG 32
90#else
91#define TMW_BITS_PER_LONG -1
92#endif
93#endif
94
95#ifndef TMW_BITS_PER_SCHAR
96#if SCHAR_MAX == 0x7FL
97#define TMW_BITS_PER_SCHAR 8
98#elif SCHAR_MAX == 0x7FFFL
99#define TMW_BITS_PER_SCHAR 16
100#elif SCHAR_MAX == 0x7FFFFFFFL
101#define TMW_BITS_PER_SCHAR 32
102#else
103#define TMW_BITS_PER_SCHAR -1
104#endif
105#endif
106
107#ifndef TMW_BITS_PER_SHRT
108#if SHRT_MAX == 0x7FL
109#define TMW_BITS_PER_SHRT 8
110#elif SHRT_MAX == 0x7FFFL
111#define TMW_BITS_PER_SHRT 16
112#elif SHRT_MAX == 0x7FFFFFFFL
113#define TMW_BITS_PER_SHRT 32
114#else
115#define TMW_BITS_PER_SHRT -1
116#endif
117#endif
118
119#ifndef UINT16_T
120#if TMW_BITS_PER_INT == 16
121#define UINT16_T unsigned int
122#elif TMW_BITS_PER_LONG == 16
123#define UINT16_T unsigned long
124#elif TMW_BITS_PER_SCHAR == 16
125#define UINT16_T unsigned char
126#elif TMW_BITS_PER_SHRT == 16
127#define UINT16_T unsigned short
128#endif
129#endif
130
131/* +0 because of a doxygen bug */
132#if (defined(__cplusplus) && (__cplusplus + 0 >= 201103L)) || \
133 (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT)
134 typedef char16_t CHAR16_T;
135#elif defined(_MSC_VER)
136 typedef wchar_t CHAR16_T;
137#else
138 typedef UINT16_T CHAR16_T;
139#endif
140
141 typedef CHAR16_T mpsChar;
142
143#if !defined(__cplusplus)
144
145 typedef unsigned char bool;
146
147#ifndef false
148#define false (0)
149#endif
150#ifndef true
151#define true (1)
152#endif
153
154#endif
155
158 typedef bool mpsLogical;
159
161 typedef enum mpsErrorInfoType {
162
164 MPS_HTTP_ERROR_INFO,
165
167 MPS_MATLAB_ERROR_INFO,
168
170 MPS_GENERIC_ERROR_INFO
171
172} mpsErrorInfoType;
173
174
176 typedef struct mpsErrorInfoHTTP
177{
178
180 unsigned int responseCode;
181
183 const char* responseMessage;
184
185} mpsErrorInfoHTTP;
186
187
189 typedef struct matlabStackFrame
190{
191
193 const char* file;
194
196 const char* function;
197
199 int line;
200
201} matlabStackFrame;
202
203
205 typedef struct mpsErrorInfoMATLAB
206{
207
209 const char* message;
210
212 const char* identifier;
213
215 const matlabStackFrame* matlabStack;
216
218 size_t matlabStackDepth;
219
220} mpsErrorInfoMATLAB;
221
223 typedef struct mpsErrorInfoGeneric
224{
225
227 const char* genericErrorMsg;
228
229} mpsErrorInfoGeneric;
230
231
233 typedef struct mpsErrorInfo
234{
235
237 mpsErrorInfoType type;
238
240 char const* message;
241
243 union {
245 mpsErrorInfoHTTP http;
246
248 mpsErrorInfoMATLAB matlab;
249
251 mpsErrorInfoGeneric general;
252 } details;
253
254} mpsErrorInfo;
255
257 typedef enum mpsStatus {
258
260 MPS_OK,
261
263 MPS_FAILURE
264
265} mpsStatus;
266
268 typedef enum mpsComplexity {
270 mpsREAL,
272 mpsCOMPLEX
273} mpsComplexity;
274
276 typedef enum mpsClassID {
279 mpsUINT8_CLASS,
282 mpsINT8_CLASS,
284 mpsUINT16_CLASS,
286 mpsINT16_CLASS,
288 mpsUINT32_CLASS,
290 mpsINT32_CLASS,
292 mpsUINT64_CLASS,
294 mpsINT64_CLASS,
296 mpsSINGLE_CLASS,
298 mpsDOUBLE_CLASS,
300 mpsLOGICAL_CLASS,
302 mpsCHAR_CLASS,
304 mpsSTRUCT_CLASS,
306 mpsCELL_CLASS
307} mpsClassID;
308
314 typedef struct mpsClientRuntime
315{
316
327 mpsStatus (*createConfig)(mpsClientConfig** config);
328
332 void (*destroyConfig)(mpsClientConfig* config);
333
335 void (*setResponseTimeOutSec)(mpsClientConfig* config, unsigned long value);
336
338 unsigned long (*getResponseTimeOutSec)(const mpsClientConfig* config);
339
341 void (*setResponseSizeLimit)(mpsClientConfig* config, unsigned int value);
342
344 unsigned int (*getResponseSizeLimit)(const mpsClientConfig* config);
345
358 mpsStatus (*createContext)(mpsClientContext** context, const mpsClientConfig* config);
359
368 void (*destroyContext)(mpsClientContext* context);
369
383 void (*getLastErrorInfo)(mpsClientContext const* context, mpsErrorInfo* errorInfo);
384
387 void (*destroyLastErrorInfo)(mpsErrorInfo* errorInfo);
388
411 mpsStatus (*feval)(mpsClientContext* context,
412 const char* url,
413 int nlhs,
414 mpsArray* plhs[],
415 int nrhs,
416 const mpsArray* prhs[]);
417
422#if MPS_MAX_VER >= MPS_CLIENT_1_1
423
425 void (*setClientCertFile)(mpsClientConfig* config, const char* certFile);
426
428 const char* (*getClientCertFile)(const mpsClientConfig* config);
429
431 void (*setPrivateKeyFile)(mpsClientConfig* config, const char* pkFile);
432
434 const char* (*getPrivateKeyFile)(const mpsClientConfig* config);
435
437 void (*setPrivateKeyPasswd)(mpsClientConfig* config, const char* passwd);
438
440 const char* (*getPrivateKeyPasswd)(const mpsClientConfig* config);
441
443 void (*setCAFile)(mpsClientConfig* config, const char* caFile);
444
446 const char* (*getCAFile)(const mpsClientConfig* config);
447
449 void (*setRevocationListFile)(mpsClientConfig* config, const char* crlFile);
450
452 const char* (*getRevocationListFile)(const mpsClientConfig* config);
453
456 void (*setVerifyHost)(mpsClientConfig* config, mpsLogical verifyHost);
457
459 mpsLogical (*getVerifyHost)(const mpsClientConfig* config);
460
464 void (*setVerifyPeer)(mpsClientConfig* config, mpsLogical verifyPeer);
465
467 mpsLogical (*getVerifyPeer)(const mpsClientConfig* config);
468
469#endif
470
471} mpsClientRuntime;
472
479 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsClientRuntime* mpsInitialize(void);
480
490 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsClientRuntime* mpsInitializeEx(int version);
491
496 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsTerminate(void);
497
501 MPSCLIENT_PUBLISHED_API_EXTERN_C const char* mpsGetInitializationErrorMessage(void);
502
508 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsDouble(const mpsArray* mlArr);
509
515 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsSingle(const mpsArray* mlArr);
516
521 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsComplex(const mpsArray* mlArr);
522
527 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsNumeric(const mpsArray* mlArr);
528
533 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsInt64(const mpsArray* mlArr);
534
539 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsUint64(const mpsArray* mlArr);
540
545 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsInt32(const mpsArray* mlArr);
546
551 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsUint32(const mpsArray* mlArr);
552
557 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsInt16(const mpsArray* mlArr);
558
563 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsUint16(const mpsArray* mlArr);
564
569 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsInt8(const mpsArray* mlArr);
570
575 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsUint8(const mpsArray* mlArr);
576
581 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsChar(const mpsArray* mlArr);
582
587 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsLogical(const mpsArray* mlArr);
588
594 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsLogicalScalar(const mpsArray* mlArr);
595
600 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsLogicalScalarTrue(const mpsArray* mlArr);
601
606 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsStruct(const mpsArray* mlArr);
607
612 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsCell(const mpsArray* mlArr);
613
639 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsClass(const mpsArray* mlArr, const char* classname);
640
645 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsEmpty(const mpsArray* mlArr);
646
651 MPSCLIENT_PUBLISHED_API_EXTERN_C bool mpsIsSparse(const mpsArray* mlArr);
652
660 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateDoubleMatrix(mpsSize m,
661 mpsSize n,
662 mpsComplexity complexFlag);
663
668 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateDoubleScalar(double value);
669
679 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateNumericMatrix(mpsSize m,
680 mpsSize n,
681 mpsClassID classid,
682 mpsComplexity complexFlag);
683
695 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateNumericArray(mpsSize ndim,
696 const mpsSize* dims,
697 mpsClassID classid,
698 mpsComplexity complexFlag);
699
704 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateString(const char* str);
705
712 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateCharMatrixFromStrings(mpsSize rows,
713 const char** str);
714
722 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateCharArray(mpsSize ndim, const mpsSize* dims);
723
728 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateLogicalScalar(mpsLogical value);
729
735 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateLogicalMatrix(mpsSize m, mpsSize n);
736
744 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateLogicalArray(mpsSize ndim, const mpsSize* dims);
745
753 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateStructMatrix(mpsSize m,
754 mpsSize n,
755 int nfields,
756 const char** fieldnames);
757
767 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateStructArray(mpsSize ndim,
768 const mpsSize* dims,
769 int nfields,
770 const char** fieldnames);
771
777 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateCellMatrix(mpsSize m, mpsSize n);
778
786 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateCellArray(mpsSize ndim, const mpsSize* dims);
787
799 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateSparse(mpsSize m,
800 mpsSize n,
801 mpsSize nzmax,
802 mpsComplexity complexFlag);
803
812 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsCreateSparseLogicalMatrix(mpsSize m,
813 mpsSize n,
814 mpsSize nzmax);
815
824 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsDestroyArray(mpsArray* mlArr);
825
830 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsDuplicateArray(const mpsArray* mlArr);
831
835 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsFree(void* data);
836
841 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsSize mpsGetNumberOfDimensions(const mpsArray* mlArr);
842
847 MPSCLIENT_PUBLISHED_API_EXTERN_C size_t mpsGetElementSize(const mpsArray* mlArr);
848
855 MPSCLIENT_PUBLISHED_API_EXTERN_C const mpsSize* mpsGetDimensions(const mpsArray* mlArr);
856
864 MPSCLIENT_PUBLISHED_API_EXTERN_C int mpsSetDimensions(mpsArray* mlArr,
865 const mpsSize* dims,
866 mpsSize ndim);
867
872 MPSCLIENT_PUBLISHED_API_EXTERN_C size_t mpsGetNumberOfElements(const mpsArray* mlArr);
873
885 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsIndex mpsCalcSingleSubscript(const mpsArray* mlArr,
886 mpsSize nsubs,
887 mpsIndex* subs);
888
893 MPSCLIENT_PUBLISHED_API_EXTERN_C size_t mpsGetM(const mpsArray* mlArr);
894
899 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsSetM(mpsArray* mlArr, mpsSize m);
900
905 MPSCLIENT_PUBLISHED_API_EXTERN_C size_t mpsGetN(const mpsArray* mlArr);
906
911 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsSetN(mpsArray* mlArr, mpsSize n);
912
917 MPSCLIENT_PUBLISHED_API_EXTERN_C double mpsGetScalar(const mpsArray* mlArr);
918
923 MPSCLIENT_PUBLISHED_API_EXTERN_C double* mpsGetPr(const mpsArray* mlArr);
924
929 MPSCLIENT_PUBLISHED_API_EXTERN_C double* mpsGetPi(const mpsArray* mlArr);
930
935 MPSCLIENT_PUBLISHED_API_EXTERN_C void* mpsGetData(const mpsArray* mlArr);
936
941 MPSCLIENT_PUBLISHED_API_EXTERN_C void* mpsGetImagData(const mpsArray* mlArr);
942
947 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsChar* mpsGetChars(const mpsArray* mlArr);
948
956 MPSCLIENT_PUBLISHED_API_EXTERN_C int mpsGetString(const mpsArray* mlArr, char* str, mpsSize len);
957
962 MPSCLIENT_PUBLISHED_API_EXTERN_C char* mpsArrayToString(const mpsArray* mlArr);
963
968 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsClassID mpsGetClassID(const mpsArray* mlArr);
969
974 MPSCLIENT_PUBLISHED_API_EXTERN_C const char* mpsGetClassName(const mpsArray* mlArr);
975
980 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsLogical* mpsGetLogicals(const mpsArray* mlArr);
981
988 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsGetField(const mpsArray* mlArr,
989 mpsIndex index,
990 const char* fieldname);
991
999 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsSetField(mpsArray* mlArr,
1000 mpsIndex index,
1001 const char* fieldname,
1002 mpsArray* pvalue);
1003
1008 MPSCLIENT_PUBLISHED_API_EXTERN_C int mpsGetNumberOfFields(const mpsArray* mlArr);
1009
1015 MPSCLIENT_PUBLISHED_API_EXTERN_C int mpsGetFieldNumber(const mpsArray* mlArr,
1016 const char* fieldname);
1017
1023 MPSCLIENT_PUBLISHED_API_EXTERN_C const char* mpsGetFieldNameByNumber(const mpsArray* mlArr,
1024 int fieldnumber);
1025
1032 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsGetFieldByNumber(const mpsArray* mlArr,
1033 mpsIndex index,
1034 int fieldnumber);
1035
1042 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsSetFieldByNumber(mpsArray* mlArr,
1043 mpsIndex index,
1044 int fieldnumber,
1045 mpsArray* pvalue);
1046
1053 MPSCLIENT_PUBLISHED_API_EXTERN_C int mpsAddField(mpsArray* mlArr, const char* fieldname);
1054
1059 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsRemoveField(mpsArray* mlArr, int fieldnumber);
1060
1066 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsArray* mpsGetCell(const mpsArray* mlArr, mpsIndex index);
1067
1074 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsSetCell(mpsArray* mlArr, mpsIndex index, mpsArray* value);
1075
1080 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsSize mpsGetNzmax(const mpsArray* mlArr);
1081
1089 MPSCLIENT_PUBLISHED_API_EXTERN_C void mpsSetNzmax(mpsArray* mlArr, mpsSize nzmax);
1090
1095 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsIndex* mpsGetIr(const mpsArray* mlArr);
1096
1101 MPSCLIENT_PUBLISHED_API_EXTERN_C mpsIndex* mpsGetJc(const mpsArray* mlArr);
1102
1103#endif
mpsIsSparse
bool mpsIsSparse(const mpsArray *mlArr)
Determine whether array is sparse.
mpsIsUint8
bool mpsIsUint8(const mpsArray *mlArr)
Determine whether mpsArray represents data as unsigned 8-bit integers.
mpsGetNumberOfFields
int mpsGetNumberOfFields(const mpsArray *mlArr)
Determine the number of fields in an array of struct.
mpsSetDimensions
int mpsSetDimensions(mpsArray *mlArr, const mpsSize *dims, mpsSize ndim)
Modify number of dimensions and size of each dimension of an array.
mpsErrorInfoType
mpsErrorInfoType
Types of errors that can be thrown when MATLAB function invocation fails.
Definition client.h:161
MPS_GENERIC_ERROR_INFO
@ MPS_GENERIC_ERROR_INFO
Any error other than MATLAB execution error or a non-200 HTTP response.
Definition client.h:170
MPS_HTTP_ERROR_INFO
@ MPS_HTTP_ERROR_INFO
A non-200 HTTP response when MATLAB function in invoked from the client.
Definition client.h:164
MPS_MATLAB_ERROR_INFO
@ MPS_MATLAB_ERROR_INFO
A MATLAB execution error.
Definition client.h:167
mpsGetLogicals
mpsLogical * mpsGetLogicals(const mpsArray *mlArr)
Access the first logical element in an array.
CHAR16_T
UINT16_T CHAR16_T
Definition client.h:138
mpsErrorInfoHTTP
struct mpsErrorInfoHTTP mpsErrorInfoHTTP
Details about a non-200 HTTP response.
mpsCreateCellMatrix
mpsArray * mpsCreateCellMatrix(mpsSize m, mpsSize n)
Create a two-dimensional cell array.
mpsGetNumberOfElements
size_t mpsGetNumberOfElements(const mpsArray *mlArr)
Determine how many elements are in the array.
mpsIsDouble
bool mpsIsDouble(const mpsArray *mlArr)
Determine whether mpsArray represents data as double-precision, floating-point numbers.
mpsGetScalar
double mpsGetScalar(const mpsArray *mlArr)
Determine the value of the first real element of an array.
MPSCLIENT_PUBLISHED_API_EXTERN_C
#define MPSCLIENT_PUBLISHED_API_EXTERN_C
Definition client.h:32
mpsIsLogicalScalarTrue
bool mpsIsLogicalScalarTrue(const mpsArray *mlArr)
Determine whether scalar array is true.
mpsCreateLogicalScalar
mpsArray * mpsCreateLogicalScalar(mpsLogical value)
Create a scalar logical array.
mpsIsStruct
bool mpsIsStruct(const mpsArray *mlArr)
Determine whether input is structure array.
mpsAddField
int mpsAddField(mpsArray *mlArr, const char *fieldname)
Add a field to an array of struct.
mpsClientContext
struct mpsClientContext mpsClientContext
Establishes a connection between a client and a server.
Definition client.h:69
mpsComplexity
mpsComplexity
Flag specifying whether array has imaginary components.
Definition client.h:268
mpsREAL
@ mpsREAL
Identifies an mpsArray with no imaginary components.
Definition client.h:270
mpsCOMPLEX
@ mpsCOMPLEX
Identifies an mpsArray with imaginary components.
Definition client.h:272
mpsErrorInfoGeneric
struct mpsErrorInfoGeneric mpsErrorInfoGeneric
Details about an error not caused by non-200 HTTP errors or MATLAB execution errors.
mpsCreateSparse
mpsArray * mpsCreateSparse(mpsSize m, mpsSize n, mpsSize nzmax, mpsComplexity complexFlag)
Create a two-dimensional sparse array.
mpsCreateCellArray
mpsArray * mpsCreateCellArray(mpsSize ndim, const mpsSize *dims)
Create a N-dimensional cell array.
mpsSize
uint64 mpsSize
Type that represents size values, such as array dimensions.
Definition client.h:48
mpsIsUint32
bool mpsIsUint32(const mpsArray *mlArr)
Determine whether mpsArray represents data as unsigned 32-bit integers.
mpsGetCell
mpsArray * mpsGetCell(const mpsArray *mlArr, mpsIndex index)
Access the contents of a cell array at a specified index.
mpsCreateLogicalMatrix
mpsArray * mpsCreateLogicalMatrix(mpsSize m, mpsSize n)
Create a two-dimensional logical array.
mpsSetM
void mpsSetM(mpsArray *mlArr, mpsSize m)
Set the first dimension of an array.
mpsIsUint64
bool mpsIsUint64(const mpsArray *mlArr)
Determine whether mpsArray represents data as unsigned 64-bit integers.
mpsGetChars
mpsChar * mpsGetChars(const mpsArray *mlArr)
Access the data in a character array.
mpsGetInitializationErrorMessage
const char * mpsGetInitializationErrorMessage(void)
Returns the error message representing the failure in global initialization that sets up the programm...
mpsIndex
uint64 mpsIndex
Type that represents index values, such as indices into arrays.
Definition client.h:51
mpsIsInt32
bool mpsIsInt32(const mpsArray *mlArr)
Determine whether mpsArray represents data as signed 32-bit integers.
mpsClientRuntime
struct mpsClientRuntime mpsClientRuntime
MATLAB Production Server client API container.
mpsGetFieldNumber
int mpsGetFieldNumber(const mpsArray *mlArr, const char *fieldname)
Determine the number of a field in an array of struct given the field name.
mpsIsClass
bool mpsIsClass(const mpsArray *mlArr, const char *classname)
Determine whether array is member of specified class.
mpsCreateString
mpsArray * mpsCreateString(const char *str)
Create a string array.
mpsCreateLogicalArray
mpsArray * mpsCreateLogicalArray(mpsSize ndim, const mpsSize *dims)
Create a N-dimensional logical array.
mpsGetString
int mpsGetString(const mpsArray *mlArr, char *str, mpsSize len)
Copy the character data of a string array into a C-style string.
mpsGetElementSize
size_t mpsGetElementSize(const mpsArray *mlArr)
Determine the number of bytes in each data element of an array.
mpsCreateNumericMatrix
mpsArray * mpsCreateNumericMatrix(mpsSize m, mpsSize n, mpsClassID classid, mpsComplexity complexFlag)
Create a two-dimensional numeric array.
mpsGetNumberOfDimensions
mpsSize mpsGetNumberOfDimensions(const mpsArray *mlArr)
Determine the number of dimensions in an array.
matlabStackFrame
struct matlabStackFrame matlabStackFrame
Entry in the MATLAB runtime stack.
mpsCreateCharMatrixFromStrings
mpsArray * mpsCreateCharMatrixFromStrings(mpsSize rows, const char **str)
Create a two-dimensional string array.
mpsSetNzmax
void mpsSetNzmax(mpsArray *mlArr, mpsSize nzmax)
Set the maximum number of non-zero elements in a sparse array.
mpsGetClassID
mpsClassID mpsGetClassID(const mpsArray *mlArr)
Determine the class of an array.
mpsGetJc
mpsIndex * mpsGetJc(const mpsArray *mlArr)
Determine the starting address of the jc array in a sparse array.
mpsGetM
size_t mpsGetM(const mpsArray *mlArr)
Determine the first dimension of an array.
mpsIsSingle
bool mpsIsSingle(const mpsArray *mlArr)
Determine whether mpsArray represents data as single-precision, floating-point numbers.
mpsCreateSparseLogicalMatrix
mpsArray * mpsCreateSparseLogicalMatrix(mpsSize m, mpsSize n, mpsSize nzmax)
Create a two-dimensional sparse array.
mpsIsEmpty
bool mpsIsEmpty(const mpsArray *mlArr)
Determine whether array is empty.
mpsGetPr
double * mpsGetPr(const mpsArray *mlArr)
Access the real data in an array of doubles.
mpsGetNzmax
mpsSize mpsGetNzmax(const mpsArray *mlArr)
Determine the number of non-zero elements in a sparse array.
mpsCreateCharArray
mpsArray * mpsCreateCharArray(mpsSize ndim, const mpsSize *dims)
Create a N-dimensional string array.
mpsErrorInfo
struct mpsErrorInfo mpsErrorInfo
Error thrown when a MATLAB function is invoked by the MATLAB Production Server client context.
mpsTerminate
void mpsTerminate(void)
Perform global clean up of resources consumed by MATLAB Production Server client environment.
mpsSetFieldByNumber
void mpsSetFieldByNumber(mpsArray *mlArr, mpsIndex index, int fieldnumber, mpsArray *pvalue)
Set the value held in the specified field number at the indexed element of an array.
mpsCreateDoubleScalar
mpsArray * mpsCreateDoubleScalar(double value)
Create a scalar double-precision floating-point array.
mpsLogical
bool mpsLogical
Type for logical array.
Definition client.h:158
mpsClassID
mpsClassID
Flag identifying class of array.
Definition client.h:276
mpsCHAR_CLASS
@ mpsCHAR_CLASS
Identifies a string mpsArray.
Definition client.h:302
mpsINT8_CLASS
@ mpsINT8_CLASS
Identifies a numeric mpsArray whose data is stored as either char or byte.
Definition client.h:282
mpsINT64_CLASS
@ mpsINT64_CLASS
Identifies a numeric mpsArray whose data is stored as long long.
Definition client.h:294
mpsUINT8_CLASS
@ mpsUINT8_CLASS
Identifies a numeric mpsArray whose data is stored as either unsigned char or byte.
Definition client.h:279
mpsDOUBLE_CLASS
@ mpsDOUBLE_CLASS
Identifies a numeric mpsArray whose data is stored as double.
Definition client.h:298
mpsINT32_CLASS
@ mpsINT32_CLASS
Identifies a numeric mpsArray whose data is stored as int.
Definition client.h:290
mpsINT16_CLASS
@ mpsINT16_CLASS
Identifies a numeric mpsArray whose data is stored as short.
Definition client.h:286
mpsUINT16_CLASS
@ mpsUINT16_CLASS
Identifies a numeric mpsArray whose data is stored as unsigned short.
Definition client.h:284
mpsSTRUCT_CLASS
@ mpsSTRUCT_CLASS
Identifies a structure mpsArray.
Definition client.h:304
mpsCELL_CLASS
@ mpsCELL_CLASS
Identifies a cell mpsArray.
Definition client.h:306
mpsUINT64_CLASS
@ mpsUINT64_CLASS
Identifies a numeric mpsArray whose data is stored as unsigned long long.
Definition client.h:292
mpsSINGLE_CLASS
@ mpsSINGLE_CLASS
Identifies a numeric mpsArray whose data is stored as float.
Definition client.h:296
mpsUINT32_CLASS
@ mpsUINT32_CLASS
Identifies a numeric mpsArray whose data is stored as unsigned int.
Definition client.h:288
mpsLOGICAL_CLASS
@ mpsLOGICAL_CLASS
Identifies a logical mpsArray.
Definition client.h:300
mpsIsUint16
bool mpsIsUint16(const mpsArray *mlArr)
Determine whether mpsArray represents data as unsigned 16-bit integers.
mpsGetIr
mpsIndex * mpsGetIr(const mpsArray *mlArr)
Determine the starting address of the ir array in a sparse array.
mpsDuplicateArray
mpsArray * mpsDuplicateArray(const mpsArray *mlArr)
Make a deep copy of input mpsArray.
mpsIsComplex
bool mpsIsComplex(const mpsArray *mlArr)
Determine whether mpsArray contains an imaginary part.
mpsRemoveField
void mpsRemoveField(mpsArray *mlArr, int fieldnumber)
Delete a field from an array of struct.
mpsGetClassName
const char * mpsGetClassName(const mpsArray *mlArr)
Determine the class of an array.
mpsGetPi
double * mpsGetPi(const mpsArray *mlArr)
Access the imaginary data in an array of doubles.
mpsCalcSingleSubscript
mpsIndex mpsCalcSingleSubscript(const mpsArray *mlArr, mpsSize nsubs, mpsIndex *subs)
Determine how many elements there are between the beginning of an array and a given element.
mpsIsNumeric
bool mpsIsNumeric(const mpsArray *mlArr)
Determine whether mpsArray contains numeric data.
mpsGetN
size_t mpsGetN(const mpsArray *mlArr)
Determine the number of columns in an array.
mpsIsLogical
bool mpsIsLogical(const mpsArray *mlArr)
Determine whether mpsArray represents data as mpsLogical.
mpsIsCell
bool mpsIsCell(const mpsArray *mlArr)
Determine whether input is cell array.
mpsSetN
void mpsSetN(mpsArray *mlArr, mpsSize n)
Set the number of columns in an array.
mpsErrorInfoMATLAB
struct mpsErrorInfoMATLAB mpsErrorInfoMATLAB
Details about a MATLAB execution error.
mpsCreateStructArray
mpsArray * mpsCreateStructArray(mpsSize ndim, const mpsSize *dims, int nfields, const char **fieldnames)
Create a N-dimensional struct array.
mpsStatus
mpsStatus
Error status codes for all methods which are part of the MATLAB Production Server client API.
Definition client.h:257
MPS_OK
@ MPS_OK
Successful invocation of a method.
Definition client.h:260
MPS_FAILURE
@ MPS_FAILURE
Failure.
Definition client.h:263
uint64
uint64_t uint64
Definition client.h:44
mpsInitialize
mpsClientRuntime * mpsInitialize(void)
Set up the programming environment for MATLAB Production Server client based on version 1....
mpsDestroyArray
void mpsDestroyArray(mpsArray *mlArr)
Deallocate the memory occupied by an array.
mpsChar
CHAR16_T mpsChar
Definition client.h:141
mpsIsInt8
bool mpsIsInt8(const mpsArray *mlArr)
Determine whether mpsArray represents data as signed 8-bit integers.
mpsIsInt64
bool mpsIsInt64(const mpsArray *mlArr)
Determine whether mpsArray represents data as signed 64-bit integers.
mpsGetFieldByNumber
mpsArray * mpsGetFieldByNumber(const mpsArray *mlArr, mpsIndex index, int fieldnumber)
Access the value held in the specified field number at the indexed element of an array.
mpsArrayToString
char * mpsArrayToString(const mpsArray *mlArr)
Copy the character data of a string array into a C-style string.
mpsSetCell
void mpsSetCell(mpsArray *mlArr, mpsIndex index, mpsArray *value)
Set the contents of a cell array at a specified index.
mpsGetImagData
void * mpsGetImagData(const mpsArray *mlArr)
Access the imaginary data in an array.
mpsGetData
void * mpsGetData(const mpsArray *mlArr)
Access the real numeric data in an array.
mpsGetDimensions
const mpsSize * mpsGetDimensions(const mpsArray *mlArr)
Determine how many elements are in each dimension of an array.
mpsIsInt16
bool mpsIsInt16(const mpsArray *mlArr)
Determine whether mpsArray represents data as signed 16-bit integers.
mpsIsLogicalScalar
bool mpsIsLogicalScalar(const mpsArray *mlArr)
Determine whether MATLAB treats the scalar data in the mpsArray as logical or numerical.
mpsCreateStructMatrix
mpsArray * mpsCreateStructMatrix(mpsSize m, mpsSize n, int nfields, const char **fieldnames)
Create a two-dimensional struct array.
mpsSetField
void mpsSetField(mpsArray *mlArr, mpsIndex index, const char *fieldname, mpsArray *pvalue)
Set the value held in the specified element of the specified field of an array of struct.
mpsInitializeEx
mpsClientRuntime * mpsInitializeEx(int version)
Set up the programming environment for MATLAB Production Server client based on the version number pr...
mpsGetFieldNameByNumber
const char * mpsGetFieldNameByNumber(const mpsArray *mlArr, int fieldnumber)
Determine the name of a field in an array of struct given the field number.
mpsIsChar
bool mpsIsChar(const mpsArray *mlArr)
Determine whether mpsArray represents a string array.
mpsClientConfig
struct mpsClientConfig mpsClientConfig
Structure containing information configuring the connection between the client and a server instance.
Definition client.h:61
mpsFree
void mpsFree(void *data)
Deallocate heap space using the MATLAB memory management facility.
mpsCreateNumericArray
mpsArray * mpsCreateNumericArray(mpsSize ndim, const mpsSize *dims, mpsClassID classid, mpsComplexity complexFlag)
Create a two-dimensional numeric array.
mpsGetField
mpsArray * mpsGetField(const mpsArray *mlArr, mpsIndex index, const char *fieldname)
Access the value held in the specified element of the specified field of an array of struct.
mpsCreateDoubleMatrix
mpsArray * mpsCreateDoubleMatrix(mpsSize m, mpsSize n, mpsComplexity complexFlag)
Create a two-dimensional double-precision floating-point array.
mpsArray
struct mpsArray mpsArray
Fundamental type underlying MATLAB data.
Definition client.h:55
matlabStackFrame
Entry in the MATLAB runtime stack.
Definition client.h:190
matlabStackFrame::function
const char * function
Name of the MATLAB function which in most cases is same as the MATLAB file name.
Definition client.h:196
matlabStackFrame::file
const char * file
Name of the MATLAB file that threw the MATLAB error.
Definition client.h:193
matlabStackFrame::line
int line
Line number in the MATLAB file where the error occurred.
Definition client.h:199
mpsClientRuntime
MATLAB Production Server client API container.
Definition client.h:315
mpsClientRuntime::createConfig
mpsStatus(* createConfig)(mpsClientConfig **config)
Initialize pointer to MATLAB Production Server client configuration instance with default values.
Definition client.h:327
mpsClientRuntime::setCAFile
void(* setCAFile)(mpsClientConfig *config, const char *caFile)
Set file Certificate Authority file in PEM format.
Definition client.h:443
mpsClientRuntime::getVerifyPeer
mpsLogical(* getVerifyPeer)(const mpsClientConfig *config)
Get the peer verification flag value.
Definition client.h:467
mpsClientRuntime::setVerifyPeer
void(* setVerifyPeer)(mpsClientConfig *config, mpsLogical verifyPeer)
Setting this flag to false will not peform the authentication of server certificate.
Definition client.h:464
mpsClientRuntime::setClientCertFile
void(* setClientCertFile)(mpsClientConfig *config, const char *certFile)
MPS_CLIENT_1_1 version provides support for request execution using HTTPS protocol for secure client-...
Definition client.h:425
mpsClientRuntime::getVerifyHost
mpsLogical(* getVerifyHost)(const mpsClientConfig *config)
Get the host verification flag value.
Definition client.h:459
mpsClientRuntime::setPrivateKeyPasswd
void(* setPrivateKeyPasswd)(mpsClientConfig *config, const char *passwd)
Set password for private key file.
Definition client.h:437
mpsClientRuntime::feval
mpsStatus(* feval)(mpsClientContext *context, const char *url, int nlhs, mpsArray *plhs[], int nrhs, const mpsArray *prhs[])
Invoke MATLAB function hosted by a server instance and available at a Url.
Definition client.h:411
mpsClientRuntime::getLastErrorInfo
void(* getLastErrorInfo)(mpsClientContext const *context, mpsErrorInfo *errorInfo)
Access the error thrown while invoking a MATLAB function from the client A MATLAB function invocation...
Definition client.h:383
mpsClientRuntime::setPrivateKeyFile
void(* setPrivateKeyFile)(mpsClientConfig *config, const char *pkFile)
Set private key file in PEM format.
Definition client.h:431
mpsClientRuntime::createContext
mpsStatus(* createContext)(mpsClientContext **context, const mpsClientConfig *config)
Initialize the MATLAB Production Server client execution context.
Definition client.h:358
mpsClientRuntime::setRevocationListFile
void(* setRevocationListFile)(mpsClientConfig *config, const char *crlFile)
Set the revocation list file.
Definition client.h:449
mpsClientRuntime::destroyContext
void(* destroyContext)(mpsClientContext *context)
Clean up the memory allocated for the client execution context.
Definition client.h:368
mpsClientRuntime::getResponseSizeLimit
unsigned int(* getResponseSizeLimit)(const mpsClientConfig *config)
Get the responze size limit value, in bytes, for the client.
Definition client.h:344
mpsClientRuntime::getResponseTimeOutSec
unsigned long(* getResponseTimeOutSec)(const mpsClientConfig *config)
Get the timeout value, in seconds, for the client to receive response from the server.
Definition client.h:338
mpsClientRuntime::destroyLastErrorInfo
void(* destroyLastErrorInfo)(mpsErrorInfo *errorInfo)
Cleans up dynamic memory allocated while initializing mpsErrorInfo instance.
Definition client.h:387
mpsClientRuntime::destroyConfig
void(* destroyConfig)(mpsClientConfig *config)
Clean up the memory allocated to the client configuration instance.
Definition client.h:332
mpsClientRuntime::setVerifyHost
void(* setVerifyHost)(mpsClientConfig *config, mpsLogical verifyHost)
Setting this flag to true will verify the hostname in thr url against the common name in the certific...
Definition client.h:456
mpsClientRuntime::setResponseSizeLimit
void(* setResponseSizeLimit)(mpsClientConfig *config, unsigned int value)
Set the response size limit value, in bytes, for the client.
Definition client.h:341
mpsClientRuntime::setResponseTimeOutSec
void(* setResponseTimeOutSec)(mpsClientConfig *config, unsigned long value)
Set the timeout value, in seconds, for the client to receive response from the server.
Definition client.h:335
mpsErrorInfoGeneric
Details about an error not caused by non-200 HTTP errors or MATLAB execution errors.
Definition client.h:224
mpsErrorInfoGeneric::genericErrorMsg
const char * genericErrorMsg
Error message corresponding to the generic error.
Definition client.h:227
mpsErrorInfoHTTP
Details about a non-200 HTTP response.
Definition client.h:177
mpsErrorInfoHTTP::responseMessage
const char * responseMessage
HTTP response message.
Definition client.h:183
mpsErrorInfoHTTP::responseCode
unsigned int responseCode
HTTP response code.
Definition client.h:180
mpsErrorInfoMATLAB
Details about a MATLAB execution error.
Definition client.h:206
mpsErrorInfoMATLAB::matlabStackDepth
size_t matlabStackDepth
Number of entries in the MATLAB stack.
Definition client.h:218
mpsErrorInfoMATLAB::message
const char * message
Error message corresponding to the error thrown in MATLAB.
Definition client.h:209
mpsErrorInfoMATLAB::matlabStack
const matlabStackFrame * matlabStack
MATLAB stack associated with the MATLAB error.
Definition client.h:215
mpsErrorInfoMATLAB::identifier
const char * identifier
Unique error identifier corresponding to the MATLAB error.
Definition client.h:212
mpsErrorInfo
Error thrown when a MATLAB function is invoked by the MATLAB Production Server client context.
Definition client.h:234
mpsErrorInfo::details
union mpsErrorInfo::@0 details
All possible errors that can be thrown when a MATLAB function is invoked from the client.
mpsErrorInfo::type
mpsErrorInfoType type
Type of underlying error.
Definition client.h:237
mpsErrorInfo::general
mpsErrorInfoGeneric general
Error other than MATLAB execution error and non-200 HTTP response.
Definition client.h:251
mpsErrorInfo::message
char const * message
Message regarding the error.
Definition client.h:240
mpsErrorInfo::http
mpsErrorInfoHTTP http
Error caused by a non-200 HTTP response.
Definition client.h:245
mpsErrorInfo::matlab
mpsErrorInfoMATLAB matlab
Error thrown during execution of MATLAB code.
Definition client.h:248