diff options
author | Andrey Hristov <andrey@php.net> | 2013-07-30 12:49:36 +0200 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2013-07-30 12:49:36 +0200 |
commit | 92d27ccb0574f901a107409a7fec92888fa2b82f (patch) | |
tree | ffc98232c24bc4d6306bd7cb98d06e0320287910 /main/streams/transports.c | |
parent | 5e1ac558c3354f98a9a5aecb5b518c46cd55357a (diff) | |
download | php-git-92d27ccb0574f901a107409a7fec92888fa2b82f.tar.gz |
Constify streams API and a few other calls down the rabbit hole.
(`char *` to `const char *` for parameters and few return values)
In a few places int len moved to size_t len.
Diffstat (limited to 'main/streams/transports.c')
-rw-r--r-- | main/streams/transports.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/main/streams/transports.c b/main/streams/transports.c index c24bf97ce6..2d31074ded 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -29,12 +29,12 @@ PHPAPI HashTable *php_stream_xport_get_hash(void) return &xport_hash; } -PHPAPI int php_stream_xport_register(char *protocol, php_stream_transport_factory factory TSRMLS_DC) +PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory TSRMLS_DC) { return zend_hash_update(&xport_hash, protocol, strlen(protocol) + 1, &factory, sizeof(factory), NULL); } -PHPAPI int php_stream_xport_unregister(char *protocol TSRMLS_DC) +PHPAPI int php_stream_xport_unregister(const char *protocol TSRMLS_DC) { return zend_hash_del(&xport_hash, protocol, strlen(protocol) + 1); } @@ -49,7 +49,7 @@ PHPAPI int php_stream_xport_unregister(char *protocol TSRMLS_DC) if (local_err) { efree(local_err); local_err = NULL; } \ } -PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int options, +PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, int options, int flags, const char *persistent_id, struct timeval *timeout, php_stream_context *context, @@ -194,7 +194,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int /* Bind the stream to a local address */ PHPAPI int php_stream_xport_bind(php_stream *stream, - const char *name, long namelen, + const char *name, size_t namelen, char **error_text TSRMLS_DC) { @@ -222,7 +222,7 @@ PHPAPI int php_stream_xport_bind(php_stream *stream, /* Connect to a remote address */ PHPAPI int php_stream_xport_connect(php_stream *stream, - const char *name, long namelen, + const char *name, size_t namelen, int asynchronous, struct timeval *timeout, char **error_text, |