#include <sys/types.h>
#include <curl/curl.h>
Go to the source code of this file.
typedef struct mrss_attribute_t mrss_attribute_t |
typedef struct mrss_category_t mrss_category_t |
typedef struct mrss_day_t mrss_day_t |
typedef void* mrss_generic_t |
typedef struct mrss_hour_t mrss_hour_t |
typedef struct mrss_item_t mrss_item_t |
typedef struct mrss_options_t mrss_options_t |
typedef struct mrss_tag_t mrss_tag_t |
enum mrss_element_t |
Enum for the casting of the libmrss data struct
MRSS_ELEMENT_CHANNEL | The data struct is a mrss_t |
MRSS_ELEMENT_ITEM | The data struct is a mrss_item_t |
MRSS_ELEMENT_SKIPHOURS | The data struct is a mrss_hour_t |
MRSS_ELEMENT_SKIPDAYS | The data struct is a mrss_day_t |
MRSS_ELEMENT_CATEGORY | The data struct is a mrss_category_t |
MRSS_ELEMENT_TAG | The data struct is a mrss_tag_t |
MRSS_ELEMENT_ATTRIBUTE | The data struct is a mrss_attribute_t |
Definition at line 271 of file mrss.h.
00271 { 00272 /** The data struct is a mrss_t */ 00273 MRSS_ELEMENT_CHANNEL, 00274 /** The data struct is a mrss_item_t */ 00275 MRSS_ELEMENT_ITEM, 00276 /** The data struct is a mrss_hour_t */ 00277 MRSS_ELEMENT_SKIPHOURS, 00278 /** The data struct is a mrss_day_t */ 00279 MRSS_ELEMENT_SKIPDAYS, 00280 /** The data struct is a mrss_category_t */ 00281 MRSS_ELEMENT_CATEGORY, 00282 /** The data struct is a mrss_tag_t */ 00283 MRSS_ELEMENT_TAG, 00284 /** The data struct is a mrss_attribute_t */ 00285 MRSS_ELEMENT_ATTRIBUTE 00286 } mrss_element_t;
enum mrss_error_t |
This enum describes the error type of libmrss
Definition at line 46 of file mrss.h.
00046 { 00047 MRSS_OK = 0, /**< No error */ 00048 MRSS_ERR_POSIX, /**< For the correct error, use errno */ 00049 MRSS_ERR_PARSER, /**< Parser error */ 00050 MRSS_ERR_DOWNLOAD, /**< Download error */ 00051 MRSS_ERR_VERSION, /**< The RSS has a no compatible VERSION */ 00052 MRSS_ERR_DATA /**< The parameters are incorrect */ 00053 } mrss_error_t;
enum mrss_flag_t |
Flag list for mrss_set and mrss_get functions
MRSS_FLAG_VERSION | Set the ersion to a mrss_t element - the value is a mrss_version_t enum |
MRSS_FLAG_TITLE | Set the title to a mrss_t element - the value is a string |
MRSS_FLAG_TITLE_TYPE | Set the title type to a mrss_t element - the value is a string (ex: text, html, ...) |
MRSS_FLAG_DESCRIPTION | Set the description to a mrss_t element - the value is a string |
MRSS_FLAG_DESCRIPTION_TYPE | Set the description type to a mrss_t element - the value is a string |
MRSS_FLAG_LINK | Set the link to a mrss_t element - the value is a string |
MRSS_FLAG_ID | Set the id to a mrss_t element - the value is a string |
MRSS_FLAG_LANGUAGE | Set the language to a mrss_t element - the value is a string |
MRSS_FLAG_RATING | Set the rating to a mrss_t element - the value is a string |
MRSS_FLAG_COPYRIGHT | Set the copyright to a mrss_t element - the value is a string |
MRSS_FLAG_COPYRIGHT_TYPE | Set the copyright type to a mrss_t element - the value is a string |
MRSS_FLAG_PUBDATE | Set the pubDate to a mrss_t element - the value is a string |
MRSS_FLAG_LASTBUILDDATE | Set the lastBuildDate to a mrss_t element - the value is a string |
MRSS_FLAG_DOCS | Set the docs to a mrss_t element - the value is a string |
MRSS_FLAG_MANAGINGEDITOR | Set the managingeditor to a mrss_t element - the value is a string |
MRSS_FLAG_MANAGINGEDITOR_EMAIL | Set the managingeditor's email to a mrss_t element - the value is a string |
MRSS_FLAG_MANAGINGEDITOR_URI | Set the managingeditor's uri to a mrss_t element - the value is a string |
MRSS_FLAG_WEBMASTER | Set the webMaster to a mrss_t element - the value is a string |
MRSS_FLAG_TTL | Set the generator to a mrss_t element - the value is a string |
MRSS_FLAG_ABOUT | Set the about to a mrss_t element - the value is a string |
MRSS_FLAG_CONTRIBUTOR | Set the contributor to a mrss_t element - the value is a string |
MRSS_FLAG_CONTRIBUTOR_EMAIL | Set the contributor's email to a mrss_t element - the value is a string |
MRSS_FLAG_CONTRIBUTOR_URI | Set the contributor's uri to a mrss_t element - the value is a string |
MRSS_FLAG_GENERATOR | Set the generator to a mrss_t element - the value is a string |
MRSS_FLAG_GENERATOR_URI | Set the generator's email to a mrss_t element - the value is a string |
MRSS_FLAG_GENERATOR_VERSION | Set the generator's uri to a mrss_t element - the value is a string |
MRSS_FLAG_IMAGE_TITLE | Set the image_title to a mrss_t element - the value is a string |
MRSS_FLAG_IMAGE_URL | Set the image_url to a mrss_t element - the value is a string |
MRSS_FLAG_IMAGE_LOGO | Set the image_logo to a mrss_t element - the value is a string |
MRSS_FLAG_IMAGE_LINK | Set the image_link to a mrss_t element - the value is a string |
MRSS_FLAG_IMAGE_WIDTH | Set the image_width to a mrss_t element - the value is a integer |
MRSS_FLAG_IMAGE_HEIGHT | Set the image_height to a mrss_t element - the value is a integer |
MRSS_FLAG_IMAGE_DESCRIPTION | Set the image_description to a mrss_t element - the value is a string |
MRSS_FLAG_TEXTINPUT_TITLE | Set the textinput_title to a mrss_t element - the value is a string |
MRSS_FLAG_TEXTINPUT_DESCRIPTION | Set the textinput_description to a mrss_t element - the value is a string |
MRSS_FLAG_TEXTINPUT_NAME | Set the textinput_name to a mrss_t element - the value is a string |
MRSS_FLAG_TEXTINPUT_LINK | Set the textinput_link to a mrss_t element - the value is a string |
MRSS_FLAG_CLOUD | Set the cloud to a mrss_t element - the value is a string |
MRSS_FLAG_CLOUD_DOMAIN | Set the cloud_domain to a mrss_t element - the value is a string |
MRSS_FLAG_CLOUD_PORT | Set the cloud_port to a mrss_t element - the value is a string |
MRSS_FLAG_CLOUD_PATH | Set the cloud_path to a mrss_t element - the value is a integer |
MRSS_FLAG_CLOUD_REGISTERPROCEDURE | Set the cloud_registerProcedure to a mrss_t element - the value is a string |
MRSS_FLAG_CLOUD_PROTOCOL | Set the cloud_protocol to a mrss_t element - the value is a string |
MRSS_FLAG_HOUR | Set the hour to a mrss_hour_t element - the value is a string |
MRSS_FLAG_DAY | Set the day to a mrss_day_t element - the value is a string |
MRSS_FLAG_CATEGORY | Set the category to a mrss_category_t element - the value is a string |
MRSS_FLAG_CATEGORY_DOMAIN | Set the domain to a mrss_category_t element - the value is a string |
MRSS_FLAG_CATEGORY_LABEL | Set the label to a mrss_category_t element - the value is a string |
MRSS_FLAG_ITEM_TITLE | Set the title to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_TITLE_TYPE | Set the title type to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_LINK | Set the link to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_DESCRIPTION | Set the description to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_DESCRIPTION_TYPE | Set the description type to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_COPYRIGHT | Set the copyright to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_COPYRIGHT_TYPE | Set the copyright type to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_AUTHOR | Set the author to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_AUTHOR_URI | Set the author's uri to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_AUTHOR_EMAIL | Set the author's email to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_CONTRIBUTOR | Set the contributor to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_CONTRIBUTOR_URI | Set the contributor's uri to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_CONTRIBUTOR_EMAIL | Set the contributor's email to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_COMMENTS | Set the comments to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_PUBDATE | Set the pubDate to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_GUID | Set the guid to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_GUID_ISPERMALINK | Set the guid_isPermaLink to a mrss_item_t element - the value is a integer |
MRSS_FLAG_ITEM_SOURCE | Set the source to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_SOURCE_URL | Set the source_url to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_ENCLOSURE | Set the enclosure to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_ENCLOSURE_URL | Set the enclosure_url to a mrss_item_t element - the value is a string |
MRSS_FLAG_ITEM_ENCLOSURE_LENGTH | Set the enclosure_length to a mrss_item_t element - the value is a integer |
MRSS_FLAG_ITEM_ENCLOSURE_TYPE | Set the enclosure_type to a mrss_item_t element - the value is a string |
MRSS_FLAG_TAG_NAME | Set the name to a mrss_tag_t element - the value is a string |
MRSS_FLAG_TAG_VALUE | Set the value to a mrss_tag_t element - the value is a string |
MRSS_FLAG_TAG_NS | Set the namespace to a mrss_tag_t element - the value is a string |
MRSS_FLAG_ATTRIBUTE_NAME | Set the name to a mrss_attribute_t element - the value is a string |
MRSS_FLAG_ATTRIBUTE_VALUE | Set the value to a mrss_attribute_t element - the value is a string |
MRSS_FLAG_ATTRIBUTE_NS | Set the namespace to a mrss_attribute_t element - the value is a string |
MRSS_FLAG_END | Set the terminetor flag |
Definition at line 65 of file mrss.h.
00065 { 00066 /* Generic */ 00067 00068 /** Set the ersion to a mrss_t element - the value is a mrss_version_t enum */ 00069 MRSS_FLAG_VERSION = 1, 00070 00071 /** Set the title to a mrss_t element - the value is a string */ 00072 MRSS_FLAG_TITLE, 00073 /** Set the title type to a mrss_t element - the value is a string (ex: text, html, ...)*/ 00074 MRSS_FLAG_TITLE_TYPE, 00075 /** Set the description to a mrss_t element - the value is a string */ 00076 MRSS_FLAG_DESCRIPTION, 00077 /** Set the description type to a mrss_t element - the value is a string */ 00078 MRSS_FLAG_DESCRIPTION_TYPE, 00079 /** Set the link to a mrss_t element - the value is a string */ 00080 MRSS_FLAG_LINK, 00081 /** Set the id to a mrss_t element - the value is a string */ 00082 MRSS_FLAG_ID, 00083 /** Set the language to a mrss_t element - the value is a string */ 00084 MRSS_FLAG_LANGUAGE, 00085 /** Set the rating to a mrss_t element - the value is a string */ 00086 MRSS_FLAG_RATING, 00087 /** Set the copyright to a mrss_t element - the value is a string */ 00088 MRSS_FLAG_COPYRIGHT, 00089 /** Set the copyright type to a mrss_t element - the value is a string */ 00090 MRSS_FLAG_COPYRIGHT_TYPE, 00091 /** Set the pubDate to a mrss_t element - the value is a string */ 00092 MRSS_FLAG_PUBDATE, 00093 /** Set the lastBuildDate to a mrss_t element - the value is a string */ 00094 MRSS_FLAG_LASTBUILDDATE, 00095 /** Set the docs to a mrss_t element - the value is a string */ 00096 MRSS_FLAG_DOCS, 00097 /** Set the managingeditor to a mrss_t element - the value is a string */ 00098 MRSS_FLAG_MANAGINGEDITOR, 00099 /** Set the managingeditor's email to a mrss_t element - the value is a string */ 00100 MRSS_FLAG_MANAGINGEDITOR_EMAIL, 00101 /** Set the managingeditor's uri to a mrss_t element - the value is a string */ 00102 MRSS_FLAG_MANAGINGEDITOR_URI, 00103 /** Set the webMaster to a mrss_t element - the value is a string */ 00104 MRSS_FLAG_WEBMASTER, 00105 /** Set the generator to a mrss_t element - the value is a string */ 00106 MRSS_FLAG_TTL, 00107 /** Set the about to a mrss_t element - the value is a string */ 00108 MRSS_FLAG_ABOUT, 00109 00110 /* Contributor */ 00111 00112 /** Set the contributor to a mrss_t element - the value is a string */ 00113 MRSS_FLAG_CONTRIBUTOR, 00114 /** Set the contributor's email to a mrss_t element - the value is a string */ 00115 MRSS_FLAG_CONTRIBUTOR_EMAIL, 00116 /** Set the contributor's uri to a mrss_t element - the value is a string */ 00117 MRSS_FLAG_CONTRIBUTOR_URI, 00118 00119 /* Generator */ 00120 00121 /** Set the generator to a mrss_t element - the value is a string */ 00122 MRSS_FLAG_GENERATOR, 00123 /** Set the generator's email to a mrss_t element - the value is a string */ 00124 MRSS_FLAG_GENERATOR_URI, 00125 /** Set the generator's uri to a mrss_t element - the value is a string */ 00126 MRSS_FLAG_GENERATOR_VERSION, 00127 00128 /* Image */ 00129 00130 /** Set the image_title to a mrss_t element - the value is a string */ 00131 MRSS_FLAG_IMAGE_TITLE, 00132 /** Set the image_url to a mrss_t element - the value is a string */ 00133 MRSS_FLAG_IMAGE_URL, 00134 /** Set the image_logo to a mrss_t element - the value is a string */ 00135 MRSS_FLAG_IMAGE_LOGO, 00136 /** Set the image_link to a mrss_t element - the value is a string */ 00137 MRSS_FLAG_IMAGE_LINK, 00138 /** Set the image_width to a mrss_t element - the value is a integer */ 00139 MRSS_FLAG_IMAGE_WIDTH, 00140 /** Set the image_height to a mrss_t element - the value is a integer */ 00141 MRSS_FLAG_IMAGE_HEIGHT, 00142 /** Set the image_description to a mrss_t element - the value is a string */ 00143 MRSS_FLAG_IMAGE_DESCRIPTION, 00144 00145 /* TextInput */ 00146 00147 /** Set the textinput_title to a mrss_t element - the value is a string */ 00148 MRSS_FLAG_TEXTINPUT_TITLE, 00149 /** Set the textinput_description to a mrss_t element - the value is a string */ 00150 MRSS_FLAG_TEXTINPUT_DESCRIPTION, 00151 /** Set the textinput_name to a mrss_t element - the value is a string */ 00152 MRSS_FLAG_TEXTINPUT_NAME, 00153 /** Set the textinput_link to a mrss_t element - the value is a string */ 00154 MRSS_FLAG_TEXTINPUT_LINK, 00155 00156 /* Cloud */ 00157 00158 /** Set the cloud to a mrss_t element - the value is a string */ 00159 MRSS_FLAG_CLOUD, 00160 /** Set the cloud_domain to a mrss_t element - the value is a string */ 00161 MRSS_FLAG_CLOUD_DOMAIN, 00162 /** Set the cloud_port to a mrss_t element - the value is a string */ 00163 MRSS_FLAG_CLOUD_PORT, 00164 /** Set the cloud_path to a mrss_t element - the value is a integer */ 00165 MRSS_FLAG_CLOUD_PATH, 00166 /** Set the cloud_registerProcedure to a mrss_t element - 00167 * the value is a string */ 00168 MRSS_FLAG_CLOUD_REGISTERPROCEDURE, 00169 /** Set the cloud_protocol to a mrss_t element - the value is a string */ 00170 MRSS_FLAG_CLOUD_PROTOCOL, 00171 00172 /* SkipHours */ 00173 00174 /** Set the hour to a mrss_hour_t element - the value is a string */ 00175 MRSS_FLAG_HOUR, 00176 00177 /* SkipDays */ 00178 00179 /** Set the day to a mrss_day_t element - the value is a string */ 00180 MRSS_FLAG_DAY, 00181 00182 /* Category or Item/Category */ 00183 00184 /** Set the category to a mrss_category_t element - the value is a string */ 00185 MRSS_FLAG_CATEGORY, 00186 /** Set the domain to a mrss_category_t element - the value is a string */ 00187 MRSS_FLAG_CATEGORY_DOMAIN, 00188 /** Set the label to a mrss_category_t element - the value is a string */ 00189 MRSS_FLAG_CATEGORY_LABEL, 00190 00191 /* Item */ 00192 00193 /** Set the title to a mrss_item_t element - the value is a string */ 00194 MRSS_FLAG_ITEM_TITLE, 00195 /** Set the title type to a mrss_item_t element - the value is a string */ 00196 MRSS_FLAG_ITEM_TITLE_TYPE, 00197 /** Set the link to a mrss_item_t element - the value is a string */ 00198 MRSS_FLAG_ITEM_LINK, 00199 /** Set the description to a mrss_item_t element - the value is a string */ 00200 MRSS_FLAG_ITEM_DESCRIPTION, 00201 /** Set the description type to a mrss_item_t element - the value is a string */ 00202 MRSS_FLAG_ITEM_DESCRIPTION_TYPE, 00203 /** Set the copyright to a mrss_item_t element - the value is a string */ 00204 MRSS_FLAG_ITEM_COPYRIGHT, 00205 /** Set the copyright type to a mrss_item_t element - the value is a string */ 00206 MRSS_FLAG_ITEM_COPYRIGHT_TYPE, 00207 00208 /** Set the author to a mrss_item_t element - the value is a string */ 00209 MRSS_FLAG_ITEM_AUTHOR, 00210 /** Set the author's uri to a mrss_item_t element - the value is a string */ 00211 MRSS_FLAG_ITEM_AUTHOR_URI, 00212 /** Set the author's email to a mrss_item_t element - the value is a string */ 00213 MRSS_FLAG_ITEM_AUTHOR_EMAIL, 00214 00215 /** Set the contributor to a mrss_item_t element - the value is a string */ 00216 MRSS_FLAG_ITEM_CONTRIBUTOR, 00217 /** Set the contributor's uri to a mrss_item_t element - the value is a string */ 00218 MRSS_FLAG_ITEM_CONTRIBUTOR_URI, 00219 /** Set the contributor's email to a mrss_item_t element - the value is a string */ 00220 MRSS_FLAG_ITEM_CONTRIBUTOR_EMAIL, 00221 00222 /** Set the comments to a mrss_item_t element - the value is a string */ 00223 MRSS_FLAG_ITEM_COMMENTS, 00224 /** Set the pubDate to a mrss_item_t element - the value is a string */ 00225 MRSS_FLAG_ITEM_PUBDATE, 00226 /** Set the guid to a mrss_item_t element - the value is a string */ 00227 MRSS_FLAG_ITEM_GUID, 00228 /** Set the guid_isPermaLink to a mrss_item_t element - 00229 * the value is a integer */ 00230 MRSS_FLAG_ITEM_GUID_ISPERMALINK, 00231 /** Set the source to a mrss_item_t element - the value is a string */ 00232 MRSS_FLAG_ITEM_SOURCE, 00233 /** Set the source_url to a mrss_item_t element - the value is a string */ 00234 MRSS_FLAG_ITEM_SOURCE_URL, 00235 /** Set the enclosure to a mrss_item_t element - the value is a string */ 00236 MRSS_FLAG_ITEM_ENCLOSURE, 00237 /** Set the enclosure_url to a mrss_item_t element - the value is a string */ 00238 MRSS_FLAG_ITEM_ENCLOSURE_URL, 00239 /** Set the enclosure_length to a mrss_item_t element - 00240 * the value is a integer */ 00241 MRSS_FLAG_ITEM_ENCLOSURE_LENGTH, 00242 /** Set the enclosure_type to a mrss_item_t element - the value is a string */ 00243 MRSS_FLAG_ITEM_ENCLOSURE_TYPE, 00244 00245 /* Item */ 00246 00247 /** Set the name to a mrss_tag_t element - the value is a string */ 00248 MRSS_FLAG_TAG_NAME, 00249 00250 /** Set the value to a mrss_tag_t element - the value is a string */ 00251 MRSS_FLAG_TAG_VALUE, 00252 00253 /** Set the namespace to a mrss_tag_t element - the value is a string */ 00254 MRSS_FLAG_TAG_NS, 00255 00256 /** Set the name to a mrss_attribute_t element - the value is a string */ 00257 MRSS_FLAG_ATTRIBUTE_NAME, 00258 00259 /** Set the value to a mrss_attribute_t element - the value is a string */ 00260 MRSS_FLAG_ATTRIBUTE_VALUE, 00261 00262 /** Set the namespace to a mrss_attribute_t element - the value is a string */ 00263 MRSS_FLAG_ATTRIBUTE_NS, 00264 00265 /** Set the terminetor flag */ 00266 MRSS_FLAG_END = 0 00267 00268 } mrss_flag_t;
enum mrss_version_t |
Definition at line 55 of file mrss.h.
00055 { 00056 MRSS_VERSION_0_91, /**< 0.91 RSS version */ 00057 MRSS_VERSION_0_92, /**< 0.92 RSS version */ 00058 MRSS_VERSION_1_0, /**< 1.0 RSS version */ 00059 MRSS_VERSION_2_0, /**< 2.0 RSS version */ 00060 MRSS_VERSION_ATOM_0_3, /**< 0.3 Atom version */ 00061 MRSS_VERSION_ATOM_1_0 /**< 1.0 Atom version */ 00062 } mrss_version_t;
char* mrss_curl_strerror | ( | CURLcode | err | ) |
This function returns a static string with the description of curl code
err | the error code that you need as string |
mrss_error_t mrss_element | ( | mrss_generic_t | element, | |
mrss_element_t * | ret | |||
) |
This function returns the mrss_element_t of a mrss data struct.
element | it is the element that you want check | |
ret | it is a pointer to a mrss_element_t. It will be sets. |
mrss_error_t mrss_free | ( | mrss_generic_t | element | ) |
FREE FUNCTION This function frees any type of data struct of libmrss. If the element is alloced by libmrss, it will be freed, else this function frees only the internal data.
mrss_t *t=....; mrss_item_t *item=...; mrss_free(t); mrss_free(item);
element | the data struct |
mrss_error_t mrss_get | ( | mrss_generic_t | element, | |
... | ||||
) |
This function returns the request arguments. The syntax is the same of mrss_set but the values of the list are pointer to data element (int *, char **). If the key needs a char **, the value will be allocated.
mrss_get(category, MRSS_FLAG_CATEGORY_DOMAIN, &string, MRSS_FLAG_END); if(string) free(string);
element | it is any type of mrss data struct. |
mrss_error_t mrss_get_last_modified | ( | char * | urlstring, | |
time_t * | lastmodified | |||
) |
This function returns the number of seconds sinze Jennuary 1st 1970 in the UTC time zone, for the url that the urlstring parameter specifies.
urlstring | the url | |
lastmodified | is a pointer to a time_t struct. The return value can be 0 if the HEAD request does not return a Last-Modified value. |
mrss_error_t mrss_get_last_modified_with_options | ( | char * | urlstring, | |
time_t * | lastmodified, | |||
mrss_options_t * | options | |||
) |
Like the previous function but with a options struct.
urlstring | the url | |
lastmodified | is a pointer to a time_t struct. The return value can be 0 if the HEAD request does not return a Last-Modified value. | |
options | a pointer to a options struct |
mrss_error_t mrss_get_last_modified_with_options_and_error | ( | char * | urlstring, | |
time_t * | lastmodified, | |||
mrss_options_t * | options, | |||
CURLcode * | curl_code | |||
) |
Like the previous function but with a CURLcode pointer.
urlstring | the url | |
lastmodified | is a pointer to a time_t struct. The return value can be 0 if the HEAD request does not return a Last-Modified value. | |
options | a pointer to a options struct | |
curl_code | it will contain the error code of libcurl |
mrss_error_t mrss_new | ( | mrss_t ** | mrss | ) |
EDIT FUNCTIONS If you want create a new feed RSS from scratch, you need use this function as the first.
mrss_t *d; mrss_error_t err; char *string; int integer; d=NULL; // ->this is important! If d!=NULL, mrss_new doesn't alloc memory. mrss_new(&d); err=mrss_set (d, MRSS_FLAG_VERSION, MRSS_VERSION_0_92, MRSS_FLAG_TITLE, "the title!", MRSS_FLAG_TTL, 12, MRSS_FLAG_END); if(err!=MRSS_OK) printf("%s\n",mrss_strerror(err)); err=mrss_get (d, MRSS_FLAG_TITLE, &string, MRSS_FLAG_TTL, &integer, MRSS_FLAG_END); if(err!=MRSS_OK) printf("%s\n",mrss_strerror(err)); printf("The title is: '%s'\n", string); printf("The ttl is: '%d'\n", integer); free(string);
mrss | is the pointer to the new data struct |
mrss_error_t mrss_new_subdata | ( | mrss_generic_t | element, | |
mrss_element_t | subelement, | |||
mrss_generic_t | subdata | |||
) |
This function adds an element to another element. For example you can add a item to a channel, or a category to a item, and so on. Look this example:
mrss_item_t *item = NULL; mrss_hour_t *hour = NULL; mrss_day_t day; // If the element is no null, the function mrss_category_t category, // does not alloc it mrss_new_subdata(mrss, MRSS_ELEMENT_ITEM, &item); mrss_new_subdata(mrss, MRSS_ELEMENT_SKIPHOURS, &hour); mrss_new_subdata(mrss, MRSS_ELEMENT_SKIPDAYS, &day); mrss_new_subdata(item, MRSS_ELEMENT_ITEM_CATEGORY, &category);
element | it is the parent element | |
subelement | it is the type of the child (MRSS_ELEMENT_ITEM, MRSS_ELEMENT_CATEGORY, ...) | |
subdata | it is the pointer to the new struct. If the pointer of *subdata exists, it will no alloced, else yes. |
void mrss_options_free | ( | mrss_options_t * | options | ) |
This function destroys a options struct.
options | a pointer to a options struct |
mrss_options_t* mrss_options_new | ( | int | timeout, | |
char * | proxy, | |||
char * | proxy_authentication, | |||
char * | certfile, | |||
char * | password, | |||
char * | cacert, | |||
int | verifypeer, | |||
char * | authentication, | |||
char * | user_agent | |||
) |
This function creates a options struct.
timeout | timeout for the download procedure | |
proxy | a proxy server. can be NULL | |
proxy_authentication | a proxy authentication (user:pwd). can be NULL | |
certfile | a certificate for ssl autentication connection | |
password | the password of certfile | |
cacert | CA certificate to verify peer against. can be NULL | |
verifypeer | active/deactive the peer check | |
authentication | an authentication login (user:pwd). can be NULL | |
user_agent | a user_agent. can be NULL |
mrss_error_t mrss_parse_buffer | ( | char * | buffer, | |
size_t | size_buffer, | |||
mrss_t ** | mrss | |||
) |
Parses a buffer and creates the data struct of the feed RSS url
buffer | Pointer to the xml memory stream to be parsed | |
size_buffer | The size of the array of char | |
mrss | the pointer to your data struct |
mrss_error_t mrss_parse_file | ( | char * | file, | |
mrss_t ** | mrss | |||
) |
Parses a file and creates the data struct of the feed RSS url
file | The file to be parsed | |
mrss | the pointer to your data struct |
mrss_error_t mrss_parse_url | ( | char * | url, | |
mrss_t ** | mrss | |||
) |
PARSE FUNCTIONS Parses a url and creates the data struct of the feed RSS url. This function downloads your request if this is http or ftp.
url | The url to be parsed | |
mrss | the pointer to your data struct |
mrss_error_t mrss_parse_url_with_options | ( | char * | url, | |
mrss_t ** | mrss, | |||
mrss_options_t * | options | |||
) |
Like the previous function but with a options struct.
url | The url to be parsed | |
mrss | the pointer to your data struct | |
options | a pointer to a options data struct |
mrss_error_t mrss_parse_url_with_options_and_error | ( | char * | url, | |
mrss_t ** | mrss, | |||
mrss_options_t * | options, | |||
CURLcode * | curlcode | |||
) |
Like the previous function but with CURLcode error
url | The url to be parsed | |
mrss | the pointer to your data struct | |
options | a pointer to a options data struct. It can be NULL | |
curlcode | the error code from libcurl |
mrss_error_t mrss_parse_url_with_options_error_and_transfer_buffer | ( | char * | url, | |
mrss_t ** | mrss, | |||
mrss_options_t * | options, | |||
CURLcode * | curlcode, | |||
char ** | feed_content, | |||
int * | feed_size | |||
) |
Like the previous function but you take ownership of the downloaded buffer in case of success
url | The url to be parsed | |
mrss | the pointer to your data struct | |
options | a pointer to a options data struct | |
curlcode | the error code from libcurl | |
feed_content | a pointer to the buffer with the document. This is not NULL terminated | |
feed_size | the size of the buffer above |
mrss_error_t mrss_remove_subdata | ( | mrss_generic_t | element, | |
mrss_generic_t | subdata | |||
) |
This function removes a subdata element. As first argoment you must specify the parent, and second argoment the child.
mrss_remove_subdata(mrss, item);
element | it is the parent | |
subdata | the child that you want remove. Remember: mrss_remove_subdata does not free the memory. So you can remove a item and reinsert it after. |
mrss_error_t mrss_search_attribute | ( | mrss_generic_t | element, | |
char * | name, | |||
char * | ns, | |||
mrss_attribute_t ** | attribute | |||
) |
This function search an attribute from a mrss_tag_t, a name and a namespace
element | it is the mrss_tag_t | |
name | the name of the element | |
ns | the namespace. It can be null if the tag has a null namespace | |
attribute | the return pointer |
mrss_error_t mrss_search_tag | ( | mrss_generic_t | element, | |
char * | name, | |||
char * | ns, | |||
mrss_tag_t ** | tag | |||
) |
This function search a tag in a mrss_t, a mrss_item_t or a mrss_tag_t from name and a namespace.
element | it is the parent node (mrss_t or mrss_item_t) | |
name | the name of the element | |
ns | the namespace. It can be null if the tag has a null namespace | |
tag | the return pointer |
mrss_error_t mrss_set | ( | mrss_generic_t | element, | |
... | ||||
) |
For insert/replace/remove a flags use this function as this example:
mrss_set(mrss, MRSS_FLAG_TITLE, "hello world", MRSS_FLAG_END); mrss_set(item, MRSS_FLAG_DESCRIPTION, NULL, MRSS_FLAG_END);
element | it is the mrss data that you want changes the the next list of elements. The list is composted by KEY - VALUES and as last element MRSS_FLAG_END. The variable of value depends from key. |
char* mrss_strerror | ( | mrss_error_t | err | ) |
GENERIC FUNCTION This function returns a static string with the description of error code
err | the error code that you need as string |
mrss_error_t mrss_write_buffer | ( | mrss_t * | mrss, | |
char ** | buffer | |||
) |
Write a RSS struct data in a buffer.
char *buffer; buffer=NULL; //<--- This is important!! mrss_write_buffer (mrss, &buffer);
The buffer must be NULL.
mrss | the rss struct data | |
buffer | the buffer |
mrss_error_t mrss_write_file | ( | mrss_t * | mrss, | |
char * | file | |||
) |
WRITE FUNCTIONS Writes a RSS struct data in a local file
mrss | the rss struct data | |
file | the local file |