php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
odbc_utils.c
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: Calvin Buckley <calvin@cmpct.info> |
14 +----------------------------------------------------------------------+
15*/
16
17#include "php.h"
18#include "php_odbc_utils.h"
19
20/*
21 * Utility functions for dealing with ODBC connection strings and other common
22 * functionality.
23 *
24 * While useful for PDO_ODBC too, this lives in ext/odbc because there isn't a
25 * better place for it.
26 */
27
40
53
55{
56 zend_string *str;
57
59 Z_PARAM_STR(str)
61
63 zend_string *new_string = zend_string_alloc(new_size, 0);
64 php_odbc_connstr_quote(ZSTR_VAL(new_string), ZSTR_VAL(str), new_size);
65 /* reset length */
66 ZSTR_LEN(new_string) = strlen(ZSTR_VAL(new_string));
67 RETURN_STR(new_string);
68}
odbc_connection_string_is_quoted(string $str)
odbc_connection_string_should_quote(string $str)
odbc_connection_string_quote(string $str)
#define PHP_FUNCTION
Definition php.h:364
PHPAPI size_t php_odbc_connstr_estimate_quote_length(const char *in_str)
PHPAPI bool php_odbc_connstr_is_quoted(const char *str)
PHPAPI size_t php_odbc_connstr_quote(char *out_str, const char *in_str, size_t out_str_size)
PHPAPI bool php_odbc_connstr_should_quote(const char *str)
#define ZEND_PARSE_PARAMETERS_END()
Definition zend_API.h:1641
#define Z_PARAM_STR(dest)
Definition zend_API.h:2086
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
Definition zend_API.h:1620
#define RETURN_BOOL(b)
Definition zend_API.h:1035
#define RETURN_STR(s)
Definition zend_API.h:1039
strlen(string $string)
struct _zend_string zend_string
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
#define ZSTR_LEN(zstr)
Definition zend_string.h:69