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.3 | 83 -------------------------------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 man/dbfp.3 (limited to 'man/dbfp.3') diff --git a/man/dbfp.3 b/man/dbfp.3 deleted file mode 100644 index 6e9cc2a..0000000 --- a/man/dbfp.3 +++ /dev/null @@ -1,83 +0,0 @@ -.TH DBFP 3 2016-03-08 dbfp "DB timetable API" -.SH NAME -dbfp, dbfp_init, dbfp_close \- handle metadata for connections to the DB timetable API -.SH SYNOPSIS -.HP -.B #include -.HP -.B struct dbfp { -.RS -.B char *key; -.br -.B CURL *curl; -.RE -.B }; -.HP -.B int dbfp_init(struct dbfp *dbfp, char *key); -.HP -.B void dbfp_close(struct dbfp *dbfp); -.SH DESCRIPTION -.B dbfp -stores the metadata for connections to the DB timetable API. -.B key -is the API key used for API queries. -.B curl -is the curl handle used for the API requests. -.PP -.B dbfp_init -initializes a dbfp structure with the given API key. dbfp and key may not be -NULL. dbfp must already be allocated. The key is copied to the dbfp structure. -Every structure that was initialized with this function must be closed with -dbfp_close. -.PP -.B dbfp_close -closes a dbfp structure and releases its allocated resources. dbfp itself is -not freed. If dbfp is NULL, the function returns. You should call dbfp_close -for all dbfp structures. You have to call it for all dbfp structures -initialized with dbfp_init. -.SH RETURN VALUE -.B dbfp_init -returns zero if successful, or an error code if an error occured. -.SH ERRORS -EINVAL -.RS -if one of the arguments of dbfp_init is NULL -.RE -ENOMEM -.RS -if there is not enough memory to copy the key in dbfp_init -.RE -DBFP_ERROR_CURL -.RS -if the curl handle could not be created -.RE -.SH EXAMPLE -#include -.br -#include -.br -#include -.PP -int main(int argc, char **argv) -.br -{ -.RS -struct dbfp dbfp; -.br -int err; -.PP -err = dbfp_init(&dbfp, "API key"); -.br -if (!err) -.RS -printf("DBFP structure created.\\n"); -.RE -else -.RS -printf("Could not create DBFP: %s\\n", strerror(err)); -.RE -dbfp_close(&dbfp); -.PP -return 0; -.RE -} -- cgit v1.2.1