Grass Valley K2 TX/MAM Database Protocol Manual v.2.2 User Manual
Page 19

TX/MAM Database Protocol Manual - document version: 2.2
– Page 19
7.5 Adding a field request for a text blob database field
The result is temporarily placed in a library variable. Copy this to a local variable to save the value
even after a cob_fieldlist_clear call.
int cob_fieldlist_get_small_blob( char *field, char **result_target,
int **result_size, int content_type );
Parameters
Name
Description
char *field
The field to get, e.g. "transfer_metadata".
char **result_target
The pointer to the pointer that contains the result, e.g. _artist with the
declaration char *_artist;
int **result_size The pointer to the pointer that contains the size of the
resulting text, e.g. _charcount with the declaration int *_charcount;.
int content_type
The origin of the data, e.g. CUSTOM_DATA.
Result
The result of the function is an integer and has following possible values:
Value
Description
0
Success, the field has been added.
-1
Failure, the field could not be added.
Example
This function retrieves transfer_metadata for the asset_element record with id == 1035:
char *_transfer_metadata;
int *_charcount;
char transfer_metadata[ SMALL_BLOB ];
int charcount;
[..]
cob_fieldlist_clear();
cob_fieldlist_get_small_blob( "transfer_metadata", &_transfer_metadata,
&_charcount, SMALL_BLOB);
result = cob_get_field_values( "asset_element", 1035 );
if ( result == -1 ) {
printf( "Can't find asset_element: %Ld -> exit \n", 1035 );
return -1;
}
charcount = *_charcount;
memcpy( transfer_metadata, _transfer_metadata, charcount );