MATLAB Production Server C Client
R2024a
component: mds_c_client, module directory: deployment_server/client/c/mps, copyright: MathWorks
|
Go to the documentation of this file.
4 #ifndef MATHWORKS_MPS_CLIENT
5 #define MATHWORKS_MPS_CLIENT
7 #define MPS_CLIENT_1_0 0x00010000
8 #define MPS_CLIENT_1_1 0x00010001
11 #define MPS_MAX_VER MPS_CLIENT_1_1
15 #define MPS_DLL_EXPORT_SYM __declspec(dllexport)
16 #define MPS_DLL_IMPORT_SYM __declspec(dllimport)
18 #define MPS_DLL_EXPORT_SYM __attribute__ ((visibility("default")))
19 #define MPS_DLL_IMPORT_SYM __attribute__ ((visibility("default")))
21 #define MPS_DLL_EXPORT_SYM
22 #define MPS_DLL_IMPORT_SYM
25 #if defined(BUILDING_MPSCLIENT)
26 #define MPSCLIENT_PUBLISHED_API MPS_DLL_EXPORT_SYM
28 #define MPSCLIENT_PUBLISHED_API MPS_DLL_IMPORT_SYM
32 #define MPSCLIENT_PUBLISHED_API_EXTERN_C extern "C" MPSCLIENT_PUBLISHED_API
34 #define MPSCLIENT_PUBLISHED_API_EXTERN_C extern MPSCLIENT_PUBLISHED_API
40 typedef unsigned __int64
uint64;
71 #ifndef TMW_BITS_PER_INT
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
79 # define TMW_BITS_PER_INT -1
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
91 # define TMW_BITS_PER_LONG -1
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
103 # define TMW_BITS_PER_SCHAR -1
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
115 # define TMW_BITS_PER_SHRT -1
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
132 #if (defined(__cplusplus) && (__cplusplus+0 >= 201103L)) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT)
134 #elif defined(_MSC_VER)
142 #if !defined(__cplusplus)
144 typedef unsigned char bool;
193 const char*
function;
405 #if MPS_MAX_VER >= MPS_CLIENT_1_1
Identifies a numeric mpsArray whose data is stored as double.
int mpsAddField(mpsArray *mlArr, const char *fieldname)
Add a field to an array of struct.
double * mpsGetPi(const mpsArray *mlArr)
Access the imaginary data in an array of doubles.
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...
int line
Line number in the MATLAB file where the error occurred.
mpsArray * mpsCreateStructArray(mpsSize ndim, const mpsSize *dims, int nfields, const char **fieldnames)
Create a N-dimensional struct array.
void(* setClientCertFile)(mpsClientConfig *config, const char *certFile)
MPS_CLIENT_1_1 version provides support for request execution using HTTPS protocol for secure client-...
Identifies an mpsArray with no imaginary components.
mpsArray * mpsCreateDoubleScalar(double value)
Create a scalar double-precision floating-point array.
const char * mpsGetClassName(const mpsArray *mlArr)
Determine the class of an array.
void(* setResponseSizeLimit)(mpsClientConfig *config, unsigned int value)
Set the response size limit value, in bytes, for the client.
uint64 mpsIndex
Type that represents index values, such as indices into arrays.
void mpsTerminate(void)
Perform global clean up of resources consumed by MATLAB Production Server client environment.
mpsLogical(* getVerifyHost)(const mpsClientConfig *config)
Get the host verification flag value.
Identifies a numeric mpsArray whose data is stored as either char or byte.
void mpsSetN(mpsArray *mlArr, mpsSize n)
Set the number of columns in an array.
int mpsSetDimensions(mpsArray *mlArr, const mpsSize *dims, mpsSize ndim)
Modify number of dimensions and size of each dimension of an array.
mpsClientRuntime * mpsInitializeEx(int version)
Set up the programming environment for MATLAB Production Server client based on the version number pr...
bool mpsIsLogical(const mpsArray *mlArr)
Determine whether mpsArray represents data as mpsLogical.
#define MPSCLIENT_PUBLISHED_API_EXTERN_C
bool mpsIsNumeric(const mpsArray *mlArr)
Determine whether mpsArray contains numeric data.
mpsComplexity
Flag specifying whether array has imaginary components.
bool mpsIsLogicalScalar(const mpsArray *mlArr)
Determine whether MATLAB treats the scalar data in the mpsArray as logical or numerical.
size_t mpsGetM(const mpsArray *mlArr)
Determine the first dimension of an array.
unsigned long(* getResponseTimeOutSec)(const mpsClientConfig *config)
Get the timeout value, in seconds, for the client to receive response from the server.
const char * mpsGetInitializationErrorMessage(void)
Returns the error message representing the failure in global initialization that sets up the programm...
bool mpsIsUint64(const mpsArray *mlArr)
Determine whether mpsArray represents data as unsigned 64-bit integers.
Identifies a structure mpsArray.
const char * responseMessage
HTTP response message.
Details about a non-200 HTTP response.
char * mpsArrayToString(const mpsArray *mlArr)
Copy the character data of a string array into a C-style string.
size_t matlabStackDepth
Number of entries in the MATLAB stack.
mpsClassID
Flag identifying class of array.
mpsErrorInfoMATLAB matlab
Error thrown during execution of MATLAB code.
void(* setPrivateKeyFile)(mpsClientConfig *config, const char *pkFile)
Set private key file in PEM format.
bool mpsIsCell(const mpsArray *mlArr)
Determine whether input is cell array.
mpsStatus
Error status codes for all methods which are part of the MATLAB Production Server client API.
const mpsSize * mpsGetDimensions(const mpsArray *mlArr)
Determine how many elements are in each dimension of an array.
mpsLogical * mpsGetLogicals(const mpsArray *mlArr)
Access the first logical element in an array.
void(* destroyLastErrorInfo)(mpsErrorInfo *errorInfo)
Cleans up dynamic memory allocated while initializing mpsErrorInfo instance.
mpsArray * mpsCreateCellArray(mpsSize ndim, const mpsSize *dims)
Create a N-dimensional cell array.
MATLAB Production Server client API container.
mpsArray * mpsCreateNumericMatrix(mpsSize m, mpsSize n, mpsClassID classid, mpsComplexity complexFlag)
Create a two-dimensional numeric array.
mpsArray * mpsCreateLogicalMatrix(mpsSize m, mpsSize n)
Create a two-dimensional logical array.
void mpsFree(void *data)
Deallocate heap space using the MATLAB memory management facility.
mpsArray * mpsCreateString(const char *str)
Create a string array.
mpsArray * mpsCreateDoubleMatrix(mpsSize m, mpsSize n, mpsComplexity complexFlag)
Create a two-dimensional double-precision floating-point array.
mpsArray * mpsCreateCharMatrixFromStrings(mpsSize rows, const char **str)
Create a two-dimensional string array.
const matlabStackFrame * matlabStack
MATLAB stack associated with the MATLAB error.
bool mpsIsClass(const mpsArray *mlArr, const char *classname)
Determine whether array is member of specified class.
bool mpsIsEmpty(const mpsArray *mlArr)
Determine whether array is empty.
uint64 mpsSize
Type that represents size values, such as array dimensions.
Identifies a numeric mpsArray whose data is stored as unsigned short.
Identifies a numeric mpsArray whose data is stored as unsigned int.
void(* setCAFile)(mpsClientConfig *config, const char *caFile)
Set file Certificate Authority file in PEM format.
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.
unsigned int responseCode
HTTP response code.
struct mpsErrorInfoMATLAB mpsErrorInfoMATLAB
Details about a MATLAB execution error.
Identifies a numeric mpsArray whose data is stored as float.
bool mpsIsSingle(const mpsArray *mlArr)
Determine whether mpsArray represents data as single-precision, floating-point numbers.
mpsArray * mpsCreateStructMatrix(mpsSize m, mpsSize n, int nfields, const char **fieldnames)
Create a two-dimensional struct array.
void mpsSetM(mpsArray *mlArr, mpsSize m)
Set the first dimension of an array.
bool mpsIsComplex(const mpsArray *mlArr)
Determine whether mpsArray contains an imaginary part.
mpsErrorInfoType type
Type of underlying error.
unsigned int(* getResponseSizeLimit)(const mpsClientConfig *config)
Get the responze size limit value, in bytes, for the client.
mpsStatus(* createConfig)(mpsClientConfig **config)
Initialize pointer to MATLAB Production Server client configuration instance with default values.
bool mpsIsUint8(const mpsArray *mlArr)
Determine whether mpsArray represents data as unsigned 8-bit integers.
size_t mpsGetN(const mpsArray *mlArr)
Determine the number of columns in an array.
const char * message
Error message corresponding to the error thrown in MATLAB.
void mpsDestroyArray(mpsArray *mlArr)
Deallocate the memory occupied by an array.
struct mpsErrorInfoHTTP mpsErrorInfoHTTP
Details about a non-200 HTTP response.
struct mpsArray mpsArray
Fundamental type underlying MATLAB data.
bool mpsIsUint16(const mpsArray *mlArr)
Determine whether mpsArray represents data as unsigned 16-bit integers.
size_t mpsGetElementSize(const mpsArray *mlArr)
Determine the number of bytes in each data element of an array.
bool mpsIsInt8(const mpsArray *mlArr)
Determine whether mpsArray represents data as signed 8-bit integers.
mpsSize mpsGetNzmax(const mpsArray *mlArr)
Determine the number of non-zero elements in a sparse array.
mpsArray * mpsDuplicateArray(const mpsArray *mlArr)
Make a deep copy of input mpsArray.
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.
void(* setRevocationListFile)(mpsClientConfig *config, const char *crlFile)
Set the revocation list file.
mpsIndex * mpsGetIr(const mpsArray *mlArr)
Determine the starting address of the ir array in a sparse array.
A MATLAB execution error.
mpsStatus(* createContext)(mpsClientContext **context, const mpsClientConfig *config)
Initialize the MATLAB Production Server client execution context.
const char * identifier
Unique error identifier corresponding to the MATLAB error.
mpsErrorInfoType
Types of errors that can be thrown when MATLAB function invocation fails.
void mpsRemoveField(mpsArray *mlArr, int fieldnumber)
Delete a field from an array of struct.
int mpsGetString(const mpsArray *mlArr, char *str, mpsSize len)
Copy the character data of a string array into a C-style string.
mpsArray * mpsGetCell(const mpsArray *mlArr, mpsIndex index)
Access the contents of a cell array at a specified index.
mpsArray * mpsCreateCellMatrix(mpsSize m, mpsSize n)
Create a two-dimensional cell array.
const char * file
Name of the MATLAB file that threw the MATLAB error.
bool mpsIsStruct(const mpsArray *mlArr)
Determine whether input is structure array.
mpsClientRuntime * mpsInitialize(void)
Set up the programming environment for MATLAB Production Server client based on version 1....
void(* destroyContext)(mpsClientContext *context)
Clean up the memory allocated for the client execution context.
double mpsGetScalar(const mpsArray *mlArr)
Determine the value of the first real element of an array.
Identifies a numeric mpsArray whose data is stored as either unsigned char or byte.
Successful invocation of a method.
mpsClassID mpsGetClassID(const mpsArray *mlArr)
Determine the class of an array.
size_t mpsGetNumberOfElements(const mpsArray *mlArr)
Determine how many elements are in the array.
void(* setVerifyPeer)(mpsClientConfig *config, mpsLogical verifyPeer)
Setting this flag to false will not peform the authentication of server certificate.
mpsErrorInfoGeneric general
Error other than MATLAB execution error and non-200 HTTP response.
A non-200 HTTP response when MATLAB function in invoked from the client.
mpsArray * mpsCreateNumericArray(mpsSize ndim, const mpsSize *dims, mpsClassID classid, mpsComplexity complexFlag)
Create a two-dimensional numeric array.
void(* setPrivateKeyPasswd)(mpsClientConfig *config, const char *passwd)
Set password for private key file.
struct mpsClientRuntime mpsClientRuntime
MATLAB Production Server client API container.
struct mpsClientConfig mpsClientConfig
Structure containing information configuring the connection between the client and a server instance.
Identifies an mpsArray with imaginary components.
Details about an error not caused by non-200 HTTP errors or MATLAB execution errors.
mpsArray * mpsCreateSparseLogicalMatrix(mpsSize m, mpsSize n, mpsSize nzmax)
Create a two-dimensional sparse array.
char const * message
Message regarding the error.
mpsArray * mpsCreateLogicalScalar(mpsLogical value)
Create a scalar logical array.
bool mpsIsUint32(const mpsArray *mlArr)
Determine whether mpsArray represents data as unsigned 32-bit integers.
Identifies a numeric mpsArray whose data is stored as short.
mpsLogical(* getVerifyPeer)(const mpsClientConfig *config)
Get the peer verification flag value.
int mpsGetNumberOfFields(const mpsArray *mlArr)
Determine the number of fields in an array of struct.
Entry in the MATLAB runtime stack.
mpsArray * mpsCreateCharArray(mpsSize ndim, const mpsSize *dims)
Create a N-dimensional string array.
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.
bool mpsLogical
Type for logical array.
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.
bool mpsIsChar(const mpsArray *mlArr)
Determine whether mpsArray represents a string array.
mpsChar * mpsGetChars(const mpsArray *mlArr)
Access the data in a character array.
void(* destroyConfig)(mpsClientConfig *config)
Clean up the memory allocated to the client configuration instance.
bool mpsIsInt32(const mpsArray *mlArr)
Determine whether mpsArray represents data as signed 32-bit integers.
Identifies a string mpsArray.
void * mpsGetData(const mpsArray *mlArr)
Access the real numeric data in an array.
Identifies a numeric mpsArray whose data is stored as long long.
void mpsSetCell(mpsArray *mlArr, mpsIndex index, mpsArray *value)
Set the contents of a cell array at a specified index.
Details about a MATLAB execution error.
void(* setResponseTimeOutSec)(mpsClientConfig *config, unsigned long value)
Set the timeout value, in seconds, for the client to receive response from the server.
bool mpsIsSparse(const mpsArray *mlArr)
Determine whether array is sparse.
void(* getLastErrorInfo)(mpsClientContext const *context, mpsErrorInfo *errorInfo)
Access the error thrown while invoking a MATLAB function from the client A MATLAB function invocation...
struct mpsErrorInfoGeneric mpsErrorInfoGeneric
Details about an error not caused by non-200 HTTP errors or MATLAB execution errors.
Identifies a cell mpsArray.
mpsErrorInfoHTTP http
Error caused by a non-200 HTTP response.
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.
bool mpsIsLogicalScalarTrue(const mpsArray *mlArr)
Determine whether scalar array is true.
Identifies a numeric mpsArray whose data is stored as unsigned long long.
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.
bool mpsIsInt64(const mpsArray *mlArr)
Determine whether mpsArray represents data as signed 64-bit integers.
int mpsGetFieldNumber(const mpsArray *mlArr, const char *fieldname)
Determine the number of a field in an array of struct given the field name.
const char * genericErrorMsg
Error message corresponding to the generic error.
mpsArray * mpsCreateSparse(mpsSize m, mpsSize n, mpsSize nzmax, mpsComplexity complexFlag)
Create a two-dimensional sparse array.
Identifies a logical mpsArray.
bool mpsIsDouble(const mpsArray *mlArr)
Determine whether mpsArray represents data as double-precision, floating-point numbers.
void mpsSetNzmax(mpsArray *mlArr, mpsSize nzmax)
Set the maximum number of non-zero elements in a sparse array.
union mpsErrorInfo::@0 details
All possible errors that can be thrown when a MATLAB function is invoked from the client.
Identifies a numeric mpsArray whose data is stored as int.
mpsArray * mpsCreateLogicalArray(mpsSize ndim, const mpsSize *dims)
Create a N-dimensional logical array.
struct matlabStackFrame matlabStackFrame
Entry in the MATLAB runtime stack.
mpsIndex * mpsGetJc(const mpsArray *mlArr)
Determine the starting address of the jc array in a sparse array.
Error thrown when a MATLAB function is invoked by the MATLAB Production Server client context.
double * mpsGetPr(const mpsArray *mlArr)
Access the real data in an array of doubles.
struct mpsClientContext mpsClientContext
Establishes a connection between a client and a server.
mpsSize mpsGetNumberOfDimensions(const mpsArray *mlArr)
Determine the number of dimensions in an array.
bool mpsIsInt16(const mpsArray *mlArr)
Determine whether mpsArray represents data as signed 16-bit integers.
struct mpsErrorInfo mpsErrorInfo
Error thrown when a MATLAB function is invoked by the MATLAB Production Server client context.
void * mpsGetImagData(const mpsArray *mlArr)
Access the imaginary data in an array.
Any error other than MATLAB execution error or a non-200 HTTP response.
const char * mpsGetFieldNameByNumber(const mpsArray *mlArr, int fieldnumber)
Determine the name of a field in an array of struct given the field number.