e576bb2002-10-11Martin Nilsson /* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. */
e3c6c82003-10-28Martin Stjernholm #define CB_FUNC tFunc(tNone,tOr(tVoid,tMixed)) /* function(string,string,void|int:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("open",file_open, tFunc(tStr tStr tOr(tVoid,tInt),tInt))
deee412008-02-19Henrik Grubbström (Grubba) #ifdef HAVE_OPENAT /* function(string,string,void|int:int) */
e944be2008-03-07Henrik Grubbström (Grubba) FILE_FUNC("openat",file_openat, tFunc(tStr tStr tOr(tVoid,tInt),tObjImpl_STDIO_FD))
deee412008-02-19Henrik Grubbström (Grubba) #endif
e3c6c82003-10-28Martin Stjernholm /* function(string|void:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("close",file_close, tFunc(tOr(tStr,tVoid),tInt))
e3c6c82003-10-28Martin Stjernholm /* function(int|void,int|void:string) */
1f5df72008-08-09Martin Stjernholm FILE_FUNC("read",file_read, tFunc(tOr(tInt,tVoid) tOr(tInt01,tVoid),tStr8))
e3c6c82003-10-28Martin Stjernholm /* function(float|int|void:int) */
da7c7f2007-07-26Henrik Grubbström (Grubba) FILE_FUNC("peek",file_peek, tFunc(tOr3(tFlt,tInt,tVoid) tOr(tInt,tVoid), tInt))
e3c6c82003-10-28Martin Stjernholm /* function(string|array(string),mixed...:int) */
54c0b02007-04-25Henrik Grubbström (Grubba) FILE_FUNC("write",file_write,
1f5df72008-08-09Martin Stjernholm  tOr3(tFunc(tStr, tInt), tFuncV(tArr(tStr), tMixed, tInt), tFuncV(tAttr("sprintf_format", tStr),
54c0b02007-04-25Henrik Grubbström (Grubba)  tAttr("sprintf_args", tMixed),tInt)))
e3c6c82003-10-28Martin Stjernholm /* function(int|void,int|void:string) */
1f5df72008-08-09Martin Stjernholm FILE_FUNC("read_oob",file_read_oob, tFunc(tOr(tInt,tVoid) tOr(tInt,tVoid),tStr8))
e3c6c82003-10-28Martin Stjernholm /* function(string,mixed...:int) */
54c0b02007-04-25Henrik Grubbström (Grubba) FILE_FUNC("write_oob",file_write_oob,
1f5df72008-08-09Martin Stjernholm  tOr3(tFunc(tStr, tInt), tFuncV(tArr(tStr), tMixed, tInt), tFuncV(tAttr("sprintf_format", tStr),
54c0b02007-04-25Henrik Grubbström (Grubba)  tAttr("sprintf_args", tMixed),tInt)))
ca6bd02012-05-01Bill Welliver /* TODO kqueue: we should add an read_fs_event() for when not using callback mode. */
a1ef721998-04-05Fredrik Hübinette (Hubbe) 
26dbd42010-11-21Henrik Grubbström (Grubba) #ifdef HAVE_PIKE_SEND_FD
0c91d22013-06-17Martin Nilsson FILE_FUNC("send_fd", file_send_fd, tFunc(tObjIs_STDIO_FD, tVoid))
f126b62010-11-19Henrik Grubbström (Grubba) #endif
a8685d2013-05-29Henrik Grubbström (Grubba) #ifdef SO_LINGER /* function(int(-1..65535)|void:int(0..1)) */ FILE_FUNC("linger", file_linger, tFunc(tOr3(tInt_10, tWord, tVoid), tInt01)) #endif
02e2012001-06-25Henrik Grubbström (Grubba) #ifdef HAVE_FSYNC
e3c6c82003-10-28Martin Stjernholm /* function(:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("sync", file_sync, tFunc(tNone,tInt))
02e2012001-06-25Henrik Grubbström (Grubba) #endif /* HAVE_FSYNC */
e3c6c82003-10-28Martin Stjernholm /* function(int,int|void,int|void:int) */
707b922014-09-23Per Hedbor FILE_FUNC("seek",file_seek, tOr(tFunc(tInt tOr(tNStr(tInt05),tVoid),tInt), tAttr("deprecated",tFunc(tInt tInt tOr(tInt,tVoid),tInt))))
e3c6c82003-10-28Martin Stjernholm /* function(:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("tell",file_tell, tFunc(tNone,tInt))
e3c6c82003-10-28Martin Stjernholm /* function(int:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("truncate",file_truncate, tFunc(tInt,tInt))
e3c6c82003-10-28Martin Stjernholm /* function(:object) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("stat",file_stat, tFunc(tNone,tObjImpl_STDIO_STAT))
0d816f2008-02-24Henrik Grubbström (Grubba) #ifdef HAVE_FSTATAT FILE_FUNC("statat", file_statat, tFunc(tStr tOr(tVoid, tInt01), tObjImpl_STDIO_STAT))
18a5112008-03-14Henrik Grubbström (Grubba) #ifdef HAVE_UNLINKAT FILE_FUNC("unlinkat", file_unlinkat, tFunc(tStr, tInt01)); #endif /* HAVE_UNLINKAT */
0d816f2008-02-24Henrik Grubbström (Grubba) #endif /* HAVE_FSTATAT */
71c0062014-03-03Henrik Grubbström (Grubba) #if defined(HAVE_FDOPENDIR) && defined(HAVE_OPENAT) FILE_FUNC("get_dir", file_get_dir, tFunc(tOr(tStr,tVoid),tArr(tStr8))); #endif /* HAVE_FDOPENDIR && HAVE_OPENAT */
e3c6c82003-10-28Martin Stjernholm /* function(:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("errno",file_errno, tFunc(tNone,tInt))
e3c6c82003-10-28Martin Stjernholm /* function(:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("mode",file_mode, tFunc(tNone,tInt))
e3c6c82003-10-28Martin Stjernholm  /* function(int:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_close_on_exec",file_set_close_on_exec, tFunc(tInt,tVoid))
e3c6c82003-10-28Martin Stjernholm /* function(:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_nonblocking",file_set_nonblocking, tFunc(tNone,tVoid))
e3c6c82003-10-28Martin Stjernholm  /* function(object:void) */ /* Note: We have no way of specifying "object that inherits Pike.Backend". */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_backend", file_set_backend, tFunc(tObj,tVoid))
e3c6c82003-10-28Martin Stjernholm /* function(void:object) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("query_backend", file_query_backend, tFunc(tVoid,tObj))
e3c6c82003-10-28Martin Stjernholm  /* function(mixed:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_read_callback",file_set_read_callback, tFunc(CB_FUNC,tVoid))
e3c6c82003-10-28Martin Stjernholm /* function(mixed:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_write_callback",file_set_write_callback, tFunc(CB_FUNC,tVoid))
e3c6c82003-10-28Martin Stjernholm /* function(mixed:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_read_oob_callback",file_set_read_oob_callback, tFunc(CB_FUNC,tVoid))
e3c6c82003-10-28Martin Stjernholm /* function(mixed:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_write_oob_callback",file_set_write_oob_callback, tFunc(CB_FUNC,tVoid))
2ab6542012-05-13Henrik Grubbström (Grubba) /* function(mixed,int:void) */
ca6bd02012-05-01Bill Welliver FILE_FUNC("set_fs_event_callback",file_set_fs_event_callback, tFunc(tFunc(tInt,tOr(tVoid,tMixed)) tInt,tVoid)) FILE_FUNC("query_fs_event_flags",file_query_fs_event_flags, tFunc(tVoid,tInt))
e3c6c82003-10-28Martin Stjernholm  #undef CB_FUNC
ca6bd02012-05-01Bill Welliver 
e3c6c82003-10-28Martin Stjernholm /* function(:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("_enable_callbacks",file__enable_callbacks, tFunc(tNone,tVoid))
e3c6c82003-10-28Martin Stjernholm /* function(:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("_disable_callbacks",file__disable_callbacks, tFunc(tNone,tVoid))
e3c6c82003-10-28Martin Stjernholm  /* function(:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_blocking",file_set_blocking, tFunc(tNone,tVoid))
e3c6c82003-10-28Martin Stjernholm 
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC ("is_open", file_is_open, tFunc(tNone,tInt))
e3c6c82003-10-28Martin Stjernholm /* function(:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("query_fd",file_query_fd, tFunc(tNone,tInt))
4945cb2004-07-02Stephen R. van den Berg /* function(void:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("release_fd",file_release_fd, tFunc(tVoid,tInt))
4945cb2004-07-02Stephen R. van den Berg /* function(int:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("take_fd",file_take_fd, tFunc(tInt,tVoid))
e3c6c82003-10-28Martin Stjernholm  /* function(object:int) */ /* Note: We have no way of specifying "object that inherits Fd or Fd_ref". */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("dup2",file_dup2, tFunc(tObj,tInt))
e3c6c82003-10-28Martin Stjernholm /* function(void:object) */
bea5462009-02-24Henrik Grubbström (Grubba) FILE_FUNC("dup",file_dup, tFunc(tNone,tObjImpl_STDIO_FD))
e3c6c82003-10-28Martin Stjernholm /* function(void|int:object) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("pipe",file_pipe, tFunc(tOr(tVoid,tInt),tObjImpl_STDIO_FD))
e3c6c82003-10-28Martin Stjernholm  /* function(int,string|void:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_buffer",file_set_buffer, tFunc(tInt tOr(tStr,tVoid),tVoid))
54c0b02007-04-25Henrik Grubbström (Grubba) /* function(int|string|void,string|void,int|void:int) */
8366742007-04-02Henrik Grubbström (Grubba) FILE_FUNC("open_socket",file_open_socket, tFunc(tOr3(tInt,tStr,tVoid) tOr(tStr,tVoid) tOr(tInt,tVoid),tInt))
e3c6c82003-10-28Martin Stjernholm /* function(string,int|string:int)|function(string,int|string,string,int|string:int) */
86eae42014-08-26Per Hedbor  FILE_FUNC("connect",file_connect, tOr3(tFunc(tStr tOr(tInt,tStr),tInt),tFunc(tStr tOr(tInt,tStr) tStr tOr(tInt,tStr),tInt), tFunc(tStr tOr(tInt,tStr) tStr tOr(tInt,tStr) tStr8,tStr)))
baffcc2002-08-16Henrik Grubbström (Grubba) #ifdef HAVE_SYS_UN_H
e3c6c82003-10-28Martin Stjernholm /* function(string:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("connect_unix",file_connect_unix, tFunc(tStr,tInt))
baffcc2002-08-16Henrik Grubbström (Grubba) #endif /* HAVE_SYS_UN_H */
e3c6c82003-10-28Martin Stjernholm /* function(int|void:string) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("query_address",file_query_address, tFunc(tOr(tInt01,tVoid),tStr))
e3c6c82003-10-28Martin Stjernholm /* function(void|string,void|string:void) */
7363b72011-09-07Henrik Grubbström (Grubba) FILE_FUNC("create",file_create, tFunc(tOr3(tVoid,tInt,tStr) tOr(tVoid,tStr) tOr(tVoid,tInt),tVoid))
a1ef721998-04-05Fredrik Hübinette (Hubbe)  #ifdef _REENTRANT
e3c6c82003-10-28Martin Stjernholm /* function(object:void) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("proxy",file_proxy, tFunc(tObj,tVoid))
a1ef721998-04-05Fredrik Hübinette (Hubbe) #endif
13670c2015-05-25Martin Nilsson #if defined(HAVE_FD_FLOCK) || defined(HAVE_FD_LOCKF)
e3c6c82003-10-28Martin Stjernholm /* function(void|int:object) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("lock",file_lock, tFunc(tOr(tVoid,tInt),tObjImpl_STDIO_FILE_LOCK_KEY))
e3c6c82003-10-28Martin Stjernholm /* function(void|int:object) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("trylock",file_trylock, tFunc(tOr(tVoid,tInt),tObjImpl_STDIO_FILE_LOCK_KEY))
38ac571998-05-19Fredrik Hübinette (Hubbe) #endif
0e49202003-05-15Marcus Comstedt #if !defined(__NT__) && (defined(HAVE_POSIX_OPENPT) || defined(PTY_MASTER_PATHNAME))
e3c6c82003-10-28Martin Stjernholm /* function(string:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("openpt",file_openpt, tFunc(tStr,tInt))
0e49202003-05-15Marcus Comstedt #endif
1076c12003-09-30Martin Nilsson #if defined(HAVE_GRANTPT) || defined(USE_PT_CHMOD) || defined(USE_CHGPT)
e3c6c82003-10-28Martin Stjernholm /* function(void:string) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("grantpt",file_grantpt, tFunc(tNone,tStr))
eddb642002-11-09Per Hedbor #endif
d970261998-12-17Mirar (Pontus Hagland) #if defined(HAVE_TERMIOS_H)
e3c6c82003-10-28Martin Stjernholm /* function(void:mapping) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("tcgetattr",file_tcgetattr, tFunc(tNone,tMapping))
e3c6c82003-10-28Martin Stjernholm /* function(mapping,void|string:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("tcsetattr",file_tcsetattr, tFunc(tMapping tOr(tVoid,tStr),tInt))
e3c6c82003-10-28Martin Stjernholm /* function(int:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("tcsendbreak",file_tcsendbreak, tFunc(tInt,tInt))
e3c6c82003-10-28Martin Stjernholm /* function(void:string) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("tcflush",file_tcflush, tFunc(tNone,tStr))
e3c6c82003-10-28Martin Stjernholm /* FILE_FUNC("tcdrain",file_tcdrain,"function(void:int)"); */ /* FILE_FUNC("tcflow",file_tcflow,"function(string:int)"); */ /* FILE_FUNC("tcgetpgrp",file_tcgetpgrp,"function(void:int)"); */ /* FILE_FUNC("tcsetpgrp",file_tcsetpgrp,"function(int:int)"); */
bd051b1998-12-17Mirar (Pontus Hagland) #endif
85e06e1999-04-01Henrik Grubbström (Grubba) #ifdef SO_KEEPALIVE
e3c6c82003-10-28Martin Stjernholm /* function(int:int) */
2f821e2005-04-08Henrik Grubbström (Grubba) FILE_FUNC("set_keepalive",file_set_keepalive, tFunc(tInt,tInt))
85e06e1999-04-01Henrik Grubbström (Grubba) #endif
3c44292005-04-29Per Hedbor #if defined(HAVE_FSETXATTR) && defined(HAVE_FGETXATTR) && defined(HAVE_FLISTXATTR) FILE_FUNC( "listxattr", file_listxattr, tFunc(tVoid,tArr(tStr))) FILE_FUNC( "setxattr", file_setxattr, tFunc(tStr tStr tInt,tInt)) FILE_FUNC( "getxattr", file_getxattr, tFunc(tStr,tStr)) FILE_FUNC( "removexattr", file_removexattr, tFunc(tStr,tInt)) #endif
a1ef721998-04-05Fredrik Hübinette (Hubbe) #undef FILE_FUNC
e3c6c82003-10-28Martin Stjernholm #undef FILE_OBJ