summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-06-03 16:16:53 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-06-03 16:46:47 +0100
commitba033a4cfc6d6e072ac39e881459a48fa27913d1 (patch)
treeff8cb9402bb07eb919646e2a94656390e3362991
parenta867caf2604b943630d534f7345a571d8a8d9fdb (diff)
eolian: add documentation handling API
This adds new APIs that deal with the new documentation syntax provided by Eolian. The old doc comment APIs are considered deprecated from now on and will be removed. @feature
-rw-r--r--src/lib/eolian/Eolian.h121
-rw-r--r--src/lib/eolian/database_class_api.c7
-rw-r--r--src/lib/eolian/database_event_api.c7
-rw-r--r--src/lib/eolian/database_function_api.c23
-rw-r--r--src/lib/eolian/database_function_parameter_api.c7
-rw-r--r--src/lib/eolian/database_type_api.c25
-rw-r--r--src/lib/eolian/database_var_api.c7
-rw-r--r--src/lib/eolian/eolian_database.c14
-rw-r--r--src/tests/eolian/data/docs.eo2
-rw-r--r--src/tests/eolian/eolian_parsing.c144
10 files changed, 356 insertions, 1 deletions
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 8f74460545..c749beb73c 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -701,6 +701,16 @@ EAPI Eina_Iterator *eolian_all_classes_get(void);
701EAPI Eina_Stringshare *eolian_class_description_get(const Eolian_Class *klass); 701EAPI Eina_Stringshare *eolian_class_description_get(const Eolian_Class *klass);
702 702
703/* 703/*
704 * @brief Returns the documentation of a class.
705 *
706 * @param[in] klass the class
707 * @return the documentation of a class
708 *
709 * @ingroup Eolian
710 */
711EAPI const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass);
712
713/*
704 * @brief Returns the legacy prefix of a class 714 * @brief Returns the legacy prefix of a class
705 * 715 *
706 * @param[in] klass the class 716 * @param[in] klass the class
@@ -831,6 +841,17 @@ EAPI Eina_Stringshare *eolian_function_legacy_get(const Eolian_Function *functio
831EAPI Eina_Stringshare *eolian_function_description_get(const Eolian_Function *function_id, Eolian_Function_Type f_type); 841EAPI Eina_Stringshare *eolian_function_description_get(const Eolian_Function *function_id, Eolian_Function_Type f_type);
832 842
833/* 843/*
844 * @brief Returns a documentation for a function.
845 *
846 * @param[in] function_id Id of the function
847 * @param[in] f_type The function type, for property get/set distinction.
848 * @return the documentation or NULL.
849 *
850 * @ingroup Eolian
851 */
852EAPI const Eolian_Documentation *eolian_function_documentation_get(const Eolian_Function *function_id, Eolian_Function_Type f_type);
853
854/*
834 * @brief Indicates if a function is virtual pure. 855 * @brief Indicates if a function is virtual pure.
835 * 856 *
836 * @param[in] function_id Id of the function 857 * @param[in] function_id Id of the function
@@ -1009,6 +1030,16 @@ EAPI Eina_Stringshare *eolian_parameter_name_get(const Eolian_Function_Parameter
1009EAPI Eina_Stringshare *eolian_parameter_description_get(const Eolian_Function_Parameter *param); 1030EAPI Eina_Stringshare *eolian_parameter_description_get(const Eolian_Function_Parameter *param);
1010 1031
1011/* 1032/*
1033 * @brief Get documentation of a parameter
1034 *
1035 * @param[in] param_desc parameter handle
1036 * @return the documentation of the parameter or NULL
1037 *
1038 * @ingroup Eolian
1039 */
1040EAPI const Eolian_Documentation *eolian_parameter_documentation_get(const Eolian_Function_Parameter *param);
1041
1042/*
1012 * @brief Indicates if a parameter cannot be NULL. 1043 * @brief Indicates if a parameter cannot be NULL.
1013 * 1044 *
1014 * @param[in] param_desc parameter handle 1045 * @param[in] param_desc parameter handle
@@ -1083,6 +1114,20 @@ eolian_function_return_default_value_get(const Eolian_Function *foo_id, Eolian_F
1083EAPI Eina_Stringshare *eolian_function_return_comment_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype); 1114EAPI Eina_Stringshare *eolian_function_return_comment_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
1084 1115
1085/* 1116/*
1117 * @brief Get the return docs of a function.
1118 *
1119 * @param[in] function_id id of the function
1120 * @param[in] ftype type of the function
1121 * @return the return docs of the function
1122 *
1123 * The type of the function is needed because a given function can represent a
1124 * property, that can be set and get functions.
1125 *
1126 * @ingroup Eolian
1127 */
1128EAPI const Eolian_Documentation *eolian_function_return_documentation_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
1129
1130/*
1086 * @brief Indicates if a function return is warn-unused. 1131 * @brief Indicates if a function return is warn-unused.
1087 * 1132 *
1088 * @param[in] function_id id of the function 1133 * @param[in] function_id id of the function
@@ -1316,6 +1361,16 @@ EAPI const Eolian_Type *eolian_event_type_get(const Eolian_Event *event);
1316EAPI Eina_Stringshare *eolian_event_description_get(const Eolian_Event *event); 1361EAPI Eina_Stringshare *eolian_event_description_get(const Eolian_Event *event);
1317 1362
1318/* 1363/*
1364 * @brief Get the documentation of an event.
1365 *
1366 * @param[in] event the event handle
1367 * @return the documentation or NULL
1368 *
1369 * @ingroup Eolian
1370 */
1371EAPI const Eolian_Documentation *eolian_event_documentation_get(const Eolian_Event *event);
1372
1373/*
1319 * @brief Returns the scope of an event 1374 * @brief Returns the scope of an event
1320 * 1375 *
1321 * @param[in] event the event handle 1376 * @param[in] event the event handle
@@ -1521,6 +1576,16 @@ EAPI Eina_Stringshare *eolian_type_struct_field_name_get(const Eolian_Struct_Typ
1521EAPI Eina_Stringshare *eolian_type_struct_field_description_get(const Eolian_Struct_Type_Field *fl); 1576EAPI Eina_Stringshare *eolian_type_struct_field_description_get(const Eolian_Struct_Type_Field *fl);
1522 1577
1523/* 1578/*
1579 * @brief Get the documentation of a field of a struct type.
1580 *
1581 * @param[in] fl the field.
1582 * @return the documentation.
1583 *
1584 * @ingroup Eolian
1585 */
1586EAPI const Eolian_Documentation *eolian_type_struct_field_documentation_get(const Eolian_Struct_Type_Field *fl);
1587
1588/*
1524 * @brief Get the type of a field of a struct type. 1589 * @brief Get the type of a field of a struct type.
1525 * 1590 *
1526 * @param[in] fl the field. 1591 * @param[in] fl the field.
@@ -1588,6 +1653,16 @@ EAPI Eina_Stringshare *eolian_type_enum_field_c_name_get(const Eolian_Enum_Type_
1588EAPI Eina_Stringshare *eolian_type_enum_field_description_get(const Eolian_Enum_Type_Field *fl); 1653EAPI Eina_Stringshare *eolian_type_enum_field_description_get(const Eolian_Enum_Type_Field *fl);
1589 1654
1590/* 1655/*
1656 * @brief Get the documentation of a field of an enum type.
1657 *
1658 * @param[in] fl the field.
1659 * @return the documentation.
1660 *
1661 * @ingroup Eolian
1662 */
1663EAPI const Eolian_Documentation *eolian_type_enum_field_documentation_get(const Eolian_Enum_Type_Field *fl);
1664
1665/*
1591 * @brief Get the value of a field of an enum type. 1666 * @brief Get the value of a field of an enum type.
1592 * 1667 *
1593 * When the @c force parameter is EINA_FALSE, this will only return values for 1668 * When the @c force parameter is EINA_FALSE, this will only return values for
@@ -1625,6 +1700,17 @@ EAPI Eina_Stringshare *eolian_type_enum_legacy_prefix_get(const Eolian_Type *tp)
1625EAPI Eina_Stringshare *eolian_type_description_get(const Eolian_Type *tp); 1700EAPI Eina_Stringshare *eolian_type_description_get(const Eolian_Type *tp);
1626 1701
1627/* 1702/*
1703 * @brief Get the documentation of a struct/alias type.
1704 *
1705 * @param[in] tp the type.
1706 * @return the documentation when @c tp is EOLIAN_TYPE_STRUCT or
1707 * EOLIAN_TYPE_STRUCT_OPAQUE, NULL otherwise.
1708 *
1709 * @ingroup Eolian
1710 */
1711EAPI const Eolian_Documentation *eolian_type_documentation_get(const Eolian_Type *tp);
1712
1713/*
1628 * @brief Get the filename of a struct/alias type. 1714 * @brief Get the filename of a struct/alias type.
1629 * 1715 *
1630 * @param[in] tp the type. 1716 * @param[in] tp the type.
@@ -1993,6 +2079,16 @@ EAPI Eolian_Variable_Type eolian_variable_type_get(const Eolian_Variable *var);
1993EAPI Eina_Stringshare *eolian_variable_description_get(const Eolian_Variable *var); 2079EAPI Eina_Stringshare *eolian_variable_description_get(const Eolian_Variable *var);
1994 2080
1995/* 2081/*
2082 * @brief Get the documentation of a variable.
2083 *
2084 * @param[in] var the variable.
2085 * @return the documentation or NULL.
2086 *
2087 * @ingroup Eolian
2088 */
2089EAPI const Eolian_Documentation *eolian_variable_documentation_get(const Eolian_Variable *var);
2090
2091/*
1996 * @brief Get the filename of a variable. 2092 * @brief Get the filename of a variable.
1997 * 2093 *
1998 * @param[in] var the variable. 2094 * @param[in] var the variable.
@@ -2129,6 +2225,31 @@ EAPI const Eolian_Type *eolian_declaration_data_type_get(const Eolian_Declaratio
2129 */ 2225 */
2130EAPI const Eolian_Variable *eolian_declaration_variable_get(const Eolian_Declaration *decl); 2226EAPI const Eolian_Variable *eolian_declaration_variable_get(const Eolian_Declaration *decl);
2131 2227
2228/*
2229 * @brief Get the summary of the documentation.
2230 *
2231 * This should never return NULL unless the input is invalid.
2232 *
2233 * @param[in] doc the documentation
2234 * @return the summary or NULL
2235 *
2236 * @ingroup Eolian
2237 */
2238EAPI Eina_Stringshare *eolian_documentation_summary_get(const Eolian_Documentation *doc);
2239
2240/*
2241 * @brief Get the description of the documentation.
2242 *
2243 * This can return NULL if the description wasn't specified or
2244 * if the input is wrong.
2245 *
2246 * @param[in] doc the documentation
2247 * @return the description or NULL
2248 *
2249 * @ingroup Eolian
2250 */
2251EAPI Eina_Stringshare *eolian_documentation_description_get(const Eolian_Documentation *doc);
2252
2132#endif 2253#endif
2133 2254
2134/** 2255/**
diff --git a/src/lib/eolian/database_class_api.c b/src/lib/eolian/database_class_api.c
index e4c9723095..ae7497781c 100644
--- a/src/lib/eolian/database_class_api.c
+++ b/src/lib/eolian/database_class_api.c
@@ -70,6 +70,13 @@ eolian_class_description_get(const Eolian_Class *cl)
70 return cl->description; 70 return cl->description;
71} 71}
72 72
73EAPI const Eolian_Documentation *
74eolian_class_documentation_get(const Eolian_Class *cl)
75{
76 EINA_SAFETY_ON_NULL_RETURN_VAL(cl, NULL);
77 return cl->doc;
78}
79
73EAPI Eina_Stringshare* 80EAPI Eina_Stringshare*
74eolian_class_legacy_prefix_get(const Eolian_Class *cl) 81eolian_class_legacy_prefix_get(const Eolian_Class *cl)
75{ 82{
diff --git a/src/lib/eolian/database_event_api.c b/src/lib/eolian/database_event_api.c
index 26a516753a..0a180e4878 100644
--- a/src/lib/eolian/database_event_api.c
+++ b/src/lib/eolian/database_event_api.c
@@ -26,6 +26,13 @@ eolian_event_description_get(const Eolian_Event *event)
26 return event->comment; 26 return event->comment;
27} 27}
28 28
29EAPI const Eolian_Documentation *
30eolian_event_documentation_get(const Eolian_Event *event)
31{
32 EINA_SAFETY_ON_NULL_RETURN_VAL(event, NULL);
33 return event->doc;
34}
35
29EAPI Eolian_Object_Scope 36EAPI Eolian_Object_Scope
30eolian_event_scope_get(const Eolian_Event *event) 37eolian_event_scope_get(const Eolian_Event *event)
31{ 38{
diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c
index 6f646c847f..4ff34a7813 100644
--- a/src/lib/eolian/database_function_api.c
+++ b/src/lib/eolian/database_function_api.c
@@ -98,6 +98,18 @@ eolian_function_description_get(const Eolian_Function *fid, Eolian_Function_Type
98 } 98 }
99} 99}
100 100
101EAPI const Eolian_Documentation *
102eolian_function_documentation_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
103{
104 EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
105 switch (ftype)
106 {
107 case EOLIAN_PROP_GET: return fid->get_doc; break;
108 case EOLIAN_PROP_SET: return fid->set_doc; break;
109 default: return fid->common_doc;
110 }
111}
112
101EAPI Eina_Bool 113EAPI Eina_Bool
102eolian_function_is_virtual_pure(const Eolian_Function *fid, Eolian_Function_Type ftype) 114eolian_function_is_virtual_pure(const Eolian_Function *fid, Eolian_Function_Type ftype)
103{ 115{
@@ -246,6 +258,17 @@ eolian_function_return_comment_get(const Eolian_Function *fid, Eolian_Function_T
246 } 258 }
247} 259}
248 260
261EAPI const Eolian_Documentation *
262eolian_function_return_documentation_get(const Eolian_Function *fid, Eolian_Function_Type ftype)
263{
264 switch (ftype)
265 {
266 case EOLIAN_PROP_SET: return fid->set_return_doc; break;
267 case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_return_doc; break;
268 default: return NULL;
269 }
270}
271
249EAPI Eina_Bool 272EAPI Eina_Bool
250eolian_function_return_is_warn_unused(const Eolian_Function *fid, 273eolian_function_return_is_warn_unused(const Eolian_Function *fid,
251 Eolian_Function_Type ftype) 274 Eolian_Function_Type ftype)
diff --git a/src/lib/eolian/database_function_parameter_api.c b/src/lib/eolian/database_function_parameter_api.c
index 9a566f826d..6c9a8d7426 100644
--- a/src/lib/eolian/database_function_parameter_api.c
+++ b/src/lib/eolian/database_function_parameter_api.c
@@ -40,6 +40,13 @@ eolian_parameter_description_get(const Eolian_Function_Parameter *param)
40 return param->description; 40 return param->description;
41} 41}
42 42
43EAPI const Eolian_Documentation *
44eolian_parameter_documentation_get(const Eolian_Function_Parameter *param)
45{
46 EINA_SAFETY_ON_NULL_RETURN_VAL(param, NULL);
47 return param->doc;
48}
49
43EAPI Eina_Bool 50EAPI Eina_Bool
44eolian_parameter_is_nonull(const Eolian_Function_Parameter *param) 51eolian_parameter_is_nonull(const Eolian_Function_Parameter *param)
45{ 52{
diff --git a/src/lib/eolian/database_type_api.c b/src/lib/eolian/database_type_api.c
index 6ae8935a72..e1a01bbdbd 100644
--- a/src/lib/eolian/database_type_api.c
+++ b/src/lib/eolian/database_type_api.c
@@ -121,6 +121,13 @@ eolian_type_struct_field_description_get(const Eolian_Struct_Type_Field *fl)
121 return fl->comment; 121 return fl->comment;
122} 122}
123 123
124EAPI const Eolian_Documentation *
125eolian_type_struct_field_documentation_get(const Eolian_Struct_Type_Field *fl)
126{
127 EINA_SAFETY_ON_NULL_RETURN_VAL(fl, NULL);
128 return fl->doc;
129}
130
124EAPI const Eolian_Type * 131EAPI const Eolian_Type *
125eolian_type_struct_field_type_get(const Eolian_Struct_Type_Field *fl) 132eolian_type_struct_field_type_get(const Eolian_Struct_Type_Field *fl)
126{ 133{
@@ -185,6 +192,13 @@ eolian_type_enum_field_description_get(const Eolian_Enum_Type_Field *fl)
185 return fl->comment; 192 return fl->comment;
186} 193}
187 194
195EAPI const Eolian_Documentation *
196eolian_type_enum_field_documentation_get(const Eolian_Enum_Type_Field *fl)
197{
198 EINA_SAFETY_ON_NULL_RETURN_VAL(fl, NULL);
199 return fl->doc;
200}
201
188EAPI const Eolian_Expression * 202EAPI const Eolian_Expression *
189eolian_type_enum_field_value_get(const Eolian_Enum_Type_Field *fl, Eina_Bool force) 203eolian_type_enum_field_value_get(const Eolian_Enum_Type_Field *fl, Eina_Bool force)
190{ 204{
@@ -212,6 +226,17 @@ eolian_type_description_get(const Eolian_Type *tp)
212 return tp->comment; 226 return tp->comment;
213} 227}
214 228
229EAPI const Eolian_Documentation *
230eolian_type_documentation_get(const Eolian_Type *tp)
231{
232 Eolian_Type_Type tpp;
233 EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
234 tpp = eolian_type_type_get(tp);
235 EINA_SAFETY_ON_FALSE_RETURN_VAL(tpp != EOLIAN_TYPE_POINTER
236 && tpp != EOLIAN_TYPE_VOID, NULL);
237 return tp->doc;
238}
239
215EAPI Eina_Stringshare * 240EAPI Eina_Stringshare *
216eolian_type_file_get(const Eolian_Type *tp) 241eolian_type_file_get(const Eolian_Type *tp)
217{ 242{
diff --git a/src/lib/eolian/database_var_api.c b/src/lib/eolian/database_var_api.c
index cb473a3c08..45400f5c6b 100644
--- a/src/lib/eolian/database_var_api.c
+++ b/src/lib/eolian/database_var_api.c
@@ -61,6 +61,13 @@ eolian_variable_description_get(const Eolian_Variable *var)
61 return var->comment; 61 return var->comment;
62} 62}
63 63
64EAPI const Eolian_Documentation *
65eolian_variable_documentation_get(const Eolian_Variable *var)
66{
67 EINA_SAFETY_ON_NULL_RETURN_VAL(var, NULL);
68 return var->doc;
69}
70
64EAPI Eina_Stringshare * 71EAPI Eina_Stringshare *
65eolian_variable_file_get(const Eolian_Variable *var) 72eolian_variable_file_get(const Eolian_Variable *var)
66{ 73{
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index b0c4ab44b5..cc23f87d6b 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -169,6 +169,20 @@ void database_doc_del(Eolian_Documentation *doc)
169 free(doc); 169 free(doc);
170} 170}
171 171
172EAPI Eina_Stringshare *
173eolian_documentation_summary_get(const Eolian_Documentation *doc)
174{
175 EINA_SAFETY_ON_NULL_RETURN_VAL(doc, NULL);
176 return doc->summary;
177}
178
179EAPI Eina_Stringshare *
180eolian_documentation_description_get(const Eolian_Documentation *doc)
181{
182 EINA_SAFETY_ON_NULL_RETURN_VAL(doc, NULL);
183 return doc->description;
184}
185
172#define EO_SUFFIX ".eo" 186#define EO_SUFFIX ".eo"
173#define EOT_SUFFIX ".eot" 187#define EOT_SUFFIX ".eot"
174 188
diff --git a/src/tests/eolian/data/docs.eo b/src/tests/eolian/data/docs.eo
index 36d1c8f62d..c219cedbe5 100644
--- a/src/tests/eolian/data/docs.eo
+++ b/src/tests/eolian/data/docs.eo
@@ -2,6 +2,8 @@ struct Foo {
2 [[This is struct Foo. 2 [[This is struct Foo.
3 3
4 This is a longer description for struct Foo. 4 This is a longer description for struct Foo.
5
6 This is another paragraph.
5 ]] 7 ]]
6 field1: int; [[Field documentation.]] 8 field1: int; [[Field documentation.]]
7 field2: float; 9 field2: float;
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index f3d86a543b..8b8503b086 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -1130,12 +1130,154 @@ END_TEST
1130 1130
1131START_TEST(eolian_docs) 1131START_TEST(eolian_docs)
1132{ 1132{
1133 const Eolian_Type *type;
1134 const Eolian_Class *class;
1135 const Eolian_Event *event;
1136 const Eolian_Variable *var;
1137 const Eolian_Function *fid;
1138 const Eolian_Documentation *doc;
1139 const Eolian_Function_Parameter *par;
1140 const Eolian_Struct_Type_Field *sfl;
1141 const Eolian_Enum_Type_Field *efl;
1142 Eina_Iterator *itr;
1143
1133 eolian_init(); 1144 eolian_init();
1134 1145
1135 fail_if(!eolian_directory_scan(PACKAGE_DATA_DIR"/data")); 1146 fail_if(!eolian_directory_scan(PACKAGE_DATA_DIR"/data"));
1136 1147
1137 fail_if(!eolian_file_parse(PACKAGE_DATA_DIR"/data/docs.eo")); 1148 fail_if(!eolian_file_parse(PACKAGE_DATA_DIR"/data/docs.eo"));
1138 fail_if(!eolian_class_get_by_name("Docs")); 1149
1150 fail_if(!(type = eolian_type_struct_get_by_name("Foo")));
1151 fail_if(!(doc = eolian_type_documentation_get(type)));
1152 fail_if(strcmp(eolian_documentation_summary_get(doc),
1153 "This is struct Foo."));
1154 fail_if(strcmp(eolian_documentation_description_get(doc),
1155 "This is a longer description for struct Foo.\n\n"
1156 "This is another paragraph."));
1157
1158 fail_if(!(sfl = eolian_type_struct_field_get(type, "field1")));
1159 fail_if(!(doc = eolian_type_struct_field_documentation_get(sfl)));
1160 fail_if(strcmp(eolian_documentation_summary_get(doc),
1161 "Field documentation."));
1162 fail_if(eolian_documentation_description_get(doc));
1163
1164 fail_if(!(sfl = eolian_type_struct_field_get(type, "field2")));
1165 fail_if(eolian_type_struct_field_documentation_get(sfl));
1166
1167 fail_if(!(sfl = eolian_type_struct_field_get(type, "field3")));
1168 fail_if(!(doc = eolian_type_struct_field_documentation_get(sfl)));
1169 fail_if(strcmp(eolian_documentation_summary_get(doc),
1170 "Another field documentation."));
1171 fail_if(eolian_documentation_description_get(doc));
1172
1173 fail_if(!(type = eolian_type_enum_get_by_name("Bar")));
1174 fail_if(!(doc = eolian_type_documentation_get(type)));
1175 fail_if(strcmp(eolian_documentation_summary_get(doc),
1176 "Docs for enum Bar."));
1177 fail_if(eolian_documentation_description_get(doc));
1178
1179 fail_if(!(efl = eolian_type_enum_field_get(type, "blah")));
1180 fail_if(eolian_type_enum_field_documentation_get(efl));
1181
1182 fail_if(!(efl = eolian_type_enum_field_get(type, "foo")));
1183 fail_if(!(doc = eolian_type_enum_field_documentation_get(efl)));
1184 fail_if(strcmp(eolian_documentation_summary_get(doc),
1185 "Docs for foo."));
1186 fail_if(eolian_documentation_description_get(doc));
1187
1188 fail_if(!(efl = eolian_type_enum_field_get(type, "bar")));
1189 fail_if(!(doc = eolian_type_enum_field_documentation_get(efl)));
1190 fail_if(strcmp(eolian_documentation_summary_get(doc),
1191 "Docs for bar."));
1192 fail_if(eolian_documentation_description_get(doc));
1193
1194 fail_if(!(type = eolian_type_alias_get_by_name("Alias")));
1195 fail_if(!(doc = eolian_type_documentation_get(type)));
1196 fail_if(strcmp(eolian_documentation_summary_get(doc),
1197 "Docs for typedef."));
1198 fail_if(strcmp(eolian_documentation_description_get(doc),
1199 "More docs for typedef. See @Bar."));
1200
1201 fail_if(!(var = eolian_variable_global_get_by_name("pants")));
1202 fail_if(!(doc = eolian_variable_documentation_get(var)));
1203 fail_if(strcmp(eolian_documentation_summary_get(doc),
1204 "Docs for var."));
1205 fail_if(eolian_documentation_description_get(doc));
1206
1207 fail_if(!(type = eolian_type_struct_get_by_name("Opaque")));
1208 fail_if(!(doc = eolian_type_documentation_get(type)));
1209 fail_if(strcmp(eolian_documentation_summary_get(doc),
1210 "Opaque struct docs. See @Foo for another struct."));
1211 fail_if(eolian_documentation_description_get(doc));
1212
1213 fail_if(!(class = eolian_class_get_by_name("Docs")));
1214 fail_if(!(doc = eolian_class_documentation_get(class)));
1215 fail_if(strcmp(eolian_documentation_summary_get(doc),
1216 "Docs for class."));
1217 fail_if(strcmp(eolian_documentation_description_get(doc),
1218 "More docs for class. @Foo @Bar @Alias @pants"));
1219
1220 fail_if(!(fid = eolian_class_function_get_by_name(class, "meth", EOLIAN_METHOD)));
1221 fail_if(!(doc = eolian_function_documentation_get(fid, EOLIAN_METHOD)));
1222 fail_if(strcmp(eolian_documentation_summary_get(doc),
1223 "Method documentation."));
1224 fail_if(eolian_documentation_description_get(doc));
1225
1226 fail_if(!(itr = eolian_function_parameters_get(fid)));
1227
1228 fail_if(!eina_iterator_next(itr, (void**)&par));
1229 fail_if(!(doc = eolian_parameter_documentation_get(par)));
1230 fail_if(strcmp(eolian_documentation_summary_get(doc),
1231 "Param documentation."));
1232 fail_if(eolian_documentation_description_get(doc));
1233
1234 fail_if(!eina_iterator_next(itr, (void**)&par));
1235 fail_if(eolian_parameter_documentation_get(par));
1236
1237 fail_if(!eina_iterator_next(itr, (void**)&par));
1238 fail_if(!(doc = eolian_parameter_documentation_get(par)));
1239 fail_if(strcmp(eolian_documentation_summary_get(doc),
1240 "Another param documentation."));
1241 fail_if(eolian_documentation_description_get(doc));
1242
1243 fail_if(eina_iterator_next(itr, (void**)&par));
1244 eina_iterator_free(itr);
1245
1246 fail_if(!(doc = eolian_function_return_documentation_get(fid, EOLIAN_METHOD)));
1247 fail_if(strcmp(eolian_documentation_summary_get(doc),
1248 "Return documentation."));
1249 fail_if(eolian_documentation_description_get(doc));
1250
1251 fail_if(!(fid = eolian_class_function_get_by_name(class, "prop", EOLIAN_PROPERTY)));
1252 fail_if(!(doc = eolian_function_documentation_get(fid, EOLIAN_PROPERTY)));
1253 fail_if(strcmp(eolian_documentation_summary_get(doc),
1254 "Property common documentation."));
1255 fail_if(eolian_documentation_description_get(doc));
1256 fail_if(!(doc = eolian_function_documentation_get(fid, EOLIAN_PROP_GET)));
1257 fail_if(strcmp(eolian_documentation_summary_get(doc),
1258 "Get documentation."));
1259 fail_if(eolian_documentation_description_get(doc));
1260 fail_if(!(doc = eolian_function_documentation_get(fid, EOLIAN_PROP_SET)));
1261 fail_if(strcmp(eolian_documentation_summary_get(doc),
1262 "Set documentation."));
1263 fail_if(eolian_documentation_description_get(doc));
1264
1265 fail_if(!(itr = eolian_property_values_get(fid, EOLIAN_PROP_GET)));
1266
1267 fail_if(!eina_iterator_next(itr, (void**)&par));
1268 fail_if(!(doc = eolian_parameter_documentation_get(par)));
1269 fail_if(strcmp(eolian_documentation_summary_get(doc),
1270 "Value documentation."));
1271 fail_if(eolian_documentation_description_get(doc));
1272
1273 fail_if(eina_iterator_next(itr, (void**)&par));
1274 eina_iterator_free(itr);
1275
1276 fail_if(!(event = eolian_class_event_get_by_name(class, "clicked")));
1277 fail_if(!(doc = eolian_event_documentation_get(event)));
1278 fail_if(strcmp(eolian_documentation_summary_get(doc),
1279 "Event docs."));
1280 fail_if(eolian_documentation_description_get(doc));
1139 1281
1140 eolian_shutdown(); 1282 eolian_shutdown();
1141} 1283}