gcores ~/apps/Menu branch first commit

This commit is contained in:
cpi
2019-07-16 03:40:14 +00:00
parent 2d75a8d65d
commit 45737f787c
2136 changed files with 214 additions and 17128 deletions

View File

@@ -1,402 +0,0 @@
// 7.63.0
module lib+ {
module curl+ {
module so {
struct struct {
curl_easy_cleanup void;
curl_easy_getinfo void;
curl_easy_init void;
curl_easy_perform void;
curl_easy_setopt void;
curl_easy_strerror void;
curl_global_cleanup void;
curl_global_init void;
curl_slist_append void;
curl_slist_free_all void;
}
var fn struct;
func init() bool {
import rt::c;
return dlsyms(dlopen("libcurl.so.4", RTLD_LAZY), &fn,
"curl_easy_cleanup",
"curl_easy_getinfo",
"curl_easy_init",
"curl_easy_perform",
"curl_easy_setopt",
"curl_easy_strerror",
"curl_global_cleanup",
"curl_global_init",
"curl_slist_append",
"curl_slist_free_all"
);
}
}
}
module curl+ {
enum CURLcode;
enum {
CURLE_OK = 0,
CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
CURLE_FAILED_INIT, /* 2 */
CURLE_URL_MALFORMAT, /* 3 */
CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for
7.17.0, reused in April 2011 for 7.21.5] */
CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
CURLE_COULDNT_RESOLVE_HOST, /* 6 */
CURLE_COULDNT_CONNECT, /* 7 */
CURLE_WEIRD_SERVER_REPLY, /* 8 */
CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
due to lack of access - when login fails
this is not returned. */
CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for
7.15.4, reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server
[was obsoleted in August 2007 for 7.17.0,
reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
CURLE_FTP_CANT_GET_HOST, /* 15 */
CURLE_HTTP2, /* 16 - A problem in the http2 framing layer.
[was obsoleted in August 2007 for 7.17.0,
reused in July 2014 for 7.38.0] */
CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
CURLE_PARTIAL_FILE, /* 18 */
CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
CURLE_OBSOLETE20, /* 20 - NOT USED */
CURLE_QUOTE_ERROR, /* 21 - quote command failure */
CURLE_HTTP_RETURNED_ERROR, /* 22 */
CURLE_WRITE_ERROR, /* 23 */
CURLE_OBSOLETE24, /* 24 - NOT USED */
CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
CURLE_OUT_OF_MEMORY, /* 27 */
/* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
instead of a memory allocation error if CURL_DOES_CONVERSIONS
is defined
*/
CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
CURLE_OBSOLETE29, /* 29 - NOT USED */
CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
CURLE_OBSOLETE32, /* 32 - NOT USED */
CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
CURLE_HTTP_POST_ERROR, /* 34 */
CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
CURLE_FILE_COULDNT_READ_FILE, /* 37 */
CURLE_LDAP_CANNOT_BIND, /* 38 */
CURLE_LDAP_SEARCH_FAILED, /* 39 */
CURLE_OBSOLETE40, /* 40 - NOT USED */
CURLE_FUNCTION_NOT_FOUND, /* 41 - NOT USED starting with 7.53.0 */
CURLE_ABORTED_BY_CALLBACK, /* 42 */
CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
CURLE_OBSOLETE44, /* 44 - NOT USED */
CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
CURLE_OBSOLETE46, /* 46 - NOT USED */
CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */
CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */
CURLE_TELNET_OPTION_SYNTAX, /* 49 - Malformed telnet option */
CURLE_OBSOLETE50, /* 50 - NOT USED */
CURLE_OBSOLETE51, /* 51 - NOT USED */
CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
default */
CURLE_SEND_ERROR, /* 55 - failed sending network data */
CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
CURLE_OBSOLETE57, /* 57 - NOT IN USE */
CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
wasn't verified fine */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
that failed */
CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
accepted and we failed to login */
CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
CURLE_TFTP_PERM, /* 69 - permission problem on server */
CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
CURLE_CONV_FAILED, /* 75 - conversion failed */
CURLE_CONV_REQD, /* 76 - caller must register conversion
callbacks using curl_easy_setopt options
CURLOPT_CONV_FROM_NETWORK_FUNCTION,
CURLOPT_CONV_TO_NETWORK_FUNCTION, and
CURLOPT_CONV_FROM_UTF8_FUNCTION */
CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
or wrong format */
CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
CURLE_SSH, /* 79 - error from the SSH layer, somewhat
generic so the error message will be of
interest when this has happened */
CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
connection */
CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
wait till it's ready and try again (Added
in 7.18.2) */
CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
wrong format (Added in 7.19.0) */
CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
7.19.0) */
CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */
CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the
session will be queued */
CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not
match */
CURLE_SSL_INVALIDCERTSTATUS, /* 91 - invalid certificate status */
CURLE_HTTP2_STREAM, /* 92 - stream error in HTTP/2 framing layer
*/
CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from
inside a callback */
CURL_LAST /* never use! */
}
define {
CURL_GLOBAL_SSL = 1 << 0; /* no purpose since since 7.57.0 */
CURL_GLOBAL_WIN32 = 1 << 1;
CURL_GLOBAL_ALL = CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32;
CURL_GLOBAL_NOTHING = 0;
CURL_GLOBAL_DEFAULT = CURL_GLOBAL_ALL;
CURL_GLOBAL_ACK_EINTR = 1 << 2;
}
enum {
CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
like the library to choose the best possible
for us! */
CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */
CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
Upgrade */
CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
}
enum curl_proxytype; /* this enum was added in 7.10 */
enum {
CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
CONNECT HTTP/1.1 */
CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
HTTP/1.0 */
CURLPROXY_HTTPS = 2, /* added in 7.52.0 */
CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
in 7.10 */
CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
host name rather than the IP address. added
in 7.18.0 */
}
define {
CURLOPTTYPE_LONG = 0;
CURLOPTTYPE_OBJECTPOINT = 10000;
CURLOPTTYPE_STRINGPOINT = 10000;
CURLOPTTYPE_FUNCTIONPOINT = 20000;
CURLOPTTYPE_OFF_T = 30000;
}
enum CURLoption;
// xxx
define {
CURLOPT_WRITEDATA = CURLOPTTYPE_OBJECTPOINT + 1;
CURLOPT_URL = CURLOPTTYPE_STRINGPOINT + 2;
CURLOPT_PROXY = CURLOPTTYPE_STRINGPOINT + 4;
CURLOPT_USERPWD = CURLOPTTYPE_STRINGPOINT + 5;
CURLOPT_PROXYUSERPWD = CURLOPTTYPE_STRINGPOINT + 6;
CURLOPT_READDATA = CURLOPTTYPE_OBJECTPOINT + 9;
CURLOPT_WRITEFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 11;
CURLOPT_READFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 12;
CURLOPT_TIMEOUT = CURLOPTTYPE_LONG + 13;
CURLOPT_INFILESIZE = CURLOPTTYPE_LONG + 14;
CURLOPT_POSTFIELDS = CURLOPTTYPE_OBJECTPOINT + 15;
CURLOPT_HTTPHEADER = CURLOPTTYPE_OBJECTPOINT + 23;
CURLOPT_HEADERDATA = CURLOPTTYPE_OBJECTPOINT + 29;
CURLOPT_COOKIEFILE = CURLOPTTYPE_STRINGPOINT + 31;
CURLOPT_CUSTOMREQUEST = CURLOPTTYPE_STRINGPOINT + 36;
CURLOPT_VERBOSE = CURLOPTTYPE_LONG + 41;
CURLOPT_FAILONERROR = CURLOPTTYPE_LONG + 45;
CURLOPT_UPLOAD = CURLOPTTYPE_LONG + 46;
CURLOPT_POST = CURLOPTTYPE_LONG + 47;
CURLOPT_FOLLOWLOCATION = CURLOPTTYPE_LONG + 52;
CURLOPT_PUT = CURLOPTTYPE_LONG + 54;
CURLOPT_POSTFIELDSIZE = CURLOPTTYPE_LONG + 60;
CURLOPT_HTTPPROXYTUNNEL = CURLOPTTYPE_LONG + 61;
CURLOPT_SSL_VERIFYPEER = CURLOPTTYPE_LONG + 64;
CURLOPT_CONNECTTIMEOUT = CURLOPTTYPE_LONG + 78;
CURLOPT_HEADERFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 79;
CURLOPT_SSL_VERIFYHOST = CURLOPTTYPE_LONG + 81;
CURLOPT_COOKIEJAR = CURLOPTTYPE_STRINGPOINT + 82;
CURLOPT_HTTP_VERSION = CURLOPTTYPE_LONG + 84;
CURLOPT_NOSIGNAL = CURLOPTTYPE_LONG + 99;
CURLOPT_PROXYTYPE = CURLOPTTYPE_LONG + 101;
CURLOPT_COPYPOSTFIELDS = CURLOPTTYPE_OBJECTPOINT + 165;
CURLOPT_USERNAME = CURLOPTTYPE_STRINGPOINT + 173;
CURLOPT_PASSWORD = CURLOPTTYPE_STRINGPOINT + 174;
CURLOPT_PROXYUSERNAME = CURLOPTTYPE_STRINGPOINT + 175;
CURLOPT_PROXYPASSWORD = CURLOPTTYPE_STRINGPOINT + 176;
CURLOPT_MAIL_FROM = CURLOPTTYPE_STRINGPOINT + 186;
CURLOPT_MAIL_RCPT = CURLOPTTYPE_OBJECTPOINT + 187;
}
define {
CURLINFO_STRING = 0x100000;
CURLINFO_LONG = 0x200000;
CURLINFO_DOUBLE = 0x300000;
CURLINFO_SLIST = 0x400000;
CURLINFO_PTR = 0x400000; /* same as SLIST */
CURLINFO_SOCKET = 0x500000;
CURLINFO_OFF_T = 0x600000;
CURLINFO_MASK = 0x0fffff;
CURLINFO_TYPEMASK = 0xf00000;
}
enum CURLINFO;
enum {
CURLINFO_NONE, /* first, never use this */
CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
CURLINFO_SIZE_UPLOAD_T = CURLINFO_OFF_T + 7,
CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
CURLINFO_SIZE_DOWNLOAD_T = CURLINFO_OFF_T + 8,
CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T + 9,
CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
CURLINFO_SPEED_UPLOAD_T = CURLINFO_OFF_T + 10,
CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
CURLINFO_FILETIME = CURLINFO_LONG + 14,
CURLINFO_FILETIME_T = CURLINFO_OFF_T + 14,
CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T + 15,
CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
CURLINFO_CONTENT_LENGTH_UPLOAD_T = CURLINFO_OFF_T + 16,
CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
CURLINFO_PRIVATE = CURLINFO_STRING + 21,
CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
CURLINFO_CERTINFO = CURLINFO_PTR + 34,
CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36,
CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,
CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,
CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,
CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
CURLINFO_TLS_SESSION = CURLINFO_PTR + 43,
CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45,
CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,
CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,
CURLINFO_PROTOCOL = CURLINFO_LONG + 48,
CURLINFO_SCHEME = CURLINFO_STRING + 49,
/* Fill in new entries below here! */
/* Preferably these would be defined conditionally based on the
sizeof curl_off_t being 64-bits */
CURLINFO_TOTAL_TIME_T = CURLINFO_OFF_T + 50,
CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51,
CURLINFO_CONNECT_TIME_T = CURLINFO_OFF_T + 52,
CURLINFO_PRETRANSFER_TIME_T = CURLINFO_OFF_T + 53,
CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54,
CURLINFO_REDIRECT_TIME_T = CURLINFO_OFF_T + 55,
CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56,
CURLINFO_LASTONE = 56
}
}
module curl+ {
inline curl_easy_cleanup(curl+ CURL) {
call1<void>(so::fn.curl_easy_cleanup, curl);
}
inline curl_easy_getinfo(curl+ CURL, info CURLINFO, value word) CURLcode {
return call3<CURLcode>(so::fn.curl_easy_getinfo, curl, info, value);
}
inline curl_easy_init() +CURL {
return call<void>(so::fn.curl_easy_init);
}
inline curl_easy_perform(curl+ CURL) CURLcode {
return call1<CURLcode>(so::fn.curl_easy_perform, curl);
}
inline curl_easy_setopt(curl+ CURL, option CURLoption, value word) CURLcode {
return call3<CURLcode>(so::fn.curl_easy_setopt, curl, option, value);
}
inline curl_easy_strerror(code CURLcode) .char {
return call1<char*>(so::fn.curl_easy_strerror, code);
}
inline curl_global_cleanup() {
call<void>(so::fn.curl_global_cleanup);
}
inline curl_global_init(flags long = CURL_GLOBAL_DEFAULT) CURLcode {
return call1<CURLcode>(so::fn.curl_global_init, flags);
}
inline curl_slist_append(slist+ curl_slist, str. char) +curl_slist {
return call2<void>(so::fn.curl_slist_append, slist, str);
}
inline curl_slist_free_all(slist+ curl_slist) {
call1<void>(so::fn.curl_slist_free_all, slist);
}
}
}

