From c96d948a4b76875c91848518aa2f55f2774a4118 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 6 Jun 2016 18:20:10 +0200 Subject: dbfp: add man pages for dbfp_init, dbfp_close --- man/dbfp_init.pod | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 man/dbfp_init.pod (limited to 'man/dbfp_init.pod') diff --git a/man/dbfp_init.pod b/man/dbfp_init.pod new file mode 100644 index 0000000..8749a2f --- /dev/null +++ b/man/dbfp_init.pod @@ -0,0 +1,78 @@ +=head1 NAME + +dbfp_init - initialize the metadata for queries to the DB timetable API + +=head1 SYNOPSIS + + #include + + int dbfp_init(struct dbfp *dbfp, char *key); + +=head1 DESCRIPTION + +B initializes a I structure that stores the metadata for +queries to the DB timetable API. I is the API key to use for the +connections. I must already be allocated. I and I must not +be NULL. I is copied to the structure, so it can be changed or freed +after calling this function. + +B is a structure defined as: + + struct dbfp { + char *key; + CURL *curl; + }; + +The user does not have to deal with the fields of this structure. + +I structures initialized with this method should be closed by calling +B. + +=head1 RETURN VALUE + +B returns zero if successful, or a non-zero error code. Positive +error codes are from I, negative error codes are specific to dbfp. + +=head1 ERRORS + +=over + +=item EINVAL + +if I or I is NULL + +=item ENOMEM + +if there is not enoguh memory to copy I to I + +=item DBFP_ERROR_CURL + +if curl could not be initialized + +=back + +=head1 EXAMPLE + + #include + #include + #include + #include + + int main(int argc, char **argv) + { + struct dbfp dbfp; + int err; + + err = dbfp_init(&dbfp, "API key"); + if (!err) + printf("DBFP structure created.\n"); + else + printf("Could not create DBFP: %s\n", strerror(err)); + dbfp_close(&dbfp); + + return err ? EXIT_FAILURE : EXIT_SUCCESS; + } + +=head1 SEE ALSO + +L -- cgit v1.2.1