deimos.mrss

mRss(http://www.autistici.org/bakunin/libmrss/doc/) is a C library for parsing, writing and creating RSS/ATOM files or streams.

Written 2014,2015,2016,2017 by Laeeth Isharc and Kaleidic Associates Advisory Limited

Members

Aliases

mrss_generic_t
alias mrss_generic_t = void*

Enums

mrss_element_t
enum mrss_element_t

Enum for the casting of the libmrss data struct

mrss_error_t
enum mrss_error_t

This enum describes the error type of libmrss

mrss_flag_t
enum mrss_flag_t

Flag list for mrss_set and mrss_get functions

mrss_version_t
enum mrss_version_t

Functions

mrss_curl_strerror
char* mrss_curl_strerror(CURLcode err)

This function returns a static string with the description of curl code

mrss_element
mrss_error_t mrss_element(mrss_generic_t element, mrss_element_t* ret)

Returns the mrss_element_t of a mrss data struct.

mrss_free
mrss_error_t mrss_free(mrss_generic_t element)

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_get
mrss_error_t mrss_get(mrss_generic_t element, ...)

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_last_modified_with_options
mrss_error_t mrss_get_last_modified_with_options(char* urlstring, time_t* lastmodified, mrss_options_t* options)

Returns the number of seconds sinze January 1st 1970 in the UTC time zone, for the url that the urlstring parameter specifies. With options struct

mrss_get_last_modified_with_options_and_error
mrss_error_t mrss_get_last_modified_with_options_and_error(char* urlstring, time_t* lastmodified, mrss_options_t* options, CURLcode* curl_code)

Returns the number of seconds sinze January 1st 1970 in the UTC time zone, for the url that the urlstring parameter specifies. With options struct and CURLcode pointer.

mrss_new
mrss_error_t mrss_new(mrss_t** mrss)

To create a new feed RSS from scratch, use this function as the first.

mrss_new_subdata
mrss_error_t mrss_new_subdata(mrss_generic_t element, mrss_element_t subelement, mrss_generic_t subdata)

adds an element to another element. For example: add a item to a channel, or a category to a item, and so on.

mrss_options_free
void mrss_options_free(mrss_options_t* options)

This function destroys a options struct.

mrss_options_new
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.

mrss_parse_buffer
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

mrss_parse_file
mrss_error_t mrss_parse_file(char* file, mrss_t** mrss)

Parses a file and creates the data struct of the feed RSS url

mrss_parse_url
mrss_error_t mrss_parse_url(char* url, mrss_t** mrss)

Parses a url and creates the data struct of the feed RSS url. This function downloads your request if this is http or ftp.

mrss_parse_url_with_options
mrss_error_t mrss_parse_url_with_options(char* url, mrss_t** mrss, mrss_options_t* options)

Parses a url and creates the data struct of the feed RSS url. This function downloads your request if this is http or ftp. with an options struct.

mrss_parse_url_with_options_and_error
mrss_error_t mrss_parse_url_with_options_and_error(char* url, mrss_t** mrss, mrss_options_t* options, CURLcode* curlcode)

Parses a url and creates the data struct of the feed RSS url. This function downloads your request if this is http or ftp. with an options struct and CURLcode error

mrss_parse_url_with_options_error_and_transfer_buffer
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

mrss_remove_subdata
mrss_error_t mrss_remove_subdata(mrss_generic_t element, mrss_generic_t subdata)

Removes a subdata element.

mrss_search_attribute
mrss_error_t mrss_search_attribute(mrss_generic_t element, char* name, char* ns, mrss_attribute_t** attribute)

This function searches an attribute from a mrss_tag_t, a name and a namespace

mrss_search_tag
mrss_error_t mrss_search_tag(mrss_generic_t element, char* name, char* ns, mrss_tag_t** tag)

Search a tag in a mrss_t, a mrss_item_t or a mrss_tag_t from name and a namespace.

mrss_set
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); `

mrss_strerror
char* mrss_strerror(mrss_error_t err)

This function returns a static string with the description of error code

mrss_write_buffer
mrss_error_t mrss_write_buffer(mrss_t* mrss, char** buffer)

Write a RSS struct data in a buffer.

mrss_write_file
mrss_error_t mrss_write_file(mrss_t* mrss, char* file)

Writes a RSS struct data in a local file

Structs

mrss_attribute_t
struct mrss_attribute_t

Data struct for the attributes of the tag Struct data for external attribute

mrss_category_t
struct mrss_category_t

Data struct for category elements

mrss_day_t
struct mrss_day_t

Data struct for skipDays elements.

mrss_hour_t
struct mrss_hour_t

Data struct for skipHours elements.

mrss_item_t
struct mrss_item_t

Data struct for any items of RSS. It contains a pointer to the list of categories.

mrss_options_t
struct mrss_options_t

Options data struct. It contains some user preferences.

mrss_t
struct mrss_t

Principal data struct. It contains pointers to any other structures.

mrss_tag_t
struct mrss_tag_t

Data struct for any other tag out of the RSS namespace. Struct data for external tags

Variables

LIBMRSS_MAJOR_VERSION
auto LIBMRSS_MAJOR_VERSION
LIBMRSS_MICRO_VERSION
auto LIBMRSS_MICRO_VERSION
LIBMRSS_MINOR_VERSION
auto LIBMRSS_MINOR_VERSION
LIBMRSS_VERSION_STRING
auto LIBMRSS_VERSION_STRING

Meta

Authors

Laeeth Isharc and Ilya Yaroshenko