]> granicus.if.org Git - php/commitdiff
add const keywords
authorNuno Lopes <nlopess@php.net>
Sat, 1 Jul 2006 11:35:34 +0000 (11:35 +0000)
committerNuno Lopes <nlopess@php.net>
Sat, 1 Jul 2006 11:35:34 +0000 (11:35 +0000)
main/fopen_wrappers.c
main/fopen_wrappers.h
main/network.c
main/safe_mode.c
main/safe_mode.h

index 750bf3dba85f44dae18e2594ccbffeed304cd010..22c8c1f714c77fc49bbb12be80001498af0b5555 100644 (file)
@@ -189,7 +189,7 @@ PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)
 
 /* {{{ php_check_safe_mode_include_dir
  */
-PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC)
+PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC)
 {
        if (PG(safe_mode)) {
                if (PG(safe_mode_include_dir) && *PG(safe_mode_include_dir)) {
@@ -239,7 +239,7 @@ PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC)
 
 /* {{{ php_fopen_and_set_opened_path
  */
-static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path TSRMLS_DC)
+static FILE *php_fopen_and_set_opened_path(const char *path, const char *mode, char **opened_path TSRMLS_DC)
 {
        FILE *fp;
 
@@ -356,7 +356,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC)
  * Tries to open a file with a PATH-style list of directories.
  * If the filename starts with "." or "/", the path is ignored.
  */
-PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC)
+PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC)
 {
        char *pathbuf, *ptr, *end;
        char *exec_fname;
index d67d8bace0fe6578bfdc2a4d88577dd2bfb36e3a..c2bbec3e4331d0f4a3a1d5d3f855b30eb61cca4b 100644 (file)
@@ -31,9 +31,9 @@ PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC);
 PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC);
 PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC);
 
-PHPAPI int php_check_safe_mode_include_dir(char *path TSRMLS_DC);
+PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC);
 
-PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path TSRMLS_DC);
+PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC);
 
 PHPAPI int php_is_url(char *path);
 PHPAPI char *php_strip_url_passwd(char *path);
index 15fa5aad97d2ca07f724423105c2a6ef1b99a3e5..63197cdd1580c207fe09444454f6d2e410c10da5 100644 (file)
@@ -103,7 +103,7 @@ int inet_aton(const char *, struct in_addr *);
 #  define PHP_GAI_STRERROR(x) (php_gai_strerror(x))
 /* {{{ php_gai_strerror
  */
-static char *php_gai_strerror(int code)
+static const char *php_gai_strerror(int code)
 {
         static struct {
                 int code;
index 3103b7ace463e27ba593e55230fdfef40160584c..3753e90ffb3257c068c75c0c660f7fcebe6335e8 100644 (file)
@@ -45,7 +45,7 @@
  * 5 - only check file
  */
 
-PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags)
+PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags)
 {
        struct stat sb;
        int ret, nofile=0;
@@ -186,7 +186,7 @@ PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int
        return 0;
 }
 
-PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) {
+PHPAPI int php_checkuid(const char *filename, const char *fopen_mode, int mode) {
 #ifdef NETWARE
 /* NetWare don't have uid*/
        return 1;
index f2025b434cea41852dec69bd5f57077952324211..51cb68c06e21ac38822db279065c4adffa09ae54 100644 (file)
@@ -33,8 +33,8 @@
 #define CHECKUID_NO_ERRORS     0x01
 
 BEGIN_EXTERN_C()
-PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode);
-PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags);
+PHPAPI int php_checkuid(const char *filename, const char *fopen_mode, int mode);
+PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mode, int flags);
 PHPAPI char *php_get_current_user(void);
 END_EXTERN_C()