Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleanup

  • Loading branch information...
commit f57cf03b560db508310b9f4071d10cdc52fc01a2 1 parent 4d3dfb6
@tong authored
View
46 Makefile
@@ -1,33 +1,35 @@
OS = Linux
-NDLL := ndll/$(OS)/tls.ndll
-SSL_FLAGS := $(shell pkg-config --cflags --libs libcrypto)
-NEKO_FLAGS := -I/usr/lib/neko/include -L/usr/lib/neko -lneko -lz -ldl
-OBJS := src/_bio.o src/_evp.o src/_hmac.o src/_ssl.o
+INSTALL_PATH = /usr/lib/neko/
+#SSL_FLAGS := $(shell pkg-config --cflags --libs libcrypto)
+NDLL = ndll/$(OS)/tls.ndll
+NEKOPATH = -I/usr/lib/neko/include
+OBJS = src/_bio.o src/_evp.o src/_hmac.o src/_ssl.o \
+ src/_base64.o
-all : ndll
+all: build
-src/%.o : src/%.c
- $(CC) -I $(SSL_FLAGS) $(NEKO_FLAGS) -c $< -o $@
+src/%.o: src/%.c
+ $(CC) $(NEKOPATH) -c $< -o $@
+
+$(NDLL): $(OBJS)
+ $(CC) -shared -o $(NDLL) $(NEKOPATH) $(OBJS) -lssl -lcrypto
-ndll : $(OBJS) Makefile
- $(CC) -shared -fPIC -o $(NDLL) $(NEKO_FLAGS) $(OBJS)
+build: $(NDLL)
-tests : $(NDLL)
- (cd test; haxe build.hxml)
+haxelib-zip: clean build
+ (cd ..; zip -r hxssl/hxssl.zip hxssl -x hxssl/.* hxssl/_* hxssl/src*.o hxssl/.git )
-haxelib:
- ( cd ..; zip -r hxssl/hxssl.zip hxssl -x hxssl/.* hxssl/_* hxssl/.git\* )
-
-haxelib-test: haxelib
+haxelib-test: haxelib-zip
haxelib test hxssl.zip
-install-ndll : $(NDLL)
- cp $(NDLL) /usr/lib/neko
+haxelib-submit: haxelib-zip
+ haxelib submit hxssl.zip
-clean :
- rm -f src/*.o
- rm -f $(NDLL)
- rm -f hxssl.zip
+install: build
+ cp $(NDLL) $(INSTALL_PATH)
+
+clean:
+ rm -f src/*.o $(NDLL) hxssl.zip
-.PHONY: all tests clean
+.PHONY: all build install clean
View
28 README
@@ -1,19 +1,31 @@
HXSSL
=====
-Updated fork of the neko-openssl project.
+OpenSSL haXe bindings.
+
+
+SOURCE
+------
+https://github.com/tong/hxssl
+git://github.com/tong/hxssl.git
+
+
+USAGE
+-----
+See: hxssl/test/*
LINKS
-----
-https://github.com/tong/hxssl
-http://code.google.com/p/neko-openssl/
+http://www.openssl.org/docs/
+
+
+HACKERS
+-------
+This project accepts and *encourages* contributions!
+See: https://github.com/tong/hxssl/issues
AUTHORS
-------
-judu
-andyli
-tong
-delahee
-robinp
+michael.pliskin, judu, andyli, tong, delahee, robinp
View
5 neko/tls/Socket.hx
@@ -6,7 +6,6 @@ enum SocketHandle {}
enum CTX {}
enum TLS {}
-
class Socket {
static function __init__() {
@@ -175,14 +174,14 @@ class Socket {
static var SSL_CTX_load_verify_locations = Loader.load( "_SSL_CTX_load_verify_locations", 2 );
static var SSLv23_client_method = Loader.load( "_SSLv23_client_method", 0 );
static var SSL_new = Loader.load( "_SSL_new", 1 );
- static var BIO_new_socket = Loader.load( "_BIO_new_socket", 2 );
static var SSL_set_bio = Loader.load( "_SSL_set_bio", 3 );
- static var BIO_NOCLOSE = Loader.load( "_BIO_NOCLOSE", 0 );
static var SSL_connect = Loader.load( "_SSL_connect", 1 );
static var SSL_set_fd = Loader.load ( "_SSL_set_fd", 2 );
static var SSL_CTX_set_verify_depth = Loader.load( "_SSL_CTX_set_verify_depth", 2 );
static var BIO_new = Loader.load( "_BIO_new", 1 );
+ static var BIO_new_socket = Loader.load( "_BIO_new_socket", 2 );
+ static var BIO_NOCLOSE = Loader.load( "_BIO_NOCLOSE", 0 );
static var BIO_set_fd = Loader.load( "_BIO_set_fd", 3 );
static var BIO_s_socket = Loader.load( "_BIO_s_socket", 0 );
View
11 src/_bio.c
@@ -1,25 +1,26 @@
-#include <neko.h>
+
#include <stdio.h>
#include <string.h>
+#include <neko.h>
#include <openssl/bio.h>
#include <openssl/err.h>
-#include "val_void.h"
+//#include "val_void.h"
DEFINE_KIND( k_pointer);
DEFINE_KIND( k_BIO);
DEFINE_KIND( k_BIO_METHOD);
-//BIO *BIO_new_connect(char* host_port);
value _BIO_new_connect(value host_port) {
void* ptr;
ptr = BIO_new_connect(val_string(host_port));
return alloc_abstract(k_pointer, ptr);
+ //return val_null;
}
//void ERR_load_BIO_strings(void);
value _ERR_load_BIO_strings() {
ERR_load_BIO_strings();
- return VAL_VOID;
+ return val_null;
}
//long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
@@ -73,7 +74,7 @@ value _BIO_set_conn_hostname(value b, value name) {
//void BIO_free_all(BIO *a);
value _BIO_free_all(value a) {
BIO_free_all((BIO*) val_data(a));
- return VAL_VOID;
+ return val_null;
}
#define val_sock(o) ((int_val)val_data(o))
View
1  src/_bio.h
@@ -1,3 +1,4 @@
+
#ifndef _BIO_H_
#define _BIO_H_
View
49 src/_ssl.c
@@ -1,9 +1,9 @@
-#include <neko.h>
+
#include <stdio.h>
+#include <neko.h>
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
-#include "val_void.h"
DEFINE_KIND( k_ssl_ctx_pointer);
DEFINE_KIND( k_ssl_method_pointer);
@@ -12,22 +12,23 @@ DEFINE_KIND( k_ssl_ctx);
value _SSL_load_error_strings() {
SSL_load_error_strings();
- return VAL_VOID;
+ return val_null;
}
value _OpenSSL_add_all_algorithms() {
OpenSSL_add_all_algorithms();
- return VAL_VOID;
+ return val_null;
}
value _SSL_library_init() {
SSL_library_init();
- return VAL_VOID;
+ return val_null;
}
value _SSL_CTX_new(value meth) {
- SSL_CTX* ssl_ctx = SSL_CTX_new((SSL_METHOD*) val_data(meth));
- return alloc_abstract(k_ssl_ctx_pointer, ssl_ctx);
+ //val_is_abstract(meth);
+ SSL_CTX * ctx = SSL_CTX_new( val_data(meth) );
+ return alloc_abstract( k_ssl_ctx_pointer, ctx );
}
value _SSL_CTX_load_verify_locations(value ctx, /*value CAfile, */value CApath) {
@@ -35,88 +36,71 @@ value _SSL_CTX_load_verify_locations(value ctx, /*value CAfile, */value CApath)
NULL, val_string(CApath)));
}
-//BIO *BIO_new_ssl_connect(SSL_CTX *ctx);
value _BIO_new_ssl_connect(value ctx) {
- return alloc_abstract(k_ssl_ctx_pointer,
- BIO_new_ssl_connect((SSL_CTX*) val_data(ctx)));
+ return alloc_abstract(k_ssl_ctx_pointer,BIO_new_ssl_connect((SSL_CTX*) val_data(ctx)));
}
-//#define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
-//long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
-
value _BIO_get_ssl(value b/*, value sslp*/) {
SSL* r_ssl = NULL;
long r_bio_get_ssl = BIO_get_ssl((BIO*) val_data(b), &r_ssl);
return alloc_abstract(k_ssl, r_ssl);
}
-//#define SSL_set_mode(ssl,op) SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)
-//long SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg);
-
value _SSL_set_mode(value ssl, value op) {
long response = SSL_set_mode((SSL*) val_data(ssl), val_int(op));
return alloc_best_int(response);
}
-//#define SSL_MODE_AUTO_RETRY 0x00000004L
value _SSL_MODE_AUTO_RETRY() {
return alloc_best_int(0x00000004L);
}
-//SSL_METHOD *SSLv23_client_method(void);
value _SSLv23_client_method() {
- SSL_CTX * p = SSL_CTX_new(SSLv23_client_method());
- return alloc_abstract(k_ssl_method_pointer, p);
- //return alloc_abstract( k_ssl_method_pointer, SSLv23_client_method() );
+ return alloc_abstract( k_ssl_method_pointer, (SSL_METHOD*)SSLv23_client_method() );
}
-//SSL * SSL_new(SSL_CTX *ctx);
value _SSL_new(value ssl_ctx) {
+ printf("_SSL_new_SSL_new_SSL_new_SSL_new");
SSL* ssl = SSL_new((SSL_CTX*) val_data(ssl_ctx));
return alloc_abstract(k_ssl_ctx, ssl);
}
-//void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio);
value _SSL_set_bio(value s, value rbio, value wbio) {
SSL_set_bio((SSL*) val_data(s), (BIO*) val_data(rbio),
(BIO*) val_data(wbio));
- return VAL_VOID;
+ return val_null;
}
value _BIO_NOCLOSE() {
return alloc_int(BIO_NOCLOSE);
}
-//int SSL_connect(SSL *ssl);
value _SSL_connect(value ssl) {
int rsc = SSL_connect((SSL*) val_data(ssl));
return alloc_int(rsc);
}
-//void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,int (*callback)(int, X509_STORE_CTX *));
value _SSL_CTX_set_verify(value ctx, value mode,
value(*callback)( value, value)) {
+ //TODO
//SSL_CTX_set_verify((SSL_CTX*) val_data(ctx), val_int(mode), );
- return VAL_VOID;
+ return val_null;
}
-//int SSL_set_fd(SSL *s, int fd);
value _SSL_set_fd(value s, value fd) {
return alloc_int(SSL_set_fd((SSL*) val_data(s), val_int(fd)));
}
-//void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth);
+
value _SSL_CTX_set_verify_depth(value ctx, value depth) {
SSL_CTX_set_verify_depth((SSL_CTX*) val_data(ctx), val_int(depth));
- return VAL_VOID;
+ return val_null;
}
-//int SSL_read(SSL *ssl,void *buf,int num);
value _SSL_read(value ssl, value buf, value num) {
return alloc_int(
SSL_read((SSL*) val_data(ssl), val_data(buf), val_int(num)));
}
-//int SSL_write(SSL *ssl,const void *buf,int num);
value _SSL_write(value ssl, const value buf, value num) {
return alloc_int(
SSL_write((SSL*) val_data(ssl), val_data(buf), val_int(num)));
@@ -220,7 +204,6 @@ value SSL_recv_char(value ssl) {
}
*/
-//int SSL_shutdown(SSL *s);
value _SSL_shutdown(value ssl) {
return alloc_int(SSL_shutdown((SSL*) val_data(ssl)));
}
View
431 src/neko.h
@@ -1,431 +0,0 @@
-/* ************************************************************************ */
-/* */
-/* Neko Virtual Machine */
-/* Copyright (c)2005 Motion-Twin */
-/* */
-/* This library is free software; you can redistribute it and/or */
-/* modify it under the terms of the GNU Lesser General Public */
-/* License as published by the Free Software Foundation; either */
-/* version 2.1 of the License, or (at your option) any later version. */
-/* */
-/* This library is distributed in the hope that it will be useful, */
-/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
-/* Lesser General Public License or the LICENSE file for more details. */
-/* */
-/* ************************************************************************ */
-#ifndef _NEKO_H
-#define _NEKO_H
-
-// OS FLAGS
-#if defined(_WIN32)
-# define NEKO_WINDOWS
-#endif
-
-#if defined(__APPLE__) || defined(__MACH__) || defined(macintosh)
-# define NEKO_MAC
-#endif
-
-#if defined(linux) || defined(__linux__)
-# define NEKO_LINUX
-#endif
-
-#if defined(__FreeBSD_kernel__)
-# define NEKO_GNUKBSD
-#endif
-
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
-# define NEKO_BSD
-#endif
-
-// COMPILER/PROCESSOR FLAGS
-#if defined(__GNUC__)
-# define NEKO_GCC
-#endif
-
-#if defined(_MSC_VER)
-# define NEKO_VCC
-#endif
-
-#if defined(__MINGW32__)
-# define NEKO_MINGW
-#endif
-
-#if defined(__i386__) || defined(_WIN32)
-# define NEKO_X86
-#endif
-
-#if defined(__ppc__)
-# define NEKO_PPC
-#endif
-
-#if defined(_64BITS)
-# define NEKO_64BITS
-#endif
-
-#if defined(NEKO_LINUX) || defined(NEKO_MAC) || defined(NEKO_BSD) || defined(NEKO_GNUKBSD)
-# define NEKO_POSIX
-#endif
-
-#if defined(NEKO_GCC)
-# define NEKO_THREADED
-# define NEKO_DIRECT_THREADED
-#endif
-
-#ifndef NEKO_NO_THREADS
-# define NEKO_THREADS
-#endif
-
-#include <stddef.h>
-#ifndef NEKO_VCC
-# include <stdint.h>
-#endif
-
-#define NEKO_VERSION 181
-
-typedef intptr_t int_val;
-
-typedef enum {
- VAL_INT = 0xFF,
- VAL_NULL = 0,
- VAL_FLOAT = 1,
- VAL_BOOL = 2,
- VAL_STRING = 3,
- VAL_OBJECT = 4,
- VAL_ARRAY = 5,
- VAL_FUNCTION = 6,
- VAL_ABSTRACT = 7,
- VAL_PRIMITIVE = 6 | 8,
- VAL_JITFUN = 6 | 16,
- VAL_32_BITS = 0xFFFFFFFF
-} val_type;
-
-struct _value {
- val_type t;
-};
-
-struct _buffer;
-typedef int field;
-typedef struct { int __zero; } *vkind;
-typedef struct _value *value;
-
-typedef struct {
- field id;
- value v;
-} objcell;
-
-typedef struct _objtable
-{
- int count;
- objcell *cells;
-} objtable;
-
-typedef struct _buffer *buffer;
-typedef double tfloat;
-
-typedef void (*finalizer)(value v);
-
-#pragma pack(4)
-typedef struct {
- val_type t;
- tfloat f;
-} vfloat;
-#pragma pack()
-
-typedef struct _vobject {
- val_type t;
- objtable table;
- struct _vobject *proto;
-} vobject;
-
-typedef struct {
- val_type t;
- int nargs;
- void *addr;
- value env;
- void *module;
-} vfunction;
-
-typedef struct {
- val_type t;
- char c;
-} vstring;
-
-typedef struct {
- val_type t;
- value ptr;
-} varray;
-
-typedef struct {
- val_type t;
- vkind kind;
- void *data;
-} vabstract;
-
-typedef struct hcell {
- int hkey;
- value key;
- value val;
- struct hcell *next;
-} hcell;
-
-typedef struct {
- hcell **cells;
- int ncells;
- int nitems;
-} vhash;
-
-struct _mt_local;
-struct _mt_lock;
-typedef struct _mt_local mt_local;
-typedef struct _mt_lock mt_lock;
-
-#define val_tag(v) (*(val_type*)(v))
-#define val_is_null(v) ((v) == val_null)
-#define val_is_int(v) ((((int)(int_val)(v)) & 1) != 0)
-#define val_is_bool(v) ((v) == val_true || (v) == val_false)
-#define val_is_number(v) (val_is_int(v) || val_tag(v) == VAL_FLOAT)
-#define val_is_float(v) (!val_is_int(v) && val_tag(v) == VAL_FLOAT)
-#define val_is_string(v) (!val_is_int(v) && (val_tag(v)&7) == VAL_STRING)
-#define val_is_function(v) (!val_is_int(v) && (val_tag(v)&7) == VAL_FUNCTION)
-#define val_is_object(v) (!val_is_int(v) && val_tag(v) == VAL_OBJECT)
-#define val_is_array(v) (!val_is_int(v) && (val_tag(v)&7) == VAL_ARRAY)
-#define val_is_abstract(v) (!val_is_int(v) && val_tag(v) == VAL_ABSTRACT)
-#define val_is_kind(v,t) (val_is_abstract(v) && val_kind(v) == (t))
-#define val_check_kind(v,t) if( !val_is_kind(v,t) ) neko_error();
-#define val_check_function(f,n) if( !val_is_function(f) || (val_fun_nargs(f) != (n) && val_fun_nargs(f) != VAR_ARGS) ) neko_error();
-#define val_check(v,t) if( !val_is_##t(v) ) neko_error();
-#define val_data(v) ((vabstract*)(v))->data
-#define val_kind(v) ((vabstract*)(v))->kind
-
-#define val_type(v) (val_is_int(v) ? VAL_INT : (val_tag(v)&7))
-#define val_int(v) (((int)(int_val)(v)) >> 1)
-#define val_float(v) (CONV_FLOAT ((vfloat*)(v))->f)
-#define val_bool(v) ((v) == val_true)
-#define val_number(v) (val_is_int(v)?val_int(v):val_float(v))
-#define val_hdata(v) ((vhash*)val_data(v))
-#define val_string(v) (&((vstring*)(v))->c)
-#define val_strlen(v) (val_tag(v) >> 3)
-#define val_set_length(v,l) val_tag(v) = (val_tag(v)&7) | ((l) << 3)
-#define val_set_size val_set_length
-
-#define val_array_size(v) (val_tag(v) >> 3)
-#define val_array_ptr(v) (&((varray*)(v))->ptr)
-#define val_fun_nargs(v) ((vfunction*)(v))->nargs
-#define alloc_int(v) ((value)(int_val)((((int)(v)) << 1) | 1))
-#define alloc_bool(b) ((b)?val_true:val_false)
-
-#define max_array_size ((1 << 29) - 1)
-#define max_string_size ((1 << 29) - 1)
-#define invalid_comparison 0xFE
-
-#undef EXTERN
-#undef EXPORT
-#undef IMPORT
-#if defined(NEKO_VCC) || defined(NEKO_MINGW)
-# define INLINE __inline
-# define EXPORT __declspec( dllexport )
-# define IMPORT __declspec( dllimport )
-#else
-# define INLINE inline
-# define EXPORT
-# define IMPORT
-#endif
-
-#if defined(NEKO_SOURCES) || defined(NEKO_STANDALONE)
-# define EXTERN EXPORT
-#else
-# define EXTERN IMPORT
-#endif
-
-#define VEXTERN extern EXTERN
-
-#ifdef __cplusplus
-# define C_FUNCTION_BEGIN extern "C" {
-# define C_FUNCTION_END };
-#else
-# define C_FUNCTION_BEGIN
-# define C_FUNCTION_END
-# ifndef true
-# define true 1
-# define false 0
- typedef int bool;
-# endif
-#endif
-
-#define alloc_int32(i) alloc_abstract(k_int32, (value)(int_val)(i))
-// the two upper bits must be either 00 or 11
-#define need_32_bits(i) ( ((((unsigned int)i) >> 30) + 1) & 2 )
-#define alloc_best_int(i) (need_32_bits(i) ? alloc_int32(i) : alloc_int(i))
-#define val_int32(v) (val_is_int(v)?val_int(v):(int)(int_val)val_data(v))
-#define val_is_int32(v) (val_is_int(v) || val_is_kind(v,k_int32))
-
-#define neko_error() return NULL
-#define failure(msg) _neko_failure(alloc_string(msg),__FILE__,__LINE__)
-#define bfailure(buf) _neko_failure(buffer_to_string(b),__FILE__,__LINE__)
-
-#ifndef CONV_FLOAT
-# define CONV_FLOAT
-#endif
-
-#ifdef NEKO_POSIX
-# include <errno.h>
-# define POSIX_LABEL(name) name:
-# define HANDLE_EINTR(label) if( errno == EINTR ) goto label
-# define HANDLE_FINTR(f,label) if( ferror(f) && errno == EINTR ) goto label
-#else
-# define POSIX_LABEL(name)
-# define HANDLE_EINTR(label)
-# define HANDLE_FINTR(f,label)
-#endif
-
-#define VAR_ARGS (-1)
-#define DEFINE_PRIM_MULT(func) C_FUNCTION_BEGIN EXPORT void *func##__MULT() { return (void*)(&func); } C_FUNCTION_END
-#define DEFINE_PRIM(func,nargs) C_FUNCTION_BEGIN EXPORT void *func##__##nargs() { return (void*)(&func); } C_FUNCTION_END
-#define DEFINE_KIND(name) int_val __kind_##name = 0; vkind name = (vkind)&__kind_##name;
-
-#ifdef NEKO_STANDALONE
-# define DEFINE_ENTRY_POINT(name)
-#else
-# define DEFINE_ENTRY_POINT(name) C_FUNCTION_BEGIN void name(); EXPORT void *__neko_entry_point() { return &name; } C_FUNCTION_END
-#endif
-
-#ifdef HEADER_IMPORTS
-# define H_EXTERN IMPORT
-#else
-# define H_EXTERN EXPORT
-#endif
-
-#define DECLARE_PRIM(func,nargs) C_FUNCTION_BEGIN H_EXTERN void *func##__##nargs(); C_FUNCTION_END
-#define DECLARE_KIND(name) C_FUNCTION_BEGIN H_EXTERN extern vkind name; C_FUNCTION_END
-
-#define alloc_float neko_alloc_float
-#define alloc_string neko_alloc_string
-#define alloc_empty_string neko_alloc_empty_string
-#define copy_string neko_copy_string
-#define val_this neko_val_this
-#define val_id neko_val_id
-#define val_field neko_val_field
-#define alloc_object neko_alloc_object
-#define alloc_field neko_alloc_field
-#define alloc_array neko_alloc_array
-#define val_call0 neko_val_call0
-#define val_call1 neko_val_call1
-#define val_call2 neko_val_call2
-#define val_call3 neko_val_call3
-#define val_callN neko_val_callN
-#define val_ocall0 neko_val_ocall0
-#define val_ocall1 neko_val_ocall1
-#define val_ocall2 neko_val_ocall2
-#define val_ocallN neko_val_ocallN
-#define val_callEx neko_val_callEx
-#define alloc_root neko_alloc_root
-#define free_root neko_free_root
-#define alloc neko_alloc
-#define alloc_private neko_alloc_private
-#define alloc_abstract neko_alloc_abstract
-#define alloc_function neko_alloc_function
-#define alloc_buffer neko_alloc_buffer
-#define buffer_append neko_buffer_append
-#define buffer_append_sub neko_buffer_append_sub
-#define buffer_append_char neko_buffer_append_char
-#define buffer_to_string neko_buffer_to_string
-#define val_buffer neko_val_buffer
-#define val_compare neko_val_compare
-#define val_print neko_val_print
-#define val_gc neko_val_gc
-#define val_throw neko_val_throw
-#define val_rethrow neko_val_rethrow
-#define val_iter_fields neko_val_iter_fields
-#define val_field_name neko_val_field_name
-#define val_hash neko_val_hash
-#define k_int32 neko_k_int32
-#define k_hash neko_k_hash
-#define kind_share neko_kind_share
-
-#define alloc_local neko_alloc_local
-#define local_get neko_local_get
-#define local_set neko_local_set
-#define free_local neko_free_local
-#define alloc_lock neko_alloc_lock
-#define lock_acquire neko_lock_acquire
-#define lock_try neko_lock_try
-#define lock_release neko_lock_release
-#define free_lock neko_free_lock
-
-C_FUNCTION_BEGIN
-
- VEXTERN vkind k_int32;
- VEXTERN vkind k_hash;
-
- VEXTERN value val_null;
- VEXTERN value val_true;
- VEXTERN value val_false;
-
- EXTERN value alloc_float( tfloat t );
-
- EXTERN value alloc_string( const char *str );
- EXTERN value alloc_empty_string( unsigned int size );
- EXTERN value copy_string( const char *str, int_val size );
-
- EXTERN value val_this();
- EXTERN field val_id( const char *str );
- EXTERN value val_field( value o, field f );
- EXTERN value alloc_object( value o );
- EXTERN void alloc_field( value obj, field f, value v );
- EXTERN void val_iter_fields( value obj, void f( value v, field f, void * ), void *p );
- EXTERN value val_field_name( field f );
-
- EXTERN value alloc_array( unsigned int n );
- EXTERN value alloc_abstract( vkind k, void *data );
-
- EXTERN value val_call0( value f );
- EXTERN value val_call1( value f, value arg );
- EXTERN value val_call2( value f, value arg1, value arg2 );
- EXTERN value val_call3( value f, value arg1, value arg2, value arg3 );
- EXTERN value val_callN( value f, value *args, int nargs );
- EXTERN value val_ocall0( value o, field f );
- EXTERN value val_ocall1( value o, field f, value arg );
- EXTERN value val_ocall2( value o, field f, value arg1, value arg2 );
- EXTERN value val_ocallN( value o, field f, value *args, int nargs );
- EXTERN value val_callEx( value vthis, value f, value *args, int nargs, value *exc );
-
- EXTERN value *alloc_root( unsigned int nvals );
- EXTERN void free_root( value *r );
- EXTERN char *alloc( unsigned int nbytes );
- EXTERN char *alloc_private( unsigned int nbytes );
- EXTERN value alloc_function( void *c_prim, unsigned int nargs, const char *name );
-
- EXTERN buffer alloc_buffer( const char *init );
- EXTERN void buffer_append( buffer b, const char *s );
- EXTERN void buffer_append_sub( buffer b, const char *s, int_val len );
- EXTERN void buffer_append_char( buffer b, char c );
- EXTERN value buffer_to_string( buffer b );
- EXTERN void val_buffer( buffer b, value v );
-
- EXTERN int val_compare( value a, value b );
- EXTERN void val_print( value s );
- EXTERN void val_gc( value v, finalizer f );
- EXTERN void val_throw( value v );
- EXTERN void val_rethrow( value v );
- EXTERN int val_hash( value v );
-
- EXTERN void kind_share( vkind *k, const char *name );
- EXTERN void _neko_failure( value msg, const char *file, int line );
-
- // MULTITHREADING API
- EXTERN mt_local *alloc_local();
- EXTERN void *local_get( mt_local *l );
- EXTERN void local_set( mt_local *l, void *v );
- EXTERN void free_local( mt_local *l );
-
- EXTERN mt_lock *alloc_lock();
- EXTERN void lock_acquire( mt_lock *l );
- EXTERN int lock_try( mt_lock *l );
- EXTERN void lock_release( mt_lock *l );
- EXTERN void free_lock( mt_lock *l );
-
-C_FUNCTION_END
-
-#endif
-/* ************************************************************************ */
View
7 src/val_void.h
@@ -1,7 +0,0 @@
-#ifndef _VAL_VOID_H_
-#define _VAL_VOID_H_
-
-#include <neko.h>
-#define VAL_VOID val_null
-
-#endif /* _VAL_VOID_H_ */
Please sign in to comment.
Something went wrong with that request. Please try again.