View File

@@ -1,454 +0,0 @@
// 1.12
module lib+ {
module dbus+ {
module so {
struct struct {
dbus_error_init void;
dbus_error_free void;
dbus_error_is_set void;
dbus_bus_add_match void;
dbus_bus_get void;
dbus_bus_get_unique_name void;
dbus_bus_request_name void;
dbus_connection_send void;
dbus_connection_send_with_reply void;
dbus_connection_read_write void;
dbus_connection_pop_message void;
dbus_connection_flush void;
dbus_connection_close void;
dbus_message_new_signal void;
dbus_message_new_method_call void;
dbus_message_new_method_return void;
dbus_message_iter_init void;
dbus_message_iter_init_append void;
dbus_message_iter_next void;
dbus_message_iter_get_basic void;
dbus_message_iter_get_arg_type void;
dbus_message_iter_append_basic void;
dbus_message_get_type void;
dbus_message_is_signal void;
dbus_message_is_method_call void;
dbus_message_unref void;
dbus_pending_call_block void;
dbus_pending_call_steal_reply void;
dbus_pending_call_unref void;
}
var fn struct;
func init() bool {
import rt::c;
return dlsyms(dlopen("libdbus-1.so", RTLD_LAZY), &fn,
"dbus_error_init",
"dbus_error_free",
"dbus_error_is_set",
"dbus_bus_add_match",
"dbus_bus_get",
"dbus_bus_get_unique_name",
"dbus_bus_request_name",
"dbus_connection_send",
"dbus_connection_send_with_reply",
"dbus_connection_read_write",
"dbus_connection_pop_message",
"dbus_connection_flush",
"dbus_connection_close",
"dbus_message_new_signal",
"dbus_message_new_method_call",
"dbus_message_new_method_return",
"dbus_message_iter_init",
"dbus_message_iter_init_append",
"dbus_message_iter_next",
"dbus_message_iter_get_basic",
"dbus_message_iter_get_arg_type",
"dbus_message_iter_append_basic",
"dbus_message_get_type",
"dbus_message_is_signal",
"dbus_message_is_method_call",
"dbus_message_unref",
"dbus_pending_call_block",
"dbus_pending_call_steal_reply",
"dbus_pending_call_unref"
);
}
}
}
module dbus+ {
/**
* Well-known bus types. See dbus_bus_get().
*/
enum DBusBusType;
enum {
DBUS_BUS_SESSION, /**< The login session bus */
DBUS_BUS_SYSTEM, /**< The systemwide bus */
DBUS_BUS_STARTER /**< The bus that started us, if any */
}
/**
* Results that a message handler can return.
*/
enum DBusHandlerResult;
enum {
DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */
DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */
DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */
}
/* Owner flags */
define {
DBUS_NAME_FLAG_ALLOW_REPLACEMENT = 0x1; /**< Allow another service to become the primary owner if requested */
DBUS_NAME_FLAG_REPLACE_EXISTING = 0x2; /**< Request to replace the current primary owner */
DBUS_NAME_FLAG_DO_NOT_QUEUE = 0x4; /**< If we can not become the primary owner do not place us in the queue */
}
/* Replies to request for a name */
define {
DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER = 1; /**< Service has become the primary owner of the requested name */
DBUS_REQUEST_NAME_REPLY_IN_QUEUE = 2; /**< Service could not become the primary owner and has been placed in the queue */
DBUS_REQUEST_NAME_REPLY_EXISTS = 3; /**< Service is already in the queue */
DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER = 4; /**< Service is already the primary owner */
}
/* Replies to releasing a name */
define {
DBUS_RELEASE_NAME_REPLY_RELEASED = 1; /**< Service was released from the given name */
DBUS_RELEASE_NAME_REPLY_NON_EXISTENT = 2; /**< The given name does not exist on the bus */
DBUS_RELEASE_NAME_REPLY_NOT_OWNER = 3; /**< Service is not an owner of the given name */
}
/* Replies to service starts */
define {
DBUS_START_REPLY_SUCCESS = 1; /**< Service was auto started */
DBUS_START_REPLY_ALREADY_RUNNING = 2; /**< Service was already running */
}
typedef dbus_int64_t int64;
typedef dbus_uint64_t unsigned int64;
typedef dbus_int32_t int32;
typedef dbus_uint32_t unsigned int32;
typedef dbus_int16_t int16;
typedef dbus_uint16_t unsigned int16;
typedef dbus_unichar_t dbus_uint32_t;
typedef dbus_bool_t dbus_uint32_t;
/**
* An 8-byte struct you could use to access int64 without having
* int64 support. Use #dbus_int64_t or #dbus_uint64_t instead.
*/
struct DBus8ByteStruct {
first32 dbus_uint32_t; /**< first 32 bits in the 8 bytes (beware endian issues) */
second32 dbus_uint32_t; /**< second 32 bits in the 8 bytes (beware endian issues) */
}
/**
* A simple value union that lets you access bytes as if they
* were various types; useful when dealing with basic types via
* void pointers and varargs.
*
* This union also contains a pointer member (which can be used
* to retrieve a string from dbus_message_iter_get_basic(), for
* instance), so on future platforms it could conceivably be larger
* than 8 bytes.
*/
union DBusBasicValue {
bytes(8) unsigned char; /**< as 8 individual bytes */
i16 dbus_int16_t; /**< as int16 */
u16 dbus_uint16_t; /**< as int16 */
i32 dbus_int32_t; /**< as int32 */
u32 dbus_uint32_t; /**< as int32 */
bool_val dbus_bool_t; /**< as boolean */
i64 dbus_int64_t; /**< as int64 */
u64 dbus_uint64_t; /**< as int64 */
eight DBus8ByteStruct; /**< as 8-byte struct */
dbl double; /**< as double */
byt unsigned char; /**< as byte */
str. char; /**< as char* (string, object path or signature) */
fd int; /**< as Unix file descriptor */
}
/**
* Object representing an exception.
*/
struct DBusError {
name. char; /**< public error name field */
message. char; /**< public error message field */
dummy unsigned int; /**< placeholder */
padding1 void; /**< placeholder */
}
/* documented in dbus-watch.c */
typedef DBusWatch void;
/* documented in dbus-timeout.c */
typedef DBusTimeout void;
/** Opaque type representing preallocated resources so a message can be sent without further memory allocation. */
typedef DBusPreallocatedSend void;
/** Opaque type representing a method call that has not yet received a reply. */
typedef DBusPendingCall void;
/** Opaque type representing a connection to a remote application and associated incoming/outgoing message queues. */
typedef DBusConnection void;
typedef DBusMessage void;
/**
* DBusMessageIter struct; contains no public fields.
*/
struct DBusMessageIter {
dummy1 void; /**< Don't use this */
dummy2 void; /**< Don't use this */
dummy3 dbus_uint32_t; /**< Don't use this */
dummy4 int; /**< Don't use this */
dummy5 int; /**< Don't use this */
dummy6 int; /**< Don't use this */
dummy7 int; /**< Don't use this */
dummy8 int; /**< Don't use this */
dummy9 int; /**< Don't use this */
dummy10 int; /**< Don't use this */
dummy11 int; /**< Don't use this */
pad1 int; /**< Don't use this */
pad2 void; /**< Don't use this */
pad3 void; /**< Don't use this */
}
/* Message byte order */
define {
DBUS_LITTLE_ENDIAN = 'l'; /**< Code marking LSB-first byte order in the wire protocol. */
DBUS_BIG_ENDIAN = 'B'; /**< Code marking MSB-first byte order in the wire protocol. */
}
define {
/** Type code that is never equal to a legitimate type code */
DBUS_TYPE_INVALID = int('\0');
/** #DBUS_TYPE_INVALID as a string literal instead of a int literal */
DBUS_TYPE_INVALID_AS_STRING = "\0";
/* Primitive types */
/** Type code marking an 8-bit unsigned integer */
DBUS_TYPE_BYTE = int('y');
/** #DBUS_TYPE_BYTE as a string literal instead of a int literal */
DBUS_TYPE_BYTE_AS_STRING = "y";
/** Type code marking a boolean */
DBUS_TYPE_BOOLEAN = int('b');
/** #DBUS_TYPE_BOOLEAN as a string literal instead of a int literal */
DBUS_TYPE_BOOLEAN_AS_STRING = "b";
/** Type code marking a 16-bit signed integer */
DBUS_TYPE_INT16 = int('n');
/** #DBUS_TYPE_INT16 as a string literal instead of a int literal */
DBUS_TYPE_INT16_AS_STRING = "n";
/** Type code marking a 16-bit unsigned integer */
DBUS_TYPE_UINT16 = int('q');
/** #DBUS_TYPE_UINT16 as a string literal instead of a int literal */
DBUS_TYPE_UINT16_AS_STRING = "q";
/** Type code marking a 32-bit signed integer */
DBUS_TYPE_INT32 = int('i');
/** #DBUS_TYPE_INT32 as a string literal instead of a int literal */
DBUS_TYPE_INT32_AS_STRING = "i";
/** Type code marking a 32-bit unsigned integer */
DBUS_TYPE_UINT32 = int('u');
/** #DBUS_TYPE_UINT32 as a string literal instead of a int literal */
DBUS_TYPE_UINT32_AS_STRING = "u";
/** Type code marking a 64-bit signed integer */
DBUS_TYPE_INT64 = int('x');
/** #DBUS_TYPE_INT64 as a string literal instead of a int literal */
DBUS_TYPE_INT64_AS_STRING = "x";
/** Type code marking a 64-bit unsigned integer */
DBUS_TYPE_UINT64 = int('t');
/** #DBUS_TYPE_UINT64 as a string literal instead of a int literal */
DBUS_TYPE_UINT64_AS_STRING = "t";
/** Type code marking an 8-byte double in IEEE 754 format */
DBUS_TYPE_DOUBLE = int('d');
/** #DBUS_TYPE_DOUBLE as a string literal instead of a int literal */
DBUS_TYPE_DOUBLE_AS_STRING = "d";
/** Type code marking a UTF-8 encoded, nul-terminated Unicode string */
DBUS_TYPE_STRING = int('s');
/** #DBUS_TYPE_STRING as a string literal instead of a int literal */
DBUS_TYPE_STRING_AS_STRING = "s";
/** Type code marking a D-Bus object path */
DBUS_TYPE_OBJECT_PATH = int('o');
/** #DBUS_TYPE_OBJECT_PATH as a string literal instead of a int literal */
DBUS_TYPE_OBJECT_PATH_AS_STRING = "o";
/** Type code marking a D-Bus type signature */
DBUS_TYPE_SIGNATURE = int('g');
/** #DBUS_TYPE_SIGNATURE as a string literal instead of a int literal */
DBUS_TYPE_SIGNATURE_AS_STRING = "g";
/** Type code marking a unix file descriptor */
DBUS_TYPE_UNIX_FD = int('h');
/** #DBUS_TYPE_UNIX_FD as a string literal instead of a int literal */
DBUS_TYPE_UNIX_FD_AS_STRING = "h";
/* Compound types */
/** Type code marking a D-Bus array type */
DBUS_TYPE_ARRAY = int('a');
/** #DBUS_TYPE_ARRAY as a string literal instead of a int literal */
DBUS_TYPE_ARRAY_AS_STRING = "a";
/** Type code marking a D-Bus variant type */
DBUS_TYPE_VARIANT = int('v');
/** #DBUS_TYPE_VARIANT as a string literal instead of a int literal */
DBUS_TYPE_VARIANT_AS_STRING = "v";
/** STRUCT and DICT_ENTRY are sort of special since their codes can't
* appear in a type string, instead
* DBUS_STRUCT_BEGIN_CHAR/DBUS_DICT_ENTRY_BEGIN_CHAR have to appear
*/
/** Type code used to represent a struct; however, this type code does not appear
* in type signatures, instead #DBUS_STRUCT_BEGIN_CHAR and #DBUS_STRUCT_END_CHAR will
* appear in a signature.
*/
DBUS_TYPE_STRUCT = int('r');
/** #DBUS_TYPE_STRUCT as a string literal instead of a int literal */
DBUS_TYPE_STRUCT_AS_STRING = "r";
/** Type code used to represent a dict entry; however, this type code does not appear
* in type signatures, instead #DBUS_DICT_ENTRY_BEGIN_CHAR and #DBUS_DICT_ENTRY_END_CHAR will
* appear in a signature.
*/
DBUS_TYPE_DICT_ENTRY = int('e');
/** #DBUS_TYPE_DICT_ENTRY as a string literal instead of a int literal */
DBUS_TYPE_DICT_ENTRY_AS_STRING = "e";
/** Does not include #DBUS_TYPE_INVALID, #DBUS_STRUCT_BEGIN_CHAR, #DBUS_STRUCT_END_CHAR,
* #DBUS_DICT_ENTRY_BEGIN_CHAR, or #DBUS_DICT_ENTRY_END_CHAR - i.e. it is the number of
* valid types, not the number of distinct characters that may appear in a type signature.
*/
DBUS_NUMBER_OF_TYPES = 16;
}
define {
/** This value is never a valid message type, see dbus_message_get_type() */
DBUS_MESSAGE_TYPE_INVALID = 0;
/** Message type of a method call message, see dbus_message_get_type() */
DBUS_MESSAGE_TYPE_METHOD_CALL = 1;
/** Message type of a method return message, see dbus_message_get_type() */
DBUS_MESSAGE_TYPE_METHOD_RETURN = 2;
/** Message type of an error reply message, see dbus_message_get_type() */
DBUS_MESSAGE_TYPE_ERROR = 3;
/** Message type of a signal message, see dbus_message_get_type() */
DBUS_MESSAGE_TYPE_SIGNAL = 4;
DBUS_NUM_MESSAGE_TYPES = 5;
}
}
module dbus+ {
inline dbus_error_init(error. DBusError) {
call1<void>(so::fn.dbus_error_init, error);
}
inline dbus_error_free(error. DBusError) {
call1<void>(so::fn.dbus_error_free, error);
}
inline dbus_error_is_set(error. DBusError) dbus_bool_t {
return call1<dbus_bool_t>(so::fn.dbus_error_is_set, error);
}
inline dbus_bus_add_match(connection. DBusConnection, rule. char, error. DBusError) {
call3<void>(so::fn.dbus_bus_add_match, connection, rule, error);
}
inline dbus_bus_get(type DBusBusType, error. DBusError) .DBusConnection {
return call2<void>(so::fn.dbus_bus_get, type, error);
}
inline dbus_bus_get_unique_name(connection. DBusConnection) .char {
return call1<char*>(so::fn.dbus_bus_get_unique_name, connection);
}
inline dbus_bus_request_name(connection. DBusConnection, name. char, flags unsigned int, error. DBusError) int {
return call4<int>(so::fn.dbus_bus_request_name, connection, name, flags, error);
}
inline dbus_connection_send(connection. DBusConnection, message. DBusMessage, client_serial. dbus_uint32_t) dbus_bool_t {
return call3<dbus_bool_t>(so::fn.dbus_connection_send, connection, message, client_serial);
}
inline dbus_connection_send_with_reply(connection. DBusConnection, message. DBusMessage, pending_return++ DBusPendingCall, timeout_milliseconds int) dbus_bool_t {
return call4<dbus_bool_t>(so::fn.dbus_connection_send_with_reply, connection, message, pending_return, timeout_milliseconds);
}
inline dbus_connection_read_write(connection. DBusConnection, timeout_milliseconds int) dbus_bool_t {
return call2<dbus_bool_t>(so::fn.dbus_connection_read_write, connection, timeout_milliseconds);
}
inline dbus_connection_pop_message(connection. DBusConnection) .DBusMessage {
return call1<void>(so::fn.dbus_connection_pop_message, connection);
}
inline dbus_connection_flush(connection. DBusConnection) {
call1<void>(so::fn.dbus_connection_flush, connection);
}
inline dbus_connection_close(connection. DBusConnection) {
call1<void>(so::fn.dbus_connection_close, connection);
}
inline dbus_message_new_signal(path. char, iface. char, name. char) .DBusMessage {
return call3<void>(so::fn.dbus_message_new_signal, path, iface, name);
}
inline dbus_message_new_method_call(bus_name. char, path. char, iface. char, method. char) .DBusMessage {
return call4<void>(so::fn.dbus_message_new_method_call, bus_name, path, iface, method);
}
inline dbus_message_new_method_return(method_call. DBusMessage) .DBusMessage {
return call1<void>(so::fn.dbus_message_new_method_return, method_call);
}
inline dbus_message_iter_init(message. DBusMessage, iter. DBusMessageIter) dbus_bool_t {
return call2<dbus_bool_t>(so::fn.dbus_message_iter_init, message, iter);
}
inline dbus_message_iter_init_append(message. DBusMessage, iter. DBusMessageIter) {
call2<void>(so::fn.dbus_message_iter_init_append, message, iter);
}
inline dbus_message_iter_next(iter. DBusMessageIter) dbus_bool_t {
return call1<dbus_bool_t>(so::fn.dbus_message_iter_next, iter);
}
inline dbus_message_iter_get_basic(iter. DBusMessageIter, value void) {
call2<void>(so::fn.dbus_message_iter_get_basic, iter, value);
}
inline dbus_message_iter_get_arg_type(iter. DBusMessageIter) int {
return call1<int>(so::fn.dbus_message_iter_get_arg_type, iter);
}
inline dbus_message_iter_append_basic(iter. DBusMessageIter, type int, value void) dbus_bool_t {
return call3<dbus_bool_t>(so::fn.dbus_message_iter_append_basic, iter, type, value);
}
inline dbus_message_get_type(message. DBusMessage) int {
return call1<int>(so::fn.dbus_message_get_type, message);
}
inline dbus_message_is_signal(message. DBusMessage, iface. char, signal_name. char) dbus_bool_t {
return call3<dbus_bool_t>(so::fn.dbus_message_is_signal, message, iface, signal_name);
}
inline dbus_message_is_method_call(message. DBusMessage, iface. char, method. char) dbus_bool_t {
return call3<dbus_bool_t>(so::fn.dbus_message_is_method_call, message, iface, method);
}
inline dbus_message_unref(message. DBusMessage) {
call1<void>(so::fn.dbus_message_unref, message);
}
inline dbus_pending_call_block(pending. DBusPendingCall) {
call1<void>(so::fn.dbus_pending_call_block, pending);
}
inline dbus_pending_call_steal_reply(pending. DBusPendingCall) .DBusMessage {
return call1<void>(so::fn.dbus_pending_call_steal_reply, pending);
}
inline dbus_pending_call_unref(pending. DBusPendingCall) {
call1<void>(so::fn.dbus_pending_call_unref, pending);
}
}
}

