Add. Export some libcurl flags and constants.
This commit is contained in:
parent
03d0e811c8
commit
a1393c1934
86
src/lcflags.h
Normal file
86
src/lcflags.h
Normal file
@ -0,0 +1,86 @@
|
||||
|
||||
FLG_ENTRY(AUTH_NONE )
|
||||
FLG_ENTRY(AUTH_BASIC )
|
||||
FLG_ENTRY(AUTH_DIGEST )
|
||||
FLG_ENTRY(AUTH_GSSNEGOTIATE )
|
||||
FLG_ENTRY(AUTH_NTLM )
|
||||
FLG_ENTRY(AUTH_DIGEST_IE )
|
||||
FLG_ENTRY(AUTH_NTLM_WB )
|
||||
FLG_ENTRY(AUTH_ONLY )
|
||||
FLG_ENTRY(AUTH_ANY )
|
||||
FLG_ENTRY(AUTH_ANYSAFE )
|
||||
|
||||
FLG_ENTRY(SSH_AUTH_ANY )
|
||||
FLG_ENTRY(SSH_AUTH_NONE )
|
||||
FLG_ENTRY(SSH_AUTH_PUBLICKEY )
|
||||
FLG_ENTRY(SSH_AUTH_PASSWORD )
|
||||
FLG_ENTRY(SSH_AUTH_HOST )
|
||||
FLG_ENTRY(SSH_AUTH_KEYBOARD )
|
||||
FLG_ENTRY(SSH_AUTH_AGENT )
|
||||
FLG_ENTRY(SSH_AUTH_DEFAULT )
|
||||
|
||||
FLG_ENTRY(GSSAPI_DELEGATION_NONE )
|
||||
FLG_ENTRY(GSSAPI_DELEGATION_POLICY_FLAG )
|
||||
FLG_ENTRY(GSSAPI_DELEGATION_FLAG )
|
||||
|
||||
/* Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options */
|
||||
FLG_ENTRY(USESSL_NONE )
|
||||
FLG_ENTRY(USESSL_TRY )
|
||||
FLG_ENTRY(USESSL_CONTROL )
|
||||
FLG_ENTRY(USESSL_ALL )
|
||||
FLG_ENTRY(SSLOPT_ALLOW_BEAST )
|
||||
|
||||
/* parameter for the CURLOPT_FTP_SSL_CCC option */
|
||||
FLG_ENTRY(FTPSSL_CCC_NONE )
|
||||
FLG_ENTRY(FTPSSL_CCC_PASSIVE )
|
||||
FLG_ENTRY(FTPSSL_CCC_ACTIVE )
|
||||
|
||||
/* parameter for the CURLOPT_FTPSSLAUTH option */
|
||||
FLG_ENTRY(FTPAUTH_DEFAULT )
|
||||
FLG_ENTRY(FTPAUTH_SSL )
|
||||
FLG_ENTRY(FTPAUTH_TLS )
|
||||
|
||||
/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
|
||||
FLG_ENTRY(FTP_CREATE_DIR_NONE )
|
||||
FLG_ENTRY(FTP_CREATE_DIR )
|
||||
FLG_ENTRY(FTP_CREATE_DIR_RETRY )
|
||||
FLG_ENTRY(FTP_CREATE_DIR_LAST )
|
||||
|
||||
/* parameter for the CURLOPT_FTP_FILEMETHOD option */
|
||||
FLG_ENTRY(FTPMETHOD_DEFAULT )
|
||||
FLG_ENTRY(FTPMETHOD_MULTICWD )
|
||||
FLG_ENTRY(FTPMETHOD_NOCWD )
|
||||
FLG_ENTRY(FTPMETHOD_SINGLECWD )
|
||||
|
||||
/* bitmask defines for CURLOPT_HEADEROPT */
|
||||
FLG_ENTRY(HEADER_UNIFIED )
|
||||
FLG_ENTRY(HEADER_SEPARATE )
|
||||
|
||||
/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
|
||||
FLG_ENTRY(PROTO_HTTP )
|
||||
FLG_ENTRY(PROTO_HTTPS )
|
||||
FLG_ENTRY(PROTO_FTP )
|
||||
FLG_ENTRY(PROTO_FTPS )
|
||||
FLG_ENTRY(PROTO_SCP )
|
||||
FLG_ENTRY(PROTO_SFTP )
|
||||
FLG_ENTRY(PROTO_TELNET )
|
||||
FLG_ENTRY(PROTO_LDAP )
|
||||
FLG_ENTRY(PROTO_LDAPS )
|
||||
FLG_ENTRY(PROTO_DICT )
|
||||
FLG_ENTRY(PROTO_FILE )
|
||||
FLG_ENTRY(PROTO_TFTP )
|
||||
FLG_ENTRY(PROTO_IMAP )
|
||||
FLG_ENTRY(PROTO_IMAPS )
|
||||
FLG_ENTRY(PROTO_POP3 )
|
||||
FLG_ENTRY(PROTO_POP3S )
|
||||
FLG_ENTRY(PROTO_SMTP )
|
||||
FLG_ENTRY(PROTO_SMTPS )
|
||||
FLG_ENTRY(PROTO_RTSP )
|
||||
FLG_ENTRY(PROTO_RTMP )
|
||||
FLG_ENTRY(PROTO_RTMPT )
|
||||
FLG_ENTRY(PROTO_RTMPE )
|
||||
FLG_ENTRY(PROTO_RTMPTE )
|
||||
FLG_ENTRY(PROTO_RTMPS )
|
||||
FLG_ENTRY(PROTO_RTMPTS )
|
||||
FLG_ENTRY(PROTO_GOPHER )
|
||||
FLG_ENTRY(PROTO_ALL )
|
16
src/lcurl.c
16
src/lcurl.c
@ -2,6 +2,7 @@
|
||||
#include "lceasy.h"
|
||||
#include "lcerror.h"
|
||||
#include "lchttppost.h"
|
||||
#include "lcutils.h"
|
||||
|
||||
/*export*/
|
||||
#ifdef _WIN32
|
||||
@ -32,7 +33,7 @@ static int lcurl_version(lua_State *L){
|
||||
}
|
||||
|
||||
static int lcurl_version_info(lua_State *L){
|
||||
const char **p;
|
||||
const char * const*p;
|
||||
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
|
||||
|
||||
lua_newtable(L);
|
||||
@ -71,8 +72,6 @@ static int lcurl_version_info(lua_State *L){
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static const struct luaL_Reg lcurl_functions[] = {
|
||||
{"error", lcurl_error_new },
|
||||
{"httppost", lcurl_hpost_new },
|
||||
@ -91,6 +90,15 @@ static const struct luaL_Reg lcurl_functions_safe[] = {
|
||||
{NULL,NULL}
|
||||
};
|
||||
|
||||
static const lcurl_const_t lcurl_flags[] = {
|
||||
|
||||
#define FLG_ENTRY(N) { #N, CURL##N },
|
||||
#include "lcflags.h"
|
||||
#undef FLG_ENTRY
|
||||
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
static volatile int LCURL_INIT = 0;
|
||||
|
||||
static const char* LCURL_REGISTRY = "LCURL Registry";
|
||||
@ -117,6 +125,8 @@ static int luaopen_lcurl_(lua_State *L, const struct luaL_Reg *func){
|
||||
|
||||
lua_remove(L, -2); /* registry */
|
||||
|
||||
lcurl_util_set_const(L, lcurl_flags);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user