|
MoSync 3.2.1
|
Defines | |
| #define | MA_DB_TYPE_NULL 1 |
| #define | MA_DB_TYPE_INT 2 |
| #define | MA_DB_TYPE_INT64 3 |
| #define | MA_DB_TYPE_DOUBLE 4 |
| #define | MA_DB_TYPE_BLOB 5 |
| #define | MA_DB_TYPE_DATA 6 |
| #define | MA_DB_TYPE_TEXT 7 |
| #define | MA_DB_OK 0 |
| #define | MA_DB_ERROR -2 |
| #define | MA_DB_NO_ROW -3 |
| #define | MA_DB_NULL -4 |
Functions | |
| MAHandle | maDBOpen (const char *path) |
| int | maDBClose (MAHandle databaseHandle) |
| MAHandle | maDBExecSQL (MAHandle databaseHandle, const char *sql) |
| MAHandle | maDBExecSQLParams (MAHandle databaseHandle, const char *sql, const MADBValue *params, int paramCount) |
| int | maDBCursorDestroy (MAHandle cursorHandle) |
| int | maDBCursorNext (MAHandle cursorHandle) |
| int | maDBCursorGetColumnData (MAHandle cursorHandle, int columnIndex, MAHandle placeholder) |
| int | maDBCursorGetColumnText (MAHandle cursorHandle, int columnIndex, void *buffer, int bufferSize) |
| int | maDBCursorGetColumnInt (MAHandle cursorHandle, int columnIndex, int *value) |
| int | maDBCursorGetColumnDouble (MAHandle cursorHandle, int columnIndex, double *value) |
| struct | __attribute ((packed, aligned(4))) MAAudioBufferInfo |
| Information about an audio buffer, including format, sample rate, channels, and size. | |
| #define MA_DB_TYPE_NULL 1 |
| #define MA_DB_TYPE_INT 2 |
| #define MA_DB_TYPE_INT64 3 |
| #define MA_DB_TYPE_DOUBLE 4 |
| #define MA_DB_TYPE_BLOB 5 |
| #define MA_DB_TYPE_DATA 6 |
| #define MA_DB_TYPE_TEXT 7 |
| #define MA_DB_OK 0 |
Status codes returned by the maDB functions. Success return value.
| #define MA_DB_ERROR -2 |
Error return value (-1 reserved for IOCtl not implemented).
| #define MA_DB_NO_ROW -3 |
The cursor is beyond the last row when calling maDBCursorNext.
| #define MA_DB_NULL -4 |
A database field value was NULL when calling the maDBCursorGetColumn* functions.
Open a database file. The database is created if it does not exist.
| path | Absolute path to the database file. |
References maIOCtl().
Close a database.
| databaseHandle | Handle to the database. |
References maIOCtl().
| MAHandle maDBExecSQL | ( | MAHandle | databaseHandle, |
| const char * | sql | ||
| ) |
Executes an SQL statement. If the statement returns a query result, a cursor handle is returned. If a query result is empty, MA_DB_OK is returned.
| databaseHandle | Handle to the database. |
| sql | The SQL statement. |
References maIOCtl().
| MAHandle maDBExecSQLParams | ( | MAHandle | databaseHandle, |
| const char * | sql, | ||
| const MADBValue * | params, | ||
| int | paramCount | ||
| ) |
Executes an SQL statement. If the statement returns a query result, a cursor handle is returned. If a query result is empty, MA_DB_OK is returned.
| databaseHandle | Handle to the database. |
| sql | The SQL statement. |
| params | Array of values to bind to parameters. Parameters are specified by question marks (?) in the SQL statement. |
If this function returns a cursor, any text or blob values being pointed to by elements of the array must remain valid until the cursor has been destroyed by maDBCursorDestroy().
The array itself does not need to remain valid after this function returns.
| paramCount | Number of elements in the array pointed to by params. |
This function is available on iOS, Android, and in MoRE.
References maIOCtl().
| int maDBCursorDestroy | ( | MAHandle | cursorHandle | ) |
Destroys a cursor. You must call this function when you are done with the cursor to release its resources.
| cursorHandle | Handle to the cursor. |
References maIOCtl().
| int maDBCursorNext | ( | MAHandle | cursorHandle | ) |
Move the cursor to the next row in the result set. Note that you must call this function before retrieving column data. The initial position of the cursor is before the first row in the result set. If the result set is empty, this function will return MA_DB_NO_ROW.
| cursorHandle | Handle to the cursor. |
References maIOCtl().
| int maDBCursorGetColumnData | ( | MAHandle | cursorHandle, |
| int | columnIndex, | ||
| MAHandle | placeholder | ||
| ) |
Get the column value at the current row pointed to by the cursor as a data object. Use this function for blob data or text data.
| cursorHandle | Handle to the cursor. |
| columnIndex | Index of the column to retrieve value from. First column has index zero. |
| placeholder | Handle created with maCreatePlaceholder. A data object will be created with the column data, and the handle will refer to that data. |
References maIOCtl().
| int maDBCursorGetColumnText | ( | MAHandle | cursorHandle, |
| int | columnIndex, | ||
| void * | buffer, | ||
| int | bufferSize | ||
| ) |
Get the column value at the current row pointed to by the cursor as a text data buffer. Use this function for text data.
| cursorHandle | Handle to the cursor. |
| columnIndex | Index of the column to retrieve value from. First column has index zero. |
| buffer | Pointer to buffer to receive the data. The result is NOT zero terminated. |
| bufferSize | Max size of the buffer. |
References maIOCtl().
| int maDBCursorGetColumnInt | ( | MAHandle | cursorHandle, |
| int | columnIndex, | ||
| int * | value | ||
| ) |
Get the column value at the current row pointed to by the cursor as an int value.
| cursorHandle | Handle to the cursor. |
| columnIndex | Index of the column to retrieve value from. First column has index zero. |
| value | Pointer to int to receive the value. |
References maIOCtl().
| int maDBCursorGetColumnDouble | ( | MAHandle | cursorHandle, |
| int | columnIndex, | ||
| double * | value | ||
| ) |
Get the column value at the current row pointed to by the cursor as a double value.
| cursorHandle | Handle to the cursor. |
| columnIndex | Index of the column to retrieve value from. First column has index zero. |
| value | Pointer to double to receive the value. |
References maIOCtl().
| struct __attribute | ( | (packed, aligned(4)) | ) | [read] |
Information about an audio buffer, including format, sample rate, channels, and size.
An push notification event.
Input value for maDBExecSQLParams().
The camera format, in pixels.
A structure containing information about the native framebuffer, including color format and resolution.
A geographical location specified by latitude and longitude, horizontal and vertical accuracy, and altitude.
Information about a Bluetooth service.
Information about an MABtService object.
A Universally Unique Identifier.
Information about a Bluetooth device.
A MoSync Panic or other unrecoverable error.
An event; a message indicating that something has happened, e.g. that a key has been pressed.
An puchase event struct. A MoSync event will contain an struct object of this type only if event type is EVENT_TYPE_PURCHASE.
An event send by the Native Image Picker(Capture API).
An event send by a banner widget.
An event containing the result of an NFC asynchronous operation.
A structure containing the sensor type and the data sent to the event.
Data for a connection event, including an indicator or success or failure.
A connection address.
An address for the Bluetooth Serial Port protocol.
A Bluetooth device address.
An address for the TCP/IPv4 protocol.
Parameters for the maCopyData() function.
A structure representing a rectangle.
A WLAN access point.
The x and y coordinate of the top-left corner are defined by 'left' and 'top'. The dimensions of the rectangle are defined by 'width' and 'height'.
In MoSync Debug builds, when such an error occurs, the runtime writes an instance of this structure to a Store named "panic.report".
The length of that instance may be greater than sizeof(MAPanicReport), because of the variable-length string that may appear at its end. The member string can, then, be longer than the one byte that is declared.
To properly read an instance of this struct from a store, you should allocate a chunk of memory whose size is equal to the size of the store, then read the entire store into that chunk of memory. Then you should make a pointer of type MAPanicReport and point it to the chunk. Then you can read normally, using that pointer.
Common Bluetooth UUID values can be found in MAUtil/mauuid.h.
Only if state equals MA_LOC_QUALIFIED do the other members contain valid data.
Coordinates are in the WGS84 datum.
The horizontal accuracy is the RMS (root mean square) of east accuracy (latitudinal error in meters, 1-sigma standard deviation), north accuracy (longitudinal error in meters, 1-sigma).
The vertical accuracy is in meters in vertical direction (orthogonal to ellipsoid surface, 1-sigma standard deviation).
Accuracy values may be NaN, if accuracy is unknown.
The 'sizeInBytes' field is the amount of bytes that should be used to allocate the offscreen framebuffer (a backbuffer).
out
in(ptr), out(content)
in
out. dBm?