View File

@@ -1,615 +0,0 @@
// 2.12
module lib+ {
module jansson+ {
module so {
struct struct {
json_array void;
json_array_append_new void;
json_array_clear void;
json_array_extend void;
json_array_get void;
json_array_insert_new void;
json_array_remove void;
json_array_set_new void;
json_array_size void;
json_copy void;
json_deep_copy void;
json_delete void;
json_dump_file void;
json_dumpf void;
json_dumps void;
json_equal void;
json_false void;
json_integer void;
json_integer_set void;
json_integer_value void;
json_load_file void;
json_loadb void;
json_loadf void;
json_loads void;
json_null void;
json_number_value void;
json_object void;
json_object_clear void;
json_object_del void;
json_object_get void;
json_object_iter void;
json_object_iter_at void;
json_object_iter_key void;
json_object_iter_next void;
json_object_iter_set_new void;
json_object_iter_value void;
json_object_key_to_iter void;
json_object_seed void;
json_object_set_new void;
json_object_set_new_nocheck void;
json_object_size void;
json_object_update void;
json_object_update_existing void;
json_object_update_missing void;
json_real void;
json_real_set void;
json_real_value void;
json_string void;
json_string_length void;
json_string_nocheck void;
json_string_set void;
json_string_set_nocheck void;
json_string_setn void;
json_string_setn_nocheck void;
json_string_value void;
json_stringn void;
json_stringn_nocheck void;
json_true void;
json_vpack_ex void;
json_vunpack_ex void;
}
var fn struct;
func init() bool {
import rt::c;
return dlsyms(dlopen("libjansson.so", RTLD_LAZY), &fn,
"json_array",
"json_array_append_new",
"json_array_clear",
"json_array_extend",
"json_array_get",
"json_array_insert_new",
"json_array_remove",
"json_array_set_new",
"json_array_size",
"json_copy",
"json_deep_copy",
"json_delete",
"json_dump_file",
"json_dumpf",
"json_dumps",
"json_equal",
"json_false",
"json_integer",
"json_integer_set",
"json_integer_value",
"json_load_file",
"json_loadb",
"json_loadf",
"json_loads",
"json_null",
"json_number_value",
"json_object",
"json_object_clear",
"json_object_del",
"json_object_get",
"json_object_iter",
"json_object_iter_at",
"json_object_iter_key",
"json_object_iter_next",
"json_object_iter_set_new",
"json_object_iter_value",
"json_object_key_to_iter",
"json_object_seed",
"json_object_set_new",
"json_object_set_new_nocheck",
"json_object_size",
"json_object_update",
"json_object_update_existing",
"json_object_update_missing",
"json_real",
"json_real_set",
"json_real_value",
"json_string",
"json_string_length",
"json_string_nocheck",
"json_string_set",
"json_string_set_nocheck",
"json_string_setn",
"json_string_setn_nocheck",
"json_string_value",
"json_stringn",
"json_stringn_nocheck",
"json_true",
"json_vpack_ex",
"json_vunpack_ex"
);
}
}
}
module jansson+ {
private import rt::c;
typedef json_int_t dlong;
// xxx
enum json_type {
object,
array,
string,
integer,
real,
true,
false,
null
}
struct json_t {
type json_type;
refcount size_t;
}
inline json_typeof(json. json_t) json_type {
return json.type;
}
inline json_is_object(json. json_t) bool {
if json ~= null and json_typeof(json) == json_type.object;
return true;
return false;
}
inline json_is_array(json. json_t) bool {
if json ~= null and json_typeof(json) == json_type.array;
return true;
return false;
}
inline json_is_string(json. json_t) bool {
if json ~= null and json_typeof(json) == json_type.string;
return true;
return false;
}
inline json_is_integer(json. json_t) bool {
if json ~= null and json_typeof(json) == json_type.integer;
return true;
return false;
}
inline json_is_real(json. json_t) bool {
if json ~= null and json_typeof(json) == json_type.real;
return true;
return false;
}
inline json_is_number(json. json_t) bool {
if json_is_integer(json) or json_is_real(json);
return true;
return false;
}
inline json_is_true(json. json_t) bool {
if json ~= null and json_typeof(json) == json_type.true;
return true;
return false;
}
inline json_is_false(json. json_t) bool {
if json ~= null and json_typeof(json) == json_type.false;
return true;
return false;
}
inline json_boolean_value(json. json_t) bool {
return json_is_true(json);
}
inline json_is_boolean(json. json_t) bool {
if json_is_true(json) or json_is_false(json);
return true;
return false;
}
inline json_is_null(json. json_t) bool {
if json ~= null and json_typeof(json) == json_type.null;
return true;
return false;
}
inline json_object() .json_t {
return call<void>(so::fn.json_object);
}
inline json_array() .json_t {
return call<void>(so::fn.json_array);
}
inline json_string(value. char) .json_t {
return call1<void>(so::fn.json_string, value);
}
inline json_stringn(value. char, len size_t) .json_t {
return call2<void>(so::fn.json_stringn, value, len);
}
inline json_string_nocheck(value. char) .json_t {
return call1<void>(so::fn.json_string_nocheck, value);
}
inline json_stringn_nocheck(value. char, len size_t) .json_t {
return call2<void>(so::fn.json_stringn_nocheck, value, len);
}
inline json_integer(value json_int_t) .json_t {
return call1<void>(so::fn.json_integer, value);
}
inline json_real(value double) .json_t {
return call_d<void>(so::fn.json_real, value);
}
inline json_true() .json_t {
return call<void>(so::fn.json_true);
}
inline json_false() .json_t {
return call<void>(so::fn.json_false);
}
inline json_boolean(value bool) .json_t {
if value {
return json_true();
else
return json_false();
}
}
inline json_null() .json_t {
return call<void>(so::fn.json_null);
}
inline json_incref(json. json_t) .json_t {
if json ~= null and json.refcount ~= -1;
json.refcount++;
return json;
}
inline json_delete(json. json_t) {
call1<void>(so::fn.json_delete, json);
}
inline json_decref(json. json_t) {
if json ~= null and json.refcount ~= -1 and --json.refcount == 0;
json_delete(json);
}
define {
JSON_ERROR_TEXT_LENGTH = 160;
JSON_ERROR_SOURCE_LENGTH = 80;
}
struct json_error_t {
line int;
column int;
position int;
source(JSON_ERROR_SOURCE_LENGTH) char;
text(JSON_ERROR_TEXT_LENGTH) char;
}
inline json_object_seed(seed size_t) {
call1<void>(so::fn.json_object_seed, seed);
}
inline json_object_size(object. json_t) size_t {
return call1<size_t>(so::fn.json_object_size, object);
}
inline json_object_get(object. json_t, key. char) .json_t {
return call2<void>(so::fn.json_object_get, object, key);
}
func json_object_gets(object. json_t, ...) .json_t {
forvar ap. char* = va_start(object), size uint32 = va_size(object); size; {
if (object = json_object_get(object, .ap)) == null;
return null;
va_nexts<char*>(ap, size);
}
return object;
}
inline json_object_set_new(object. json_t, key. char, value. json_t) int {
return call3<int>(so::fn.json_object_set_new, object, key, value);
}
inline json_object_set_new_nocheck(object. json_t, key. char, value. json_t) int {
return call3<int>(so::fn.json_object_set_new_nocheck, object, key, value);
}
inline json_object_del(object. json_t, key. char) int {
return call2<int>(so::fn.json_object_del, object, key);
}
inline json_object_clear(object. json_t) int {
return call1<int>(so::fn.json_object_clear, object);
}
inline json_object_update(object. json_t, other. json_t) int {
return call2<int>(so::fn.json_object_update, object, other);
}
inline json_object_update_existing(object. json_t, other. json_t) int {
return call2<int>(so::fn.json_object_update_existing, object, other);
}
inline json_object_update_missing(object. json_t, other. json_t) int {
return call2<int>(so::fn.json_object_update_missing, object, other);
}
inline json_object_iter(object. json_t) void {
return call1<void>(so::fn.json_object_iter, object);
}
inline json_object_iter_at(object. json_t, key. char) void {
return call2<void>(so::fn.json_object_iter_at, object, key);
}
inline json_object_key_to_iter(key. char) void {
return call1<void>(so::fn.json_object_key_to_iter, key);
}
inline json_object_iter_next(object. json_t, iter void) void {
return call2<void>(so::fn.json_object_iter_next, object, iter);
}
inline json_object_iter_key(iter void) .char {
return call1<char*>(so::fn.json_object_iter_key, iter);
}
inline json_object_iter_value(iter void) .json_t {
return call1<void>(so::fn.json_object_iter_value, iter);
}
inline json_object_iter_set_new(object. json_t, iter void, value. json_t) int {
return call3<int>(so::fn.json_object_iter_set_new, object, iter, value);
}
// xxx
func json_object_foreach(object. json_t, callback void) {
proto foreach_callback(object. json_t, key. char, value. json_t) bool;
forvar key. char = json_object_iter_key(json_object_iter(object)), value. json_t;
key ~= null and (value = json_object_iter_value(json_object_key_to_iter(key)));
key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key))) {
if !foreach_callback[callback](object, key, value);
return;
}
}
// xxx
func json_array_foreach(array. json_t, callback void) {
proto foreach_callback(array. json_t, index size_t, value. json_t) bool;
forvar index size_t = 0, value. json_t; index < json_array_size(array) and (value = json_array_get(array, index)); index++ {
if !foreach_callback[callback](array, index, value);
return;
}
}
inline json_object_set(object. json_t, key. char, value. json_t) int {
return json_object_set_new(object, key, json_incref(value));
}
inline json_object_set_nocheck(object. json_t, key. char, value. json_t) int {
return json_object_set_new_nocheck(object, key, json_incref(value));
}
inline json_object_iter_set(object. json_t, iter void, value. json_t) int {
return json_object_iter_set_new(object, iter, json_incref(value));
}
inline json_array_size(array. json_t) size_t {
return call1<size_t>(so::fn.json_array_size, array);
}
inline json_array_get(array. json_t, index size_t) .json_t {
return call2<void>(so::fn.json_array_get, array, index);
}
inline json_array_set_new(array. json_t, index size_t, value. json_t) int {
return call3<int>(so::fn.json_array_set_new, array, index, value);
}
inline json_array_append_new(array. json_t, value. json_t) int {
return call2<int>(so::fn.json_array_append_new, array, value);
}
inline json_array_insert_new(array. json_t, index size_t, value. json_t) int {
return call3<int>(so::fn.json_array_insert_new, array, index, value);
}
inline json_array_remove(array. json_t, index size_t) int {
return call2<int>(so::fn.json_array_remove, array, index);
}
inline json_array_clear(array. json_t) int {
return call1<int>(so::fn.json_array_clear, array);
}
inline json_array_extend(array. json_t, other. json_t) int {
return call2<int>(so::fn.json_array_extend, array, other);
}
inline json_array_set(array. json_t, index size_t, value. json_t) int {
return json_array_set_new(array, index, json_incref(value));
}
inline json_array_append(array. json_t, value. json_t) int {
return json_array_append_new(array, json_incref(value));
}
inline json_array_insert(array. json_t, index size_t, value. json_t) int {
return json_array_insert_new(array, index, json_incref(value));
}
inline json_string_value(string. json_t) .char {
return call1<char*>(so::fn.json_string_value, string);
}
inline json_string_length(string. json_t) size_t {
return call1<size_t>(so::fn.json_string_length, string);
}
inline json_integer_value(integer. json_t) json_int_t {
return call1<json_int_t>(so::fn.json_integer_value, integer);
}
inline json_real_value(real. json_t) double {
return callf_r<double>(so::fn.json_real_value, real);
}
inline json_number_value(json. json_t) double {
return callf_r<double>(so::fn.json_number_value, json);
}
inline json_string_set(string. json_t, value. char) int {
return call2<int>(so::fn.json_string_set, string, value);
}
inline json_string_setn(string. json_t, value. char, len size_t) int {
return call3<int>(so::fn.json_string_setn, string, value, len);
}
inline json_string_set_nocheck(string. json_t, value. char) int {
return call2<int>(so::fn.json_string_set_nocheck, string, value);
}
inline json_string_setn_nocheck(string. json_t, value. char, len size_t) int {
return call3<int>(so::fn.json_string_setn_nocheck, string, value, len);
}
inline json_integer_set(integer. json_t, value json_int_t) int {
return call2<int>(so::fn.json_integer_set, integer, value);
}
inline json_real_set(real. json_t, value double) int {
return call_rd<int>(so::fn.json_real_set, real, value);
}
inline json_vpack_ex(error. json_error_t, flags size_t, fmt. char, ap+ va_list) .json_t {
return call4<void>(so::fn.json_vpack_ex, error, flags, fmt, ap);
}
func json_pack_ex(error. json_error_t, flags size_t, fmt. char, ...) .json_t {
return json_vpack_ex(error, flags, fmt, va_start(error));
}
func json_pack(fmt. char, ...) .json_t {
return json_vpack_ex(null, 0, fmt, va_start(fmt));
}
func json_packs(flags size_t, fmt. char, ...) .char {
var json. json_t = json_vpack_ex(null, 0, fmt, va_start(flags));
if json == null;
return null;
func = json_dumps(json, flags);
json_decref(json);
}
define {
JSON_VALIDATE_ONLY = 0x1;
JSON_STRICT = 0x2;
}
func json_unpack_ex(root. json_t, error. json_error_t, flags size_t, fmt. char, ...) int {
return call5<int>(so::fn.json_vunpack_ex, root, error, flags, fmt, va_start(root));
}
func json_unpack(root. json_t, fmt. char, ...) int {
return call3<int>(so::fn.json_vunpack_ex, root, fmt, va_start(root));
}
inline json_equal(value1. json_t, value2. json_t) int {
return call2<int>(so::fn.json_equal, value1, value2);
}
inline json_copy(value. json_t) .json_t {
return call1<void>(so::fn.json_copy, value);
}
inline json_deep_copy(value. json_t) .json_t {
return call1<void>(so::fn.json_deep_copy, value);
}
define {
JSON_REJECT_DUPLICATES = 0x1;
JSON_DISABLE_EOF_CHECK = 0x2;
JSON_DECODE_ANY = 0x4;
JSON_DECODE_INT_AS_REAL = 0x8;
JSON_ALLOW_NUL = 0x10;
}
inline json_loads(input. char, flags size_t = 0, error. json_error_t = null) .json_t {
return call3<void>(so::fn.json_loads, input, flags, error);
}
inline json_loadb(buffer. char, buflen size_t, flags size_t = 0, error. json_error_t = null) .json_t {
return call4<void>(so::fn.json_loadb, buffer, buflen, flags, error);
}
inline json_loadf(input void, flags size_t = 0, error. json_error_t = null) .json_t {
return call3<void>(so::fn.json_loadf, input, flags, error);
}
inline json_load_file(path. char, flags size_t = 0, error. json_error_t = null) .json_t {
return call3<void>(so::fn.json_load_file, path, flags, error);
}
define {
JSON_MAX_INDENT = 0x1F;
JSON_COMPACT = 0x20;
JSON_ENSURE_ASCII = 0x40;
JSON_SORT_KEYS = 0x80;
JSON_PRESERVE_ORDER = 0x100;
JSON_ENCODE_ANY = 0x200;
JSON_ESCAPE_SLASH = 0x400;
JSON_EMBED = 0x10000;
}
inline JSON_INDENT(n size_t) size_t {
return n & JSON_MAX_INDENT;
}
inline JSON_REAL_PRECISION(n size_t) size_t {
return (n & 0x1F) << 11;
}
inline json_dumps(json. json_t, flags size_t = 0) .char {
return call2<char*>(so::fn.json_dumps, json, flags);
}
inline json_dumpf(json. json_t, output+ FILE, flags size_t = 0) int {
return call3<int>(so::fn.json_dumpf, json, output, flags);
}
inline json_dump_file(json. json_t, path. char, flags size_t = 0) int {
return call3<int>(so::fn.json_dump_file, json, path, flags);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,73 +0,0 @@
// 2.0.4.0
module lib+ {
module sdl2_image+ {
module so {
struct struct {
IMG_Init void;
IMG_Quit void;
IMG_Load void;
IMG_LoadTexture void;
IMG_SavePNG void;
}
var fn struct;
func init() bool {
import rt::c;
return dlsyms(dlopen("libSDL2_image-2.0.so.0", RTLD_LAZY), &fn,
"IMG_Init",
"IMG_Quit",
"IMG_Load",
"IMG_LoadTexture",
"IMG_SavePNG"
);
}
}
}
module sdl2_image+ {
import sdl2;
enum IMG_InitFlags;
enum {
IMG_INIT_JPG = 0x00000001,
IMG_INIT_PNG = 0x00000002,
IMG_INIT_TIF = 0x00000004,
IMG_INIT_WEBP = 0x00000008
}
}
module sdl2_image+ {
inline IMG_Init(flags int) int {
return call1<int>(so::fn.IMG_Init, flags);
}
inline IMG_Quit() {
call<void>(so::fn.IMG_Quit);
}
inline IMG_Load(file. char) .SDL_Surface {
return call1<void>(so::fn.IMG_Load, file);
}
inline IMG_LoadTexture(renderer+ SDL_Renderer, file. char) +SDL_Texture {
return call2<void>(so::fn.IMG_LoadTexture, renderer, file);
}
inline IMG_SavePNG(surface. SDL_Surface, file. char) int {
return call2<int>(so::fn.IMG_SavePNG, surface, file);
}
}
}

View File

@@ -1,441 +0,0 @@
// 2.0.4.0
module lib+ {
module sdl2_mixer+ {
module so {
struct struct {
Mix_Init void;
Mix_Quit void;
Mix_OpenAudio void;
Mix_AllocateChannels void;
Mix_QuerySpec void;
Mix_LoadWAV_RW void;
Mix_LoadMUS void;
Mix_FreeChunk void;
Mix_FreeMusic void;
Mix_GetNumChunkDecoders void;
Mix_GetChunkDecoder void;
Mix_GetNumMusicDecoders void;
Mix_GetMusicDecoder void;
Mix_GetMusicType void;
Mix_SetPanning void;
Mix_SetPosition void;
Mix_SetDistance void;
Mix_SetReverseStereo void;
Mix_ReserveChannels void;
Mix_GroupChannel void;
Mix_GroupChannels void;
Mix_GroupAvailable void;
Mix_GroupCount void;
Mix_GroupOldest void;
Mix_GroupNewer void;
Mix_PlayChannelTimed void;
Mix_PlayMusic void;
Mix_FadeInMusic void;
Mix_FadeInMusicPos void;
Mix_FadeInChannelTimed void;
Mix_Volume void;
Mix_VolumeChunk void;
Mix_VolumeMusic void;
Mix_HaltChannel void;
Mix_HaltGroup void;
Mix_HaltMusic void;
Mix_ExpireChannel void;
Mix_FadeOutChannel void;
Mix_FadeOutGroup void;
Mix_FadeOutMusic void;
Mix_FadingMusic void;
Mix_FadingChannel void;
Mix_Pause void;
Mix_Resume void;
Mix_Paused void;
Mix_PauseMusic void;
Mix_ResumeMusic void;
Mix_RewindMusic void;
Mix_PausedMusic void;
Mix_SetMusicPosition void;
Mix_Playing void;
Mix_PlayingMusic void;
Mix_SetMusicCMD void;
Mix_SetSynchroValue void;
Mix_GetSynchroValue void;
Mix_GetChunk void;
Mix_CloseAudio void;
}
var fn struct;
func init() bool {
import rt::c;
return dlsyms(dlopen("libSDL2_mixer-2.0.so.0", RTLD_LAZY), &fn,
"Mix_Init",
"Mix_Quit",
"Mix_OpenAudio",
"Mix_AllocateChannels",
"Mix_QuerySpec",
"Mix_LoadWAV_RW",
"Mix_LoadMUS",
"Mix_FreeChunk",
"Mix_FreeMusic",
"Mix_GetNumChunkDecoders",
"Mix_GetChunkDecoder",
"Mix_GetNumMusicDecoders",
"Mix_GetMusicDecoder",
"Mix_GetMusicType",
"Mix_SetPanning",
"Mix_SetPosition",
"Mix_SetDistance",
"Mix_SetReverseStereo",
"Mix_ReserveChannels",
"Mix_GroupChannel",
"Mix_GroupChannels",
"Mix_GroupAvailable",
"Mix_GroupCount",
"Mix_GroupOldest",
"Mix_GroupNewer",
"Mix_PlayChannelTimed",
"Mix_PlayMusic",
"Mix_FadeInMusic",
"Mix_FadeInMusicPos",
"Mix_FadeInChannelTimed",
"Mix_Volume",
"Mix_VolumeChunk",
"Mix_VolumeMusic",
"Mix_HaltChannel",
"Mix_HaltGroup",
"Mix_HaltMusic",
"Mix_ExpireChannel",
"Mix_FadeOutChannel",
"Mix_FadeOutGroup",
"Mix_FadeOutMusic",
"Mix_FadingMusic",
"Mix_FadingChannel",
"Mix_Pause",
"Mix_Resume",
"Mix_Paused",
"Mix_PauseMusic",
"Mix_ResumeMusic",
"Mix_RewindMusic",
"Mix_PausedMusic",
"Mix_SetMusicPosition",
"Mix_Playing",
"Mix_PlayingMusic",
"Mix_SetMusicCMD",
"Mix_SetSynchroValue",
"Mix_GetSynchroValue",
"Mix_GetChunk",
"Mix_CloseAudio"
);
}
}
}
module sdl2_mixer+ {
import sdl2;
enum MIX_InitFlags;
enum {
MIX_INIT_FLAC = 0x00000001,
MIX_INIT_MOD = 0x00000002,
MIX_INIT_MP3 = 0x00000008,
MIX_INIT_OGG = 0x00000010,
MIX_INIT_MID = 0x00000020,
MIX_INIT_OPUS = 0x00000040
}
// SDL_BYTEORDER == SDL_LIL_ENDIAN
define {
MIX_CHANNELS = 8;
MIX_DEFAULT_FREQUENCY = 22050;
MIX_DEFAULT_FORMAT = AUDIO_S16LSB;
MIX_DEFAULT_CHANNELS = 2;
MIX_MAX_VOLUME = SDL_MIX_MAXVOLUME;
}
struct Mix_Chunk {
allocated int;
abuf. uint8;
alen uint32;
volume uint8; /* Per-sample volume, 0-128 */
}
enum Mix_Fading;
enum {
MIX_NO_FADING,
MIX_FADING_OUT,
MIX_FADING_IN
}
enum Mix_MusicType;
enum {
MUS_NONE,
MUS_CMD,
MUS_WAV,
MUS_MOD,
MUS_MID,
MUS_OGG,
MUS_MP3,
MUS_MP3_MAD_UNUSED,
MUS_FLAC,
MUS_MODPLUG_UNUSED,
MUS_OPUS
}
define {
MIX_CHANNEL_POST = -2;
}
}
module sdl2_mixer+ {
inline Mix_Init(flags int) int {
return call1<int>(so::fn.Mix_Init, flags);
}
inline Mix_Quit() {
call<void>(so::fn.Mix_Quit);
}
inline Mix_OpenAudio(frequency int, format uint16, channels int, chunksize int) int {
return call4<int>(so::fn.Mix_OpenAudio, frequency, format, channels, chunksize);
}
inline Mix_AllocateChannels(numchans int) int {
return call1<int>(so::fn.Mix_AllocateChannels, numchans);
}
inline Mix_QuerySpec(frequency. int, format. uint16, channels. int) int {
return call3<int>(so::fn.Mix_QuerySpec, frequency, format, channels);
}
inline Mix_LoadWAV(file. char) .Mix_Chunk {
return Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1);
}
inline Mix_LoadWAV_RW(src. SDL_RWops, freesrc int) .Mix_Chunk {
return call2<void>(so::fn.Mix_LoadWAV_RW, src, freesrc);
}
inline Mix_LoadMUS(file. char) +Mix_Music {
return call1<void>(so::fn.Mix_LoadMUS, file);
}
inline Mix_FreeChunk(chunk. Mix_Chunk) {
call1<void>(so::fn.Mix_FreeChunk, chunk);
}
inline Mix_FreeMusic(music+ Mix_Music) {
call1<void>(so::fn.Mix_FreeMusic, music);
}
inline Mix_GetNumChunkDecoders() int {
return call1<int>(so::fn.Mix_GetNumChunkDecoders);
}
inline Mix_GetChunkDecoder(index int) .char {
return call1<char*>(so::fn.Mix_GetChunkDecoder, index);
}
inline Mix_GetNumMusicDecoders() int {
return call<int>(so::fn.Mix_GetNumMusicDecoders);
}
inline Mix_GetMusicDecoder(index int) .char {
return call1<char*>(so::fn.Mix_GetMusicDecoder, index);
}
inline Mix_GetMusicType(music+ Mix_Music) Mix_MusicType {
return call1<Mix_MusicType>(so::fn.Mix_GetMusicType, music);
}
inline Mix_SetPanning(channel int, left uint8, right uint8) int {
return call3<int>(so::fn.Mix_SetPanning, channel, left, right);
}
inline Mix_SetPosition(channel int, angle int16, distance uint8) int {
return call3<int>(so::fn.Mix_SetPosition, channel, angle, distance);
}
inline Mix_SetDistance(channel int, distance uint8) int {
return call2<int>(so::fn.Mix_SetDistance, channel, distance);
}
inline Mix_SetReverseStereo(channel int, flip int) int {
return call2<int>(so::fn.Mix_SetReverseStereo, channel, flip);
}
inline Mix_ReserveChannels(num int) int {
return call1<int>(so::fn.Mix_ReserveChannels, num);
}
inline Mix_GroupChannel(which int, tag int) int {
return call2<int>(so::fn.Mix_GroupChannel, which, tag);
}
inline Mix_GroupChannels(from int, to int, tag int) int {
return call3<int>(so::fn.Mix_GroupChannels, from, to, tag);
}
inline Mix_GroupAvailable(tag int) int {
return call1<int>(so::fn.Mix_GroupAvailable, tag);
}
inline Mix_GroupCount(tag int) int {
return call1<int>(so::fn.Mix_GroupCount, tag);
}
inline Mix_GroupOldest(tag int) int {
return call1<int>(so::fn.Mix_GroupOldest, tag);
}
inline Mix_GroupNewer(tag int) int {
return call1<int>(so::fn.Mix_GroupNewer, tag);
}
inline Mix_PlayChannel(channel int, chunk. Mix_Chunk, loops int) int {
return Mix_PlayChannelTimed(channel, chunk, loops, -1);
}
inline Mix_PlayChannelTimed(channel int, chunk. Mix_Chunk, loops int, ticks int) int {
return call4<int>(so::fn.Mix_PlayChannelTimed, channel, chunk, loops, ticks);
}
inline Mix_PlayMusic(music+ Mix_Music, loops int) int {
return call2<int>(so::fn.Mix_PlayMusic, music, loops);
}
inline Mix_FadeInMusic(music+ Mix_Music, loops int, ms int) int {
return call3<int>(so::fn.Mix_FadeInMusic, music, loops, ms);
}
inline Mix_FadeInMusicPos(music+ Mix_Music, loops int, ms int, position double) int {
return call_rrrd<int>(so::fn.Mix_FadeInMusicPos, music, loops, ms, position);
}
inline Mix_FadeInChannel(channel int, chunk. Mix_Chunk, loops int, ms int) int {
return Mix_FadeInChannelTimed(channel, chunk, loops, ms, -1);
}
inline Mix_FadeInChannelTimed(channel int, chunk. Mix_Chunk, loops int, ms int, ticks int) int {
return call5<int>(so::fn.Mix_FadeInChannelTimed, channel, chunk, loops, ms, ticks);
}
inline Mix_Volume(channel int, volume int) int {
return call2<int>(so::fn.Mix_Volume, channel, volume);
}
inline Mix_VolumeChunk(chunk. Mix_Chunk, volume int) int {
return call2<int>(so::fn.Mix_VolumeChunk, chunk, volume);
}
inline Mix_VolumeMusic(volume int) int {
return call1<int>(so::fn.Mix_VolumeMusic, volume);
}
inline Mix_HaltChannel(channel int) int {
return call1<int>(so::fn.Mix_HaltChannel, channel);
}
inline Mix_HaltGroup(tag int) int {
return call1<int>(so::fn.Mix_HaltGroup, tag);
}
inline Mix_HaltMusic() int {
return call<int>(so::fn.Mix_HaltMusic);
}
inline Mix_ExpireChannel(channel int, ticks int) int {
return call2<int>(so::fn.Mix_ExpireChannel, channel, ticks);
}
inline Mix_FadeOutChannel(which int, ms int) int {
return call2<int>(so::fn.Mix_FadeOutChannel, which, ms);
}
inline Mix_FadeOutGroup(tag int, ms int) int {
return call2<int>(so::fn.Mix_FadeOutGroup, tag, ms);
}
inline Mix_FadeOutMusic(ms int) int {
return call1<int>(so::fn.Mix_FadeOutMusic, ms);
}
inline Mix_FadingMusic() Mix_Fading {
return call<Mix_Fading>(so::fn.Mix_FadingMusic);
}
inline Mix_FadingChannel(which int) Mix_Fading {
return call1<Mix_Fading>(so::fn.Mix_FadingChannel, which);
}
inline Mix_Pause(channel int) {
call1<void>(so::fn.Mix_Pause, channel);
}
inline Mix_Resume(channel int) {
call1<void>(so::fn.Mix_Resume, channel);
}
inline Mix_Paused(channel int) int {
return call1<int>(so::fn.Mix_Paused, channel);
}
inline Mix_PauseMusic() {
call<void>(so::fn.Mix_PauseMusic);
}
inline Mix_ResumeMusic() {
call<void>(so::fn.Mix_ResumeMusic);
}
inline Mix_RewindMusic() {
call<void>(so::fn.Mix_RewindMusic);
}
inline Mix_PausedMusic() int {
return call<int>(so::fn.Mix_PausedMusic);
}
inline Mix_SetMusicPosition(position double) int {
return call_d<int>(so::fn.Mix_SetMusicPosition, position);
}
inline Mix_Playing(channel int) int {
return call1<int>(so::fn.Mix_Playing, channel);
}
inline Mix_PlayingMusic() int {
return call<int>(so::fn.Mix_PlayingMusic);
}
inline Mix_SetMusicCMD(command. char) int {
return call1<int>(so::fn.Mix_SetMusicCMD, command);
}
inline Mix_SetSynchroValue(value int) int {
return call1<int>(so::fn.Mix_SetSynchroValue, value);
}
inline Mix_GetSynchroValue() int {
return call<int>(so::fn.Mix_GetSynchroValue);
}
inline Mix_GetChunk(channel int) .Mix_Chunk {
return call1<void>(so::fn.Mix_GetChunk, channel);
}
inline Mix_CloseAudio() {
call<void>(so::fn.Mix_CloseAudio);
}
}
}

