/* * EXPORT.H * * (c)Copyright 2015, Matthew Dillon, All Rights Reserved. See the COPYRIGHT * file at the base of the distribution. */ struct Type; struct SemGroup; struct LValueStor; struct ObjectInfo; struct ReferenceStor; struct Declaration; struct ThreadCall; #include "hash.h" #include "genprint.h" #include "objmodel.h" #include "ary.h" #include struct RuneLock; struct RuneThread; struct RuneGlobalData; struct RefStor; struct Type; #include "thread.h" #include "timer.h" #include "lock2.h" #include "syscalls.h" #if !defined(LIBRUNTIME_NOPROTOS) /* * debug.c */ extern runelib_list_t RuneAddLibsList; extern int IsSMP; /* * hash.c */ void *hashLookup(uintptr_t id, int type, pthread_mutex_t **mtxp); uintptr_t hashEnter(void *data, int type, uintptr_t id); void *hashRemove(uintptr_t id, int type); void hashScan(int type, void (*callback) (void *data, void *hdata), void *data); void *hashFirst(int type, Hash **hp); void *hashNext(int type, Hash **hp); /* * init.c */ void LibRuneSupportInit(void); /* * Array support for execvp */ void runearyadd(runeary_t *ary, const char *ctl,...); void runearyfree(runeary_t *ary); void runeaddlib(const char *ctl,...); int threadWaitEvent(intptr_t fd, int how); void threadSleep(int ms); void threadStop(tdlist_t *list, int flags, pthread_mutex_t *mtx); void threadSleepWChan(uintptr_t wchan, int ms); void threadStopWChan(uintptr_t wchan); runethr_t *threadCreate(void (*func) (void *), void *data); runethr_t *currentThread(void); void threadWaitTerminate(void); void threadStart(runethr_t *td, pthread_mutex_t *lmtx); void threadWakeupList(tdlist_t *list, pthread_mutex_t *lmtx, uintptr_t wchan); void threadWakeupWChan(uintptr_t wchan); void threadSwitch(void); void threadEnvironmentStart(int smp); void threadSetBlocking(void); void threadClrBlocking(void); void threadCreateSynchronous(void (*func) (void *), struct ThreadCall *data); void threadDetachSynchronous(void); void threadReturnSynchronous(void); pthread_mutex_t *threadSidebandLock(void *wchan); pthread_mutex_t *threadSidebandLockDeconflict(void *wchan, pthread_mutex_t *lmtx); void threadMutexLock(pthread_mutex_t *mtx); void threadMutexUnlock(pthread_mutex_t *mtx); /* * Type default initialization and deinitialization. Note that only the * interpreter uses the type field. The code generator does not pass a type * argument. */ typedef void RUNEENTRYABI(*itype_func_t) (char *base, struct Type *type); /* * FDStor * * This structure must match the beginning of the Fd class in * classes/sys/fd.c */ typedef struct FDStor { int fd; /* descriptor from system */ int error; /* errno from system, 0 if no error */ /* extended by class */ } FDStor; void RUNERUNTIME(BoundsTrap) (void); void RUNERUNTIME(TSched) (int mode); /* * NOTE: Data points to the data base. The internal function * will calculate the info base. */ void RUNERUNTIME(PGet) (ReferenceStor *data); void RUNERUNTIME(PGetH) (ReferenceStor *data); void RUNERUNTIME(PPut) (ReferenceStor *data); void RUNERUNTIME(PPutH) (ReferenceStor *data); void RUNERUNTIME(PRef) (ReferenceStor *data); void RUNERUNTIME(PRel) (ReferenceStor *data); void RUNERUNTIME(PLock) (ReferenceStor *data); void RUNERUNTIME(PLockH) (ReferenceStor *data); void RUNERUNTIME(PUnlock) (ReferenceStor *data); void RUNERUNTIME(PUnlockH) (ReferenceStor *data); void RUNERUNTIME(IGet) (ObjectInfo *info); void RUNERUNTIME(IGetH) (ObjectInfo *info); void RUNERUNTIME(IPut) (ObjectInfo *info); void RUNERUNTIME(IPutH) (ObjectInfo *info); void RUNERUNTIME(IRef) (ObjectInfo *info); void RUNERUNTIME(IRel) (ObjectInfo *info); void RUNERUNTIME(ILock) (ObjectInfo *info); void RUNERUNTIME(ILockH) (ObjectInfo *info); void RUNERUNTIME(IUnlock) (ObjectInfo *info); void RUNERUNTIME(IUnlockH) (ObjectInfo *info); int RUNERUNTIME(LVAlloc) (struct LValueStor *lvs, struct Declaration *d); void RUNERUNTIME(BCheck) (size_t indx, size_t cap); void *RUNERUNTIME(GetVarType) (urunesize_t index, char *ap, struct SemGroup *sg); void *RUNERUNTIME(GetVarData) (urunesize_t index, char *ap, struct SemGroup *sg, struct Type *compat_type); void RUNERUNTIME(GetVarType2) (void *ap, void *rp); void RUNERUNTIME(GetVarData2) (void *ap, void *rp); int RUNERUNTIME(SWCmpType) (struct Type *super, struct Type *sub); #endif