home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Online / PHP / include / php / main / fopen_wrappers.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-26  |  3.2 KB  |  92 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | PHP version 4.0                                                      |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1997-2001 The PHP Group                                |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 2.02 of the PHP license,      |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.php.net/license/2_02.txt.                                 |
  11.    | If you did not receive a copy of the PHP license and are unable to   |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@php.net so we can mail you a copy immediately.               |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Jim Winstead <jimw@php.net>                                 |
  16.    +----------------------------------------------------------------------+
  17.  */
  18. /* $Id: fopen_wrappers.h,v 1.24 2001/02/26 06:07:31 andi Exp $ */
  19.  
  20. #ifndef FOPEN_WRAPPERS_H
  21. #define FOPEN_WRAPPERS_H
  22.  
  23. #include "php_globals.h"
  24.  
  25. #define IGNORE_PATH        0
  26. #define USE_PATH        1
  27. #define IGNORE_URL        2
  28. /* There's no USE_URL. */
  29. #ifdef PHP_WIN32
  30. # define IGNORE_URL_WIN 2
  31. #else
  32. # define IGNORE_URL_WIN 0
  33. #endif
  34. #define ENFORCE_SAFE_MODE 4
  35.  
  36. #ifdef PHP_WIN32
  37. # define SOCK_ERR INVALID_SOCKET
  38. # define SOCK_CONN_ERR SOCKET_ERROR
  39. # define SOCK_RECV_ERR SOCKET_ERROR
  40. #else
  41. # define SOCK_ERR -1
  42. # define SOCK_CONN_ERR -1
  43. # define SOCK_RECV_ERR -1
  44. #endif
  45. #define SOCK_WRITE(d,s) send(s,d,strlen(d),0)
  46. #define SOCK_WRITEL(d,l,s) send(s,d,l,0)
  47. #define SOCK_FGETC(s) php_sock_fgetc((s))
  48. #define SOCK_FGETS(b,l,s) php_sock_fgets((b),(l),(s))
  49. #define SOCK_FEOF(sock) php_sock_feof((sock))
  50. #define SOCK_FREAD(ptr,size,sock) php_sock_fread((ptr),(size),(sock))
  51. #define SOCK_FCLOSE(s) php_sock_close(s)
  52.  
  53. #define FP_FGETS(buf,len,sock,fp,issock) \
  54.     ((issock)?SOCK_FGETS(buf,len,sock):fgets(buf,len,fp))
  55. #define FP_FREAD(buf,len,sock,fp,issock) \
  56.     ((issock)?SOCK_FREAD(buf,len,sock):fread(buf,1,len,fp))
  57. #define FP_FEOF(sock,fp,issock) \
  58.     ((issock)?SOCK_FEOF(sock):feof(fp))
  59. #define FP_FGETC(sock,fp,issock) \
  60.     ((issock)?SOCK_FGETC(sock):fgetc(fp))
  61.  
  62. /* values for issock */
  63. #define IS_NOT_SOCKET    0
  64. #define IS_SOCKET        1
  65. #define BAD_URL            2
  66.  
  67. PHPAPI FILE *php_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path);
  68.  
  69. PHPAPI FILE *php_fopen_primary_script(void);
  70.  
  71. PHPAPI int php_check_open_basedir(char *path);
  72. PHPAPI int php_check_specific_open_basedir(char *basedir, char *path PLS_DC);
  73.  
  74. PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path);
  75.  
  76. PHPAPI int php_is_url(char *path);
  77. PHPAPI char *php_strip_url_passwd(char *path);
  78.  
  79.  
  80. int php_init_fopen_wrappers(void); 
  81. int php_shutdown_fopen_wrappers(void); 
  82. PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path));
  83. PHPAPI int php_unregister_url_wrapper(char *protocol);
  84.  
  85. #endif
  86. /*
  87.  * Local variables:
  88.  * tab-width: 4
  89.  * c-basic-offset: 4
  90.  * End:
  91.  */
  92.