2009-05-13 02:08:16 -04:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/param.h>
|
2009-05-02 05:04:19 -04:00
|
|
|
#include <dirent.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <dlfcn.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
|
2009-05-04 02:46:13 -04:00
|
|
|
namespace factor
|
|
|
|
{
|
|
|
|
|
2009-05-04 05:50:24 -04:00
|
|
|
typedef char vm_char;
|
|
|
|
typedef char symbol_char;
|
2009-05-02 05:04:19 -04:00
|
|
|
|
|
|
|
#define STRING_LITERAL(string) string
|
|
|
|
|
|
|
|
#define SSCANF sscanf
|
|
|
|
#define STRCMP strcmp
|
|
|
|
#define STRNCMP strncmp
|
|
|
|
#define STRDUP strdup
|
2010-01-16 09:43:22 -05:00
|
|
|
#define SNPRINTF snprintf
|
2009-05-02 05:04:19 -04:00
|
|
|
|
2009-10-03 19:20:35 -04:00
|
|
|
#define FTELL ftello
|
2009-05-02 05:04:19 -04:00
|
|
|
#define FSEEK fseeko
|
|
|
|
|
|
|
|
#define OPEN_READ(path) fopen(path,"rb")
|
|
|
|
#define OPEN_WRITE(path) fopen(path,"wb")
|
|
|
|
|
2009-08-24 15:10:56 -04:00
|
|
|
#define print_native_string(string) print_string(string)
|
2009-05-02 05:04:19 -04:00
|
|
|
|
2009-08-25 03:55:18 -04:00
|
|
|
typedef pthread_t THREADHANDLE;
|
2009-05-02 05:04:19 -04:00
|
|
|
|
2009-08-25 03:55:18 -04:00
|
|
|
THREADHANDLE start_thread(void *(*start_routine)(void *),void *args);
|
2009-10-02 13:00:01 -04:00
|
|
|
inline static THREADHANDLE thread_id() { return pthread_self(); }
|
2009-05-02 05:04:19 -04:00
|
|
|
|
2009-11-18 16:58:48 -05:00
|
|
|
u64 nano_count();
|
2009-11-19 05:49:29 -05:00
|
|
|
void sleep_nanos(u64 nsec);
|
2009-05-05 12:33:35 -04:00
|
|
|
void open_console();
|
2009-10-03 09:47:05 -04:00
|
|
|
|
2010-02-03 16:12:13 -05:00
|
|
|
void move_file(const vm_char *path1, const vm_char *path2);
|
|
|
|
|
2009-05-04 02:46:13 -04:00
|
|
|
}
|