📄 _beos.h
字号:
// #define _MD_WAIT_CV _MD_wait_cv
// #define _MD_NOTIFY_CV _MD_notify_cv
// #define _MD_NOTIFYALL_CV _MD_notifyall_cv
/* File I/O */
/* don't need any I/O initializations */
#define _MD_INIT_IO()
#define _MD_INIT_FILEDESC(fd)
#define _MD_OPEN_DIR _MD_open_dir
#define _MD_READ_DIR _MD_read_dir
#define _MD_CLOSE_DIR _MD_close_dir
#define _MD_MAKE_NONBLOCK _MD_make_nonblock
#define _MD_SET_FD_INHERITABLE _MD_set_fd_inheritable
#define _MD_INIT_FD_INHERITABLE _MD_init_fd_inheritable
#define _MD_QUERY_FD_INHERITABLE _MD_query_fd_inheritable
#define _MD_OPEN _MD_open
#define _MD_OPEN_FILE _MD_open
#define _MD_CLOSE_FILE _MD_close_file
#define _MD_READ _MD_read
#define _MD_WRITE _MD_write
#define _MD_WRITEV _MD_writev
#define _MD_LSEEK _MD_lseek
#define _MD_LSEEK64 _MD_lseek64
#define _MD_FSYNC _MD_fsync
#define _MD_DELETE _MD_delete
#define _MD_GETFILEINFO _MD_getfileinfo
#define _MD_GETFILEINFO64 _MD_getfileinfo64
#define _MD_GETOPENFILEINFO _MD_getopenfileinfo
#define _MD_GETOPENFILEINFO64 _MD_getopenfileinfo64
#define _MD_RENAME _MD_rename
#define _MD_ACCESS _MD_access
#define _MD_STAT stat
#define _MD_MKDIR _MD_mkdir
#define _MD_MAKE_DIR _MD_mkdir
#define _MD_RMDIR _MD_rmdir
#define _MD_PR_POLL _MD_pr_poll
/* Network I/O */
#define _MD_CLOSE_SOCKET _MD_close_socket
#define _MD_CONNECT _MD_connect
#define _MD_ACCEPT _MD_accept
#define _MD_BIND _MD_bind
#define _MD_LISTEN _MD_listen
#define _MD_SHUTDOWN _MD_shutdown
#define _MD_RECV _MD_recv
#define _MD_SEND _MD_send
#define _MD_ACCEPT_READ _MD_accept_read
#define _MD_GETSOCKNAME _MD_getsockname
#define _MD_GETPEERNAME _MD_getpeername
#define _MD_GETSOCKOPT _MD_getsockopt
#define _MD_SETSOCKOPT _MD_setsockopt
#define _MD_RECVFROM _MD_recvfrom
#define _MD_SENDTO _MD_sendto
#define _MD_SOCKETPAIR _MD_socketpair
#define _MD_SOCKET _MD_socket
#define _MD_SOCKETAVAILABLE _MD_socketavailable
#define _MD_PIPEAVAILABLE _MD_socketavailable
#define _MD_GET_SOCKET_ERROR() (errno)
#define _MD_GETHOSTNAME _MD_gethostname
#define _MD_SELECT select
/* Process management */
#define _MD_CREATE_PROCESS _MD_create_process
#define _MD_DETACH_PROCESS _MD_detach_process
#define _MD_WAIT_PROCESS _MD_wait_process
#define _MD_KILL_PROCESS _MD_kill_process
/* Atomic data operations */
// #define _MD_INIT_ATOMIC _MD_init_atomic
// #define _MD_ATOMIC_INCREMENT _MD_atomic_increment
// #define _MD_ATOMIC_DECREMENT _MD_atomic_decrement
// #define _MD_ATOMIC_SET _MD_atomic_set
/* memory management */
#define _MD_INIT_SEGS _MD_init_segs
#define _MD_ALLOC_SEGMENT _MD_alloc_segment
#define _MD_FREE_SEGMENT _MD_free_segment
/* Memory mapped file I/O */
#define _MD_CREATE_FILE_MAP _MD_create_file_map
#define _MD_GET_MEM_MAP_ALIGNMENT _MD_get_mem_map_alignment
#define _MD_MEM_MAP _MD_mem_map
#define _MD_MEM_UNMAP _MD_mem_unmap
#define _MD_CLOSE_FILE_MAP _MD_close_file_map
/* Time related */
#define _MD_NOW _MD_now
#define _MD_INTERVAL_INIT _MD_interval_init
#define _MD_GET_INTERVAL _MD_get_interval
#define _MD_INTERVAL_PER_SEC _MD_interval_per_sec
/* File locking */
#define _MD_LOCKFILE _MD_lockfile
#define _MD_TLOCKFILE _MD_tlockfile
#define _MD_UNLOCKFILE _MD_unlockfile
/**
* Prototypes for machine dependent function implementations. (Too bad
* NSPR's MD system blows so much that we have to reiterate every stinking
* thing we implement here in our MD header file.)
*/
/* Miscellaneous */
NSPR_API(void) _MD_cleanup_before_exit(void);
NSPR_API(void) _MD_exit(PRIntn status);
NSPR_API(char*) _MD_get_env(const char *name);
NSPR_API(PRIntn) _MD_put_env(const char *name);
NSPR_API(void) _MD_early_init(void);
NSPR_API(void) _MD_final_init(void);
/* CPU Stuff */
NSPR_API(void) _MD_init_cpus();
NSPR_API(void) _MD_wakeup_cpus();
NSPR_API(void) _MD_start_interrupts(void);
NSPR_API(void) _MD_stop_interrupts(void);
NSPR_API(void) _MD_disable_clock_interrupts(void);
NSPR_API(void) _MD_block_clock_interrupts(void);
NSPR_API(void) _MD_unblock_clock_interrupts(void);
NSPR_API(void) _MD_clock_interrupt(void);
// NSPR_API(void) _MD_init_stack(PRThreadStack *ts, PRIntn redzone);
// NSPR_API(void) _MD_clear_stack(PRThreadStack* ts);
// NSPR_API(PRInt32) _MD_get_intsoff(void);
// NSPR_API(void) _MD_set_intsoff(PRInt32 _val);
// NSPR_API(_PRCPU*) _MD_current_cpu(void);
// NSPR_API(void) _MD_set_current_cpu(_PRCPU *cpu);
// NSPR_API(void) _MD_init_running_cpu(_PRCPU *cpu);
NSPR_API(PRInt32) _MD_pause_cpu(PRIntervalTime timeout);
/* Thread stuff */
// NSPR_API(PRThread*) _MD_current_thread(void);
NSPR_API(PRThread*) _MD_get_attached_thread(void);
NSPR_API(PRThread*) _MD_last_thread(void);
NSPR_API(void) _MD_set_current_thread(PRThread *thread);
NSPR_API(void) _MD_set_last_thread(PRThread *thread);
NSPR_API(PRStatus) _MD_init_thread(PRThread *thread);
NSPR_API(void) _MD_exit_thread(PRThread *thread);
NSPR_API(PRStatus) _MD_init_attached_thread(PRThread *thread);
NSPR_API(void) _MD_suspend_thread(PRThread *thread);
NSPR_API(void) _MD_resume_thread(PRThread *thread);
// NSPR_API(void) _MD_suspend_cpu(_PRCPU *cpu);
// NSPR_API(void) _MD_resume_cpu(_PRCPU *cpu);
NSPR_API(void) _MD_begin_suspend_all(void);
NSPR_API(void) _MD_end_suspend_all(void);
NSPR_API(void) _MD_begin_resume_all(void);
NSPR_API(void) _MD_end_resume_all(void);
NSPR_API(void *) _MD_get_sp(PRThread *thread);
NSPR_API(void) _MD_clean_thread(PRThread *thread);
NSPR_API(void) _MD_create_primordial_user_thread(PRThread *);
NSPR_API(PRThread*) _MD_create_user_thread(PRUint32 stacksize, void (*start)(void *), void *arg);
NSPR_API(void) _MD_init_primordial_thread(PRThread *thread);
NSPR_API(PRStatus) _MD_create_thread(PRThread *thread, void (*start)(void *), PRThreadPriority priority, PRThreadScope scope, PRThreadState state, PRUint32 stackSize);
NSPR_API(void) _MD_yield(void);
NSPR_API(void) _MD_set_priority(struct _MDThread *md, PRThreadPriority newPri);
NSPR_API(void) _MD_suspendall(void);
NSPR_API(void) _MD_resumeall(void);
NSPR_API(void) _MD_init_context(PRThread *thread, char *top, void (*start) (void), PRBool *status);
NSPR_API(void) _MD_switch_context(PRThread *thread);
NSPR_API(void) _MD_restore_context(PRThread *thread);
NSPR_API(PRStatus) _MD_wait(PRThread *, PRIntervalTime timeout);
NSPR_API(PRStatus) _MD_wakeup_waiter(PRThread *);
NSPR_API(PRInt32) _MD_setthreadaffinitymask(PRThread *thread, PRUint32 mask );
NSPR_API(PRInt32) _MD_getthreadaffinitymask(PRThread *thread, PRUint32 *mask);
/* Thread Synchronization */
NSPR_API(void) _MD_init_locks(void);
NSPR_API(PRStatus) _MD_new_lock(struct _MDLock *md);
NSPR_API(void) _MD_free_lock(struct _MDLock *md);
NSPR_API(void) _MD_lock(struct _MDLock *md);
NSPR_API(PRIntn) _MD_test_and_lock(struct _MDLock *md);
NSPR_API(void) _MD_unlock(struct _MDLock *md);
NSPR_API(void) _MD_ioq_lock(void);
NSPR_API(void) _MD_ioq_unlock(void);
NSPR_API(void) _MD_new_sem(struct _MDSemaphore *md, PRUintn value);
NSPR_API(void) _MD_destroy_sem(struct _MDSemaphore *md);
NSPR_API(PRStatus) _MD_timed_wait_sem(struct _MDSemaphore *md, PRIntervalTime timeout);
NSPR_API(PRStatus) _MD_wait_sem(struct _MDSemaphore *md);
NSPR_API(void) _MD_post_sem(struct _MDSemaphore *md);
// NSPR_API(PRInt32) _MD_new_cv(struct _MDCVar *md);
// NSPR_API(void) _MD_free_cv(struct _MDCVar *md);
// NSPR_API(void) _MD_wait_cv(struct _MDCVar *mdCVar, struct _MDLock *mdLock, PRIntervalTime timeout);
// NSPR_API(void) _MD_notify_cv(struct _MDCVar *md, struct _MDLock *lock);
// NSPR_API(void) _MD_notifyall_cv(struct _MDCVar *md, struct _MDLock *lock);
/* File I/O */
// NSPR_API(void) _MD_init_io(void);
NSPR_API(PRStatus) _MD_open_dir(struct _MDDir *md,const char *name);
NSPR_API(char *) _MD_read_dir(struct _MDDir *md, PRIntn flags);
NSPR_API(PRInt32) _MD_close_dir(struct _MDDir *md);
NSPR_API(void) _MD_make_nonblock(PRFileDesc *fd);
NSPR_API(void) _MD_init_fd_inheritable(PRFileDesc *fd, PRBool imported);
NSPR_API(void) _MD_query_fd_inheritable(PRFileDesc *fd);
NSPR_API(PRInt32) _MD_open(const char *name, PRIntn osflags, PRIntn mode);
NSPR_API(PRInt32) _MD_close_file(PRInt32 osfd);
NSPR_API(PRInt32) _MD_read(PRFileDesc *fd, void *buf, PRInt32 amount);
NSPR_API(PRInt32) _MD_write(PRFileDesc *fd, const void *buf, PRInt32 amount);
NSPR_API(PRInt32) _MD_writev(PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout);
NSPR_API(PRInt32) _MD_lseek(PRFileDesc *fd, PRInt32 offset, int whence);
NSPR_API(PRInt64) _MD_lseek64(PRFileDesc *fd, PRInt64 offset, int whence);
NSPR_API(PRInt32) _MD_fsync(PRFileDesc *fd);
NSPR_API(PRInt32) _MD_delete(const char *name);
NSPR_API(PRInt32) _MD_getfileinfo(const char *fn, PRFileInfo *info);
NSPR_API(PRInt32) _MD_getfileinfo64(const char *fn, PRFileInfo64 *info);
NSPR_API(PRInt32) _MD_getopenfileinfo(const PRFileDesc *fd, PRFileInfo *info);
NSPR_API(PRInt32) _MD_getopenfileinfo64(const PRFileDesc *fd, PRFileInfo64 *info);
NSPR_API(PRInt32) _MD_rename(const char *from, const char *to);
NSPR_API(PRInt32) _MD_access(const char *name, PRIntn how);
NSPR_API(PRInt32) _MD_stat(const char *name, struct stat *buf);
NSPR_API(PRInt32) _MD_mkdir(const char *name, PRIntn mode);
NSPR_API(PRInt32) _MD_rmdir(const char *name);
NSPR_API(PRInt32) _MD_pr_poll(PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout);
/* Network I/O */
NSPR_API(PRInt32) _MD_close_socket(PRInt32 osfd);
NSPR_API(PRInt32) _MD_connect(PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen, PRIntervalTime timeout);
NSPR_API(PRInt32) _MD_accept(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen, PRIntervalTime timeout);
NSPR_API(PRInt32) _MD_bind(PRFileDesc *fd, const PRNetAddr *addr, PRUint32 addrlen);
NSPR_API(PRInt32) _MD_listen(PRFileDesc *fd, PRIntn backlog);
NSPR_API(PRInt32) _MD_shutdown(PRFileDesc *fd, PRIntn how);
NSPR_API(PRInt32) _MD_recv(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout);
NSPR_API(PRInt32) _MD_send(PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, PRIntervalTime timeout);
NSPR_API(PRInt32) _MD_accept_read(PRFileDesc *sd, PRInt32 *newSock, PRNetAddr **raddr, void *buf, PRInt32 amount, PRIntervalTime timeout);
// NSPR_API(PRInt32) _MD_fast_accept(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen, PRIntervalTime timeout, PRBool fast, _PR_AcceptTimeoutCallback callback, void *callbackArg);
// NSPR_API(PRInt32) _MD_fast_accept_read(PRFileDesc *sd, PRInt32 *newSock, PRNetAddr **raddr, void *buf, PRInt32 amount, PRIntervalTime timeout, PRBool fast, _PR_AcceptTimeoutCallback callback, void *callbackArg);
// NSPR_API(void) _MD_update_accept_context(PRInt32 s, PRInt32 ls);
NSPR_API(PRStatus) _MD_getsockname(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen);
NSPR_API(PRStatus) _MD_getpeername(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen);
NSPR_API(PRStatus) _MD_getsockopt(PRFileDesc *fd, PRInt32 level, PRInt32 optname, char* optval, PRInt32* optlen);
NSPR_API(PRStatus) _MD_setsockopt(PRFileDesc *fd, PRInt32 level, PRInt32 optname, const char* optval, PRInt32 optlen);
NSPR_API(PRInt32) _MD_recvfrom(PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, PRNetAddr *addr, PRUint32 *addrlen, PRIntervalTime timeout);
NSPR_API(PRInt32) _MD_sendto(PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, const PRNetAddr *addr, PRUint32 addrlen, PRIntervalTime timeout);
NSPR_API(PRInt32) _MD_socketpair(int af, int type, int flags, PRInt32 *osfd);
NSPR_API(PRInt32) _MD_socket(int af, int type, int flags);
NSPR_API(PRInt32) _MD_socketavailable(PRFileDesc *fd);
// NSPR_API(PRInt32) _MD_get_socket_error(void);
NSPR_API(PRStatus) _MD_gethostname(char *name, PRUint32 namelen);
/* Process management */
NSPR_API(PRProcess *) _MD_create_process(const char *path, char *const *argv, char *const *envp, const PRProcessAttr *attr);
NSPR_API(PRStatus) _MD_detach_process(PRProcess *process);
NSPR_API(PRStatus) _MD_wait_process(PRProcess *process, PRInt32 *exitCode);
NSPR_API(PRStatus) _MD_kill_process(PRProcess *process);
/* Atomic data operations */
// NSPR_API(void) _MD_init_atomic(void);
// NSPR_API(PRInt32) _MD_atomic_increment(PRInt32 *);
// NSPR_API(PRInt32) _MD_atomic_decrement(PRInt32 *);
// NSPR_API(PRInt32) _MD_atomic_set(PRInt32 *, PRInt32);
/* Memory management */
NSPR_API(void) _MD_init_segs(void);
NSPR_API(PRStatus) _MD_alloc_segment(PRSegment *seg, PRUint32 size, void *vaddr);
NSPR_API(void) _MD_free_segment(PRSegment *seg);
/* Memory mapped file I/O */
NSPR_API(PRStatus) _MD_create_file_map(PRFileMap *fmap, PRInt64 size);
NSPR_API(PRInt32) _MD_get_mem_map_alignment(void);
NSPR_API(void *) _MD_mem_map(PRFileMap *fmap, PRInt64 offset, PRUint32 len);
NSPR_API(PRStatus) _MD_mem_unmap(void *addr, PRUint32 size);
NSPR_API(PRStatus) _MD_close_file_map(PRFileMap *fmap);
/* Time related */
NSPR_API(PRTime) _MD_now(void);
NSPR_API(void) _MD_interval_init(void);
NSPR_API(PRIntervalTime) _MD_get_interval(void);
NSPR_API(PRIntervalTime) _MD_interval_per_sec(void);
/* File locking */
NSPR_API(PRStatus) _MD_lockfile(PRInt32 osfd);
NSPR_API(PRStatus) _MD_tlockfile(PRInt32 osfd);
NSPR_API(PRStatus) _MD_unlockfile(PRInt32 osfd);
#endif /* _nspr_beos_defs_h___*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -