You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
656 B
C
30 lines
656 B
C
#include "../object.h"
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
extern struct json_enum ap_object_type_enum[];
|
|
|
|
#define OBJ_TYPE struct ap_attachment
|
|
struct json_object_field ap_attachment_layout[] = {
|
|
JSON_FIELD_STRING( mediaType, false ),
|
|
JSON_FIELD_STRING( name, false ),
|
|
JSON_FIELD_STRING( value, false ),
|
|
JSON_FIELD_STRING( url, false ),
|
|
JSON_FIELD_ENUM( type, ap_object_type_enum, true ),
|
|
JSON_FIELD_END
|
|
};
|
|
#undef OBJ_TYPE
|
|
void ap_attachment_free( struct ap_attachment* a )
|
|
{
|
|
if( !a ) { return; }
|
|
|
|
free(a->mediaType);
|
|
free(a->name);
|
|
free(a->url);
|
|
free(a->value);
|
|
free(a);
|
|
}
|
|
JSON_FIELD_TYPE_OBJECT_LAYOUT_WITH_DEFAULTS( ap_attachment );
|
|
|