View File

@@ -1,319 +0,0 @@
// 2.0.15.0
module lib+ {
module sdl2_ttf+ {
module so {
struct struct {
TTF_ByteSwappedUNICODE void;
TTF_Init void;
TTF_OpenFont void;
TTF_OpenFontIndex void;
TTF_GetFontStyle void;
TTF_SetFontStyle void;
TTF_GetFontOutline void;
TTF_SetFontOutline void;
TTF_GetFontHinting void;
TTF_SetFontHinting void;
TTF_FontHeight void;
TTF_FontAscent void;
TTF_FontDescent void;
TTF_FontLineSkip void;
TTF_GetFontKerning void;
TTF_SetFontKerning void;
TTF_FontFaces void;
TTF_FontFaceIsFixedWidth void;
TTF_FontFaceFamilyName void;
TTF_FontFaceStyleName void;
TTF_GlyphIsProvided void;
TTF_GlyphMetrics void;
TTF_SizeText void;
TTF_SizeUTF8 void;
TTF_SizeUNICODE void;
TTF_RenderText_Solid void;
TTF_RenderUTF8_Solid void;
TTF_RenderUNICODE_Solid void;
TTF_RenderGlyph_Solid void;
TTF_RenderText_Shaded void;
TTF_RenderUTF8_Shaded void;
TTF_RenderUNICODE_Shaded void;
TTF_RenderGlyph_Shaded void;
TTF_RenderText_Blended void;
TTF_RenderUTF8_Blended void;
TTF_RenderUNICODE_Blended void;
TTF_RenderText_Blended_Wrapped void;
TTF_RenderUTF8_Blended_Wrapped void;
TTF_RenderUNICODE_Blended_Wrapped void;
TTF_RenderGlyph_Blended void;
TTF_CloseFont void;
TTF_Quit void;
TTF_WasInit void;
TTF_GetFontKerningSizeGlyphs void;
}
var fn struct;
func init() bool {
import rt::c;
return dlsyms(dlopen("libSDL2_ttf-2.0.so.0", RTLD_LAZY), &fn,
"TTF_ByteSwappedUNICODE",
"TTF_Init",
"TTF_OpenFont",
"TTF_OpenFontIndex",
"TTF_GetFontStyle",
"TTF_SetFontStyle",
"TTF_GetFontOutline",
"TTF_SetFontOutline",
"TTF_GetFontHinting",
"TTF_SetFontHinting",
"TTF_FontHeight",
"TTF_FontAscent",
"TTF_FontDescent",
"TTF_FontLineSkip",
"TTF_GetFontKerning",
"TTF_SetFontKerning",
"TTF_FontFaces",
"TTF_FontFaceIsFixedWidth",
"TTF_FontFaceFamilyName",
"TTF_FontFaceStyleName",
"TTF_GlyphIsProvided",
"TTF_GlyphMetrics",
"TTF_SizeText",
"TTF_SizeUTF8",
"TTF_SizeUNICODE",
"TTF_RenderText_Solid",
"TTF_RenderUTF8_Solid",
"TTF_RenderUNICODE_Solid",
"TTF_RenderGlyph_Solid",
"TTF_RenderText_Shaded",
"TTF_RenderUTF8_Shaded",
"TTF_RenderUNICODE_Shaded",
"TTF_RenderGlyph_Shaded",
"TTF_RenderText_Blended",
"TTF_RenderUTF8_Blended",
"TTF_RenderUNICODE_Blended",
"TTF_RenderText_Blended_Wrapped",
"TTF_RenderUTF8_Blended_Wrapped",
"TTF_RenderUNICODE_Blended_Wrapped",
"TTF_RenderGlyph_Blended",
"TTF_CloseFont",
"TTF_Quit",
"TTF_WasInit",
"TTF_GetFontKerningSizeGlyphs"
);
}
}
}
module sdl2_ttf+ {
import sdl2;
define {
UNICODE_BOM_NATIVE = 0xFEFF;
UNICODE_BOM_SWAPPED = 0xFFFE;
}
define {
TTF_STYLE_NORMAL = 0x00;
TTF_STYLE_BOLD = 0x01;
TTF_STYLE_ITALIC = 0x02;
TTF_STYLE_UNDERLINE = 0x04;
TTF_STYLE_STRIKETHROUGH = 0x08;
}
define {
TTF_HINTING_NORMAL = 0;
TTF_HINTING_LIGHT = 1;
TTF_HINTING_MONO = 2;
TTF_HINTING_NONE = 3;
}
}
module sdl2_ttf+ {
inline TTF_ByteSwappedUNICODE(swapped int) {
call1<void>(so::fn.TTF_ByteSwappedUNICODE, swapped);
}
inline TTF_Init() int {
return call<int>(so::fn.TTF_Init);
}
inline TTF_OpenFont(file. char, ptsize int) +TTF_Font {
return call2<void>(so::fn.TTF_OpenFont, file, ptsize);
}
inline TTF_OpenFontIndex(file. char, ptsize int, index long) +TTF_Font {
return call3<void>(so::fn.TTF_OpenFontIndex, file, ptsize, index);
}
inline TTF_GetFontStyle(font+ TTF_Font) int {
return call1<int>(so::fn.TTF_GetFontStyle, font);
}
inline TTF_SetFontStyle(font+ TTF_Font, style int) {
call2<void>(so::fn.TTF_SetFontStyle, font, style);
}
inline TTF_GetFontOutline(font+ TTF_Font) int {
return call1<int>(so::fn.TTF_GetFontOutline, font);
}
inline TTF_SetFontOutline(font+ TTF_Font, outline int) {
call2<void>(so::fn.TTF_SetFontOutline, font, outline);
}
inline TTF_GetFontHinting(font+ TTF_Font) int {
return call1<int>(so::fn.TTF_GetFontHinting, font);
}
inline TTF_SetFontHinting(font+ TTF_Font, hinting int) {
call2<void>(so::fn.TTF_SetFontHinting, font, hinting);
}
inline TTF_FontHeight(font+ TTF_Font) int {
return call1<int>(so::fn.TTF_FontHeight, font);
}
inline TTF_FontAscent(font+ TTF_Font) int {
return call1<int>(so::fn.TTF_FontAscent, font);
}
inline TTF_FontDescent(font+ TTF_Font) int {
return call1<int>(so::fn.TTF_FontDescent, font);
}
inline TTF_FontLineSkip(font+ TTF_Font) int {
return call1<int>(so::fn.TTF_FontLineSkip, font);
}
inline TTF_GetFontKerning(font+ TTF_Font) int {
return call1<int>(so::fn.TTF_GetFontKerning, font);
}
inline TTF_SetFontKerning(font+ TTF_Font, allowed int) {
call2<void>(so::fn.TTF_SetFontKerning, font, allowed);
}
inline TTF_FontFaces(font+ TTF_Font) long {
return call1<long>(so::fn.TTF_FontFaces, font);
}
inline TTF_FontFaceIsFixedWidth(font+ TTF_Font) int {
return call1<int>(so::fn.TTF_FontFaceIsFixedWidth, font);
}
inline TTF_FontFaceFamilyName(font+ TTF_Font) .char {
return call1<char*>(so::fn.TTF_FontFaceFamilyName, font);
}
inline TTF_FontFaceStyleName(font+ TTF_Font) .char {
return call1<char*>(so::fn.TTF_FontFaceStyleName, font);
}
inline TTF_GlyphIsProvided(font+ TTF_Font, ch uint16) int {
return call2<int>(so::fn.TTF_GlyphIsProvided, font, ch);
}
inline TTF_GlyphMetrics(font+ TTF_Font, ch uint16, minx. int, maxx. int, miny. int, maxy. int, advance. int) int {
return call7<int>(so::fn.TTF_GlyphMetrics, font, ch, minx, maxx, miny, maxy, advance);
}
inline TTF_SizeText(font+ TTF_Font, text. char, w. int, h. int) int {
return call4<int>(so::fn.TTF_SizeText, font, text, w, h);
}
inline TTF_SizeUTF8(font+ TTF_Font, text. char, w. int, h. int) int {
return call4<int>(so::fn.TTF_SizeUTF8, font, text, w, h);
}
inline TTF_SizeUNICODE(font+ TTF_Font, text. uint16, w. int, h. int) int {
return call4<int>(so::fn.TTF_SizeUNICODE, font, text, w, h);
}
inline TTF_RenderText_Solid(font+ TTF_Font, text. char, fg uint32 /* SDL_Color */) .SDL_Surface {
return call3<void>(so::fn.TTF_RenderText_Solid, font, text, fg);
}
inline TTF_RenderUTF8_Solid(font+ TTF_Font, text. char, fg uint32 /* SDL_Color */) .SDL_Surface {
return call3<void>(so::fn.TTF_RenderUTF8_Solid, font, text, fg);
}
inline TTF_RenderUNICODE_Solid(font+ TTF_Font, text. uint16, fg uint32 /* SDL_Color */) .SDL_Surface {
return call3<void>(so::fn.TTF_RenderUNICODE_Solid, font, text, fg);
}
inline TTF_RenderGlyph_Solid(font+ TTF_Font, ch uint16, fg uint32 /* SDL_Color */) .SDL_Surface {
return call3<void>(so::fn.TTF_RenderGlyph_Solid, font, ch, fg);
}
inline TTF_RenderText_Shaded(font+ TTF_Font, text. char, fg uint32 /* SDL_Color */, bg uint32 /* SDL_Color */) .SDL_Surface {
return call4<void>(so::fn.TTF_RenderText_Shaded, font, text, fg, bg);
}
inline TTF_RenderUTF8_Shaded(font+ TTF_Font, text. char, fg uint32 /* SDL_Color */, bg uint32 /* SDL_Color */) .SDL_Surface {
return call4<void>(so::fn.TTF_RenderUTF8_Shaded, font, text, fg, bg);
}
inline TTF_RenderUNICODE_Shaded(font+ TTF_Font, text. uint16, fg uint32 /* SDL_Color */, bg uint32 /* SDL_Color */) .SDL_Surface {
return call4<void>(so::fn.TTF_RenderUNICODE_Shaded, font, text, fg, bg);
}
inline TTF_RenderGlyph_Shaded(font+ TTF_Font, ch uint16, fg uint32 /* SDL_Color */, bg uint32 /* SDL_Color */) .SDL_Surface {
return call4<void>(so::fn.TTF_RenderGlyph_Shaded, font, ch, fg, bg);
}
inline TTF_RenderText_Blended(font+ TTF_Font, text. char, fg uint32 /* SDL_Color */) .SDL_Surface {
return call3<void>(so::fn.TTF_RenderText_Blended, font, text, fg);
}
inline TTF_RenderUTF8_Blended(font+ TTF_Font, text. char, fg uint32 /* SDL_Color */) .SDL_Surface {
return call3<void>(so::fn.TTF_RenderUTF8_Blended, font, text, fg);
}
inline TTF_RenderUNICODE_Blended(font+ TTF_Font, text. uint16, fg uint32 /* SDL_Color */) .SDL_Surface {
return call3<void>(so::fn.TTF_RenderUNICODE_Blended, font, text, fg);
}
inline TTF_RenderText_Blended_Wrapped(font+ TTF_Font, text. char, fg uint32 /* SDL_Color */, wrapLength uint32) .SDL_Surface {
return call4<void>(so::fn.TTF_RenderText_Blended_Wrapped, font, text, fg, wrapLength);
}
inline TTF_RenderUTF8_Blended_Wrapped(font+ TTF_Font, text. char, fg uint32 /* SDL_Color */, wrapLength uint32) .SDL_Surface {
return call4<void>(so::fn.TTF_RenderUTF8_Blended_Wrapped, font, text, fg, wrapLength);
}
inline TTF_RenderUNICODE_Blended_Wrapped(font+ TTF_Font, text. uint16, fg uint32 /* SDL_Color */, wrapLength uint32) .SDL_Surface {
return call4<void>(so::fn.TTF_RenderUNICODE_Blended_Wrapped, font, text, fg, wrapLength);
}
inline TTF_RenderGlyph_Blended(font+ TTF_Font, ch uint16, fg uint32 /* SDL_Color */) .SDL_Surface {
return call3<void>(so::fn.TTF_RenderGlyph_Blended, font, ch, fg);
}
inline TTF_CloseFont(font+ TTF_Font) {
call1<void>(so::fn.TTF_CloseFont, font);
}
inline TTF_Quit() {
call<void>(so::fn.TTF_Quit);
}
inline TTF_WasInit() int {
return call<int>(so::fn.TTF_WasInit);
}
inline TTF_GetFontKerningSizeGlyphs(font+ TTF_Font, previous_ch uint16, ch uint16) int {
return call3<int>(so::fn.TTF_GetFontKerningSizeGlyphs, font, previous_ch, ch);
}
}
}

