From 995424298052fa02ac82a584ee4247939503f24a Mon Sep 17 00:00:00 2001 From: Colin Hogben Date: Thu, 23 Feb 2012 09:43:37 +0000 Subject: Generate lists and use symbols in --libcurl code output. This patch improves the output of curl's --libcurl option by generating code which builds curl_httppost and curl_slist lists, and uses symbolic names for enum and flag values. Variants of the my_setopt macro in tool_setopt.h are added in order to pass extra type information to the code-generation step in tool_setopt.c. If curl is configured with --disable-libcurl-option then the macros call curl_easy_setopt directly. --- src/tool_easysrc.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/tool_easysrc.h') diff --git a/src/tool_easysrc.h b/src/tool_easysrc.h index 8e81d5567..1d2c02765 100644 --- a/src/tool_easysrc.h +++ b/src/tool_easysrc.h @@ -26,12 +26,22 @@ /* global variable declarations, for easy-interface source code generation */ -extern struct curl_slist *easysrc; -extern struct curl_slist *easysrc_remarks; +extern struct curl_slist *easysrc_decl; /* Variable declarations */ +extern struct curl_slist *easysrc_data; /* Build slists, forms etc. */ +extern struct curl_slist *easysrc_code; /* Setopt calls etc. */ +extern struct curl_slist *easysrc_toohard; /* Unconvertible setopt */ +extern struct curl_slist *easysrc_clean; /* Clean up (reverse order) */ +extern int easysrc_form_count; /* Number of curl_httppost variables */ +extern int easysrc_slist_count; /* Number of curl_slist variables */ + +extern CURLcode easysrc_init(void); +extern CURLcode easysrc_add(struct curl_slist **plist, const char *bupf); +extern CURLcode easysrc_addf(struct curl_slist **plist, const char *fmt, ...); +extern CURLcode easysrc_perform(void); +extern CURLcode easysrc_cleanup(void); void dumpeasysrc(struct Configurable *config); -#endif /* CURL_DISABLE_LIBCIRL_CMD */ +#endif /* CURL_DISABLE_LIBCURL_OPTION */ #endif /* HEADER_CURL_TOOL_EASYSRC_H */ - -- cgit v1.2.3