Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_content_type.h
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework afw_content_type interface support header
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
9 #ifndef __AFW_CONTENT_TYPE_H__
10 #define __AFW_CONTENT_TYPE_H__
11 
12 #include "afw_interface.h"
13 
28 
30 AFW_DEFINE_STATIC_INLINE(afw_utf8_t *)
32  const afw_content_type_t * instance,
33  const afw_value_t * value,
34  const afw_object_options_t *options,
35  afw_xctx_t *xctx)
36 {
37  AFW_THROW_ERROR_Z(general, "Not implemented", xctx);
38 }
39 
41 AFW_DEFINE_STATIC_INLINE(const afw_value_t *)
43  const afw_content_type_t * instance,
44  const afw_utf8_t * string,
45  const afw_utf8_t *adaptor_id,
46  const afw_utf8_t *object_type_id,
47  const afw_utf8_t *object_id,
48  afw_xctx_t *xctx)
49 {
50  AFW_THROW_ERROR_Z(general, "Not implemented", xctx);
51 }
52 
53 
59 AFW_DECLARE(void)
61  const afw_content_type_t *content_type,
62  afw_xctx_t *xctx);
63 
64 
65 
77  const afw_content_type_t * instance,
78  const afw_value_t * value,
79  const afw_object_options_t *options,
80  const afw_pool_t *p,
81  afw_xctx_t *xctx);
82 
83 
84 
94 #define afw_content_type_object_to_raw(instance, object, options, p, xctx) \
95  afw_content_type_value_to_raw(instance, \
96  afw_value_create_object(object, p, xctx), options, p, xctx)
97 
98 
104 #define afw_content_type_is_application_afw(instance) \
105 ((instance) && (instance)->inf == &afw_content_type_application_afw_inf)
106 
107 
108 
112 
113 
114 
123 AFW_DECLARE(const afw_stream_t *)
125  const afw_stream_t *response_stream,
126  const afw_utf8_t *streamId,
127  const afw_utf8_t *info,
128  const afw_pool_t *p,
129  afw_xctx_t *xctx);
130 
131 
132 AFW_END_DECLARES
133 
136 #endif /* __AFW_CONTENT_TYPE_H__ */
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
AFW_DECLARE_CONST_DATA(afw_utf8_t) afw_s_200
afw_utf8_t for string 200
const afw_memory_t * afw_content_type_value_to_raw(const afw_content_type_t *instance, const afw_value_t *value, const afw_object_options_t *options, const afw_pool_t *p, afw_xctx_t *xctx)
Convert value to the raw in specified pool.
afw_utf8_t * afw_content_type_x_to_utf8_with_options(const afw_content_type_t *instance, const afw_value_t *value, const afw_object_options_t *options, afw_xctx_t *xctx)
void afw_content_type_register(const afw_content_type_t *content_type, afw_xctx_t *xctx)
Register content type with its id and all of its media types.
const afw_value_t * afw_content_type_x_to_object_value_with_ids(const afw_content_type_t *instance, const afw_utf8_t *string, const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_xctx_t *xctx)
afw_content_type_application_afw_inf
application/x-afw content type inf.
const afw_stream_t * afw_content_type_application_afw_stream_create(const afw_stream_t *response_stream, const afw_utf8_t *streamId, const afw_utf8_t *info, const afw_pool_t *p, afw_xctx_t *xctx)
Create a stream for content type application/afw.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
Definition: afw_error.h:283
Interface afw_content_type_inf_s struct.
Interface afw_content_type public struct.
Struct for memory pointer and size.
Definition: afw_common.h:505
Struct for object processing options.
Interface afw_pool public struct.
Interface afw_stream public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
Interface afw_value public struct.
Interface afw_xctx public struct.