View File

@@ -1,322 +0,0 @@
// 3.26.0
module lib+ {
module sqlite3+ {
module so {
struct struct {
sqlite3_open_v2 void;
sqlite3_close_v2 void;
sqlite3_exec void;
sqlite3_prepare_v2 void;
sqlite3_bind_blob void;
sqlite3_bind_double void;
sqlite3_bind_int void;
sqlite3_bind_null void;
sqlite3_bind_text void;
sqlite3_bind_text16 void;
sqlite3_bind_text64 void;
sqlite3_bind_value void;
sqlite3_bind_zeroblob void;
sqlite3_bind_parameter_count void;
sqlite3_bind_parameter_name void;
sqlite3_bind_parameter_index void;
sqlite3_clear_bindings void;
sqlite3_data_count void;
sqlite3_column_count void;
sqlite3_column_name void;
sqlite3_column_name16 void;
sqlite3_step void;
sqlite3_reset void;
sqlite3_column_blob void;
sqlite3_column_double void;
sqlite3_column_int void;
sqlite3_column_int64 void;
sqlite3_column_text void;
sqlite3_column_text16 void;
sqlite3_column_value void;
sqlite3_column_bytes void;
sqlite3_column_bytes16 void;
sqlite3_column_type void;
sqlite3_finalize void;
sqlite3_vmprintf void;
sqlite3_vsnprintf void;
sqlite3_free void;
sqlite3_last_insert_rowid void;
sqlite3_threadsafe void;
}
var fn struct;
func init() bool {
import rt::c;
return dlsyms(dlopen("libsqlite3.so.0", RTLD_LAZY), &fn,
"sqlite3_open_v2",
"sqlite3_close_v2",
"sqlite3_exec",
"sqlite3_prepare_v2",
"sqlite3_bind_blob",
"sqlite3_bind_double",
"sqlite3_bind_int",
"sqlite3_bind_null",
"sqlite3_bind_text",
"sqlite3_bind_text16",
"sqlite3_bind_text64",
"sqlite3_bind_value",
"sqlite3_bind_zeroblob",
"sqlite3_bind_parameter_count",
"sqlite3_bind_parameter_name",
"sqlite3_bind_parameter_index",
"sqlite3_clear_bindings",
"sqlite3_data_count",
"sqlite3_column_count",
"sqlite3_column_name",
"sqlite3_column_name16",
"sqlite3_step",
"sqlite3_reset",
"sqlite3_column_blob",
"sqlite3_column_double",
"sqlite3_column_int",
"sqlite3_column_int64",
"sqlite3_column_text",
"sqlite3_column_text16",
"sqlite3_column_value",
"sqlite3_column_bytes",
"sqlite3_column_bytes16",
"sqlite3_column_type",
"sqlite3_finalize",
"sqlite3_vmprintf",
"sqlite3_vsnprintf",
"sqlite3_free",
"sqlite3_last_insert_rowid",
"sqlite3_threadsafe"
);
}
}
}
module sqlite3+ {
define {
SQLITE_OK = 0;
SQLITE_ERROR = 1;
SQLITE_INTERNAL = 2;
SQLITE_PERM = 3;
SQLITE_ABORT = 4;
SQLITE_BUSY = 5;
SQLITE_LOCKED = 6;
SQLITE_NOMEM = 7;
SQLITE_READONLY = 8;
SQLITE_INTERRUPT = 9;
SQLITE_IOERR = 10;
SQLITE_CORRUPT = 11;
SQLITE_NOTFOUND = 12;
SQLITE_FULL = 13;
SQLITE_CANTOPEN = 14;
SQLITE_PROTOCOL = 15;
SQLITE_EMPTY = 16;
SQLITE_SCHEMA = 17;
SQLITE_TOOBIG = 18;
SQLITE_CONSTRAINT = 19;
SQLITE_MISMATCH = 20;
SQLITE_MISUSE = 21;
SQLITE_NOLFS = 22;
SQLITE_AUTH = 23;
SQLITE_FORMAT = 24;
SQLITE_RANGE = 25;
SQLITE_NOTADB = 26;
SQLITE_NOTICE = 27;
SQLITE_WARNING = 28;
SQLITE_ROW = 100;
SQLITE_DONE = 101;
}
define {
SQLITE_OPEN_READONLY = 0x00000001;
SQLITE_OPEN_READWRITE = 0x00000002;
SQLITE_OPEN_CREATE = 0x00000004;
SQLITE_OPEN_URI = 0x00000040;
SQLITE_OPEN_MEMORY = 0x00000080;
SQLITE_OPEN_NOMUTEX = 0x00008000;
SQLITE_OPEN_FULLMUTEX = 0x00010000;
SQLITE_OPEN_SHAREDCACHE = 0x00020000;
SQLITE_OPEN_PRIVATECACHE = 0x00040000;
SQLITE_PREPARE_PERSISTENT = 0x01;
}
}
module sqlite3+ {
inline sqlite3_open_v2(filename. char, ppDb+ void, flags int, zVfs. char) int {
return call4<int>(so::fn.sqlite3_open_v2, filename, ppDb, flags, zVfs);
}
inline sqlite3_close_v2(db void) int {
return call1<int>(so::fn.sqlite3_close_v2, db);
}
inline sqlite3_exec(db void, sql. char, callback void, callback_param void, errmsg++ char) int {
return call5<int>(so::fn.sqlite3_exec, db, sql, callback, callback_param, errmsg);
}
inline sqlite3_prepare_v2(db void, zSql. char, nByte int, ppStmt void, pzTail++ char) int {
return call5<int>(so::fn.sqlite3_prepare_v2, db, zSql, nByte, ppStmt, pzTail);
}
inline sqlite3_bind_blob(stmt void, index int, blob void, blob_size int, callback void) int {
return call5<int>(so::fn.sqlite3_bind_blob, stmt, index, blob, blob_size, callback);
}
inline sqlite3_bind_double(stmt void, index int, data double) int {
return call_rrd<int>(so::fn.sqlite3_bind_double, stmt, index, data);
}
inline sqlite3_bind_int(stmt void, index int, data int) int {
return call3<int>(so::fn.sqlite3_bind_int, stmt, index, data);
}
inline sqlite3_bind_null(stmt void, index int) int {
return call2<int>(so::fn.sqlite3_bind_null, stmt, index);
}
inline sqlite3_bind_text(stmt void, index int, text. char, text_len int, callback void) int {
return call5<int>(so::fn.sqlite3_bind_text, stmt, index, text, text_len, callback);
}
inline sqlite3_bind_text16(stmt void, index int, text void, text_len int, callback void) int {
return call5<int>(so::fn.sqlite3_bind_text16, stmt, index, text, text_len, callback);
}
inline sqlite3_bind_text64(stmt void, index int, text. char, text_len int64, callback void, encoding char) int {
return call6<int>(so::fn.sqlite3_bind_text64, stmt, index, text, text_len, callback, encoding);
}
inline sqlite3_bind_value(stmt void, index int, value void) int {
return call3<int>(so::fn.sqlite3_bind_value, stmt, index, value);
}
inline sqlite3_bind_zeroblob(stmt void, index int, n int) int {
return call3<int>(so::fn.sqlite3_bind_zeroblob, stmt, index, n);
}
inline sqlite3_bind_parameter_count(stmt void) int {
return call1<int>(so::fn.sqlite3_bind_parameter_count, stmt);
}
inline sqlite3_bind_parameter_name(stmt void, index int) .char {
return call2<char*>(so::fn.sqlite3_bind_parameter_name, stmt, index);
}
inline sqlite3_bind_parameter_index(stmt void, zName. char) int {
return call2<int>(so::fn.sqlite3_bind_parameter_index, stmt, zName);
}
inline sqlite3_clear_bindings(stmt void) int {
return call1<int>(so::fn.sqlite3_clear_bindings, stmt);
}
inline sqlite3_data_count(stmt void) int {
return call1<int>(so::fn.sqlite3_data_count, stmt);
}
inline sqlite3_column_count(stmt void) int {
return call1<int>(so::fn.sqlite3_column_count, stmt);
}
inline sqlite3_column_name(stmt void, index int) .char {
return call2<char*>(so::fn.sqlite3_column_name, stmt, index);
}
inline sqlite3_column_name16(stmt void, index int) void {
return call2<void>(so::fn.sqlite3_column_name16, stmt, index);
}
inline sqlite3_step(stmt void) int {
return call1<int>(so::fn.sqlite3_step, stmt);
}
inline sqlite3_reset(stmt void) int {
return call1<int>(so::fn.sqlite3_reset, stmt);
}
inline sqlite3_column_blob(stmt void, iCol int) void {
return call2<void>(so::fn.sqlite3_column_blob, stmt, iCol);
}
inline sqlite3_column_double(stmt void, iCol int) double {
return callf_rr<double>(so::fn.sqlite3_column_double, stmt, iCol);
}
inline sqlite3_column_int(stmt void, iCol int) int {
return call2<int>(so::fn.sqlite3_column_int, stmt, iCol);
}
inline sqlite3_column_int64(stmt void, iCol int) int64 {
return call_64_2<int64>(so::fn.sqlite3_column_int64, stmt, iCol);
}
inline sqlite3_column_text(stmt void, iCol int) .char {
return call2<char*>(so::fn.sqlite3_column_text, stmt, iCol);
}
inline sqlite3_column_text16(stmt void, iCol int) void {
return call2<void>(so::fn.sqlite3_column_text16, stmt, iCol);
}
inline sqlite3_column_value(stmt void, iCol int) void {
return call2<void>(so::fn.sqlite3_column_value, stmt, iCol);
}
inline sqlite3_column_bytes(stmt void, iCol int) int {
return call2<int>(so::fn.sqlite3_column_bytes, stmt, iCol);
}
inline sqlite3_column_bytes16(stmt void, iCol int) int {
return call2<int>(so::fn.sqlite3_column_bytes16, stmt, iCol);
}
inline sqlite3_column_type(stmt void, iCol int) int {
return call2<int>(so::fn.sqlite3_column_type, stmt, iCol);
}
inline sqlite3_finalize(stmt void) int {
return call1<int>(so::fn.sqlite3_finalize, stmt);
}
inline sqlite3_vmprintf(sql. char, ap void) .char {
return call2<char*>(so::fn.sqlite3_vmprintf, sql, ap);
}
func sqlite3_mprintf(sql. char, ...) .char {
return sqlite3_vmprintf(sql, va_start(sql));
}
inline sqlite3_vsnprintf(len int, str. char, sql. char, ap void) .char {
return call4<char*>(so::fn.sqlite3_vsnprintf, len, str, sql, ap);
}
func sqlite3_snprintf(len int, str. char, sql. char, ...) .char {
return sqlite3_vsnprintf(len, str, sql, va_start(len));
}
inline sqlite3_free(ptr void) {
call1<void>(so::fn.sqlite3_free, ptr);
}
inline sqlite3_last_insert_rowid(db void) int64 {
return call_64_1<int64>(so::fn.sqlite3_last_insert_rowid, db);
}
inline sqlite3_threadsafe() int {
return call<int>(so::fn.sqlite3_threadsafe);
}
}
}