From 4c68c15d4d3102b26b824b0021901d1dd9d79e77 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Thu, 10 Mar 2016 17:42:09 +0100 Subject: dbfp: move curl handle to dbfp As the curl handle can be reused between requests, it is moved to the dbfp structure, initialized in dbfp_init and freed in dbfp_close. --- man/dbfp.3 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'man') diff --git a/man/dbfp.3 b/man/dbfp.3 index e423f38..6e9cc2a 100644 --- a/man/dbfp.3 +++ b/man/dbfp.3 @@ -8,6 +8,8 @@ dbfp, dbfp_init, dbfp_close \- handle metadata for connections to the DB timetab .B struct dbfp { .RS .B char *key; +.br +.B CURL *curl; .RE .B }; .HP @@ -19,12 +21,14 @@ dbfp, dbfp_init, dbfp_close \- handle metadata for connections to the DB timetab 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 and sets the API key to the given value. 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. +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 @@ -43,6 +47,10 @@ 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 -- cgit v1.2.1