tinyows 1.2.2
|
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <regex.h>
#include "../ows/ows.h"
Go to the source code of this file.
Macros | |
#define | SIZE_MAX (~(size_t)0) |
Functions | |
static void | buffer_realloc (buffer *buf) |
buffer * | buffer_init () |
void | buffer_free (buffer *buf) |
void | buffer_empty (buffer *buf) |
void | buffer_flush (buffer *buf, FILE *output) |
void | buffer_add (buffer *buf, char c) |
buffer * | buffer_ftoa (double f) |
void | buffer_add_double (buffer *buf, double f) |
void | buffer_add_int (buffer *buf, int i) |
buffer * | buffer_itoa (int i) |
buffer * | buffer_from_str (const char *str) |
void | buffer_add_head (buffer *buf, char c) |
void | buffer_add_head_str (buffer *buf, char *str) |
void | buffer_add_str (buffer *buf, const char *str) |
void | buffer_add_nstr (buffer *buf, const char *str, size_t n) |
bool | buffer_cmp (const buffer *buf, const char *str) |
bool | buffer_ncmp (const buffer *buf, const char *str, size_t n) |
bool | buffer_case_cmp (const buffer *buf, const char *str) |
void | buffer_copy (buffer *dest, const buffer *src) |
buffer * | buffer_clone (buffer *buf) |
void | buffer_pop (buffer *buf, size_t len) |
void | buffer_shift (buffer *buf, size_t len) |
buffer * | buffer_replace (buffer *buf, char *before, char *after) |
long int | buffer_chr (const buffer *buf, char c) |
long int | buffer_rchr (const buffer *buf, char c) |
buffer * | buffer_encode_xml_entities_str (const char *str) |
buffer * | buffer_encode_json_str (const char *str) |
void buffer_add | ( | buffer * | buf, |
char | c | ||
) |
Definition at line 123 of file buffer.c.
References Buffer::buf, buffer_realloc(), Buffer::size, and Buffer::use.
Referenced by buffer_encode_json_str(), buffer_encode_xml_entities_str(), cgi_parse_kvp(), fe_bbox(), fe_bbox_layer(), fe_distance_functions(), fe_expression(), fe_property_is_null(), fe_spatial_functions(), list_explode(), list_explode_start_end(), list_explode_str(), list_explode_str_trim(), mlist_explode(), ows_psql_column_check_constraint(), wfs_generate_schema(), wfs_geojson_display_results(), wfs_insert_xml(), and wfs_retrieve_sql_request_select().
void buffer_add_double | ( | buffer * | buf, |
double | f | ||
) |
Definition at line 158 of file buffer.c.
References buffer_copy(), buffer_free(), and buffer_ftoa().
Referenced by ows_bbox_to_query().
void buffer_add_head | ( | buffer * | buf, |
char | c | ||
) |
Definition at line 217 of file buffer.c.
References Buffer::buf, buffer_realloc(), Buffer::size, and Buffer::use.
Referenced by buffer_add_head_str(), and ows_parse_config_layer().
void buffer_add_head_str | ( | buffer * | buf, |
char * | str | ||
) |
Definition at line 239 of file buffer.c.
References buffer_add_head().
Referenced by cgi_parse_xml(), ows_parse_config_layer(), wfs_gml_display_hits(), wfs_request_check_sortby(), and wfs_retrieve_typename().
void buffer_add_int | ( | buffer * | buf, |
int | i | ||
) |
Definition at line 173 of file buffer.c.
References buffer_copy(), buffer_free(), and buffer_itoa().
Referenced by fe_bbox_layer(), fe_kvp_bbox(), fe_spatial_functions(), ows_bbox_boundaries(), ows_bbox_to_query(), ows_psql_column_name(), ows_psql_generate_id(), ows_psql_gml_to_sql(), ows_srs_get_from_a_srid(), ows_srs_set(), ows_srs_set_from_srid(), wfs_feature_type_list(), wfs_retrieve_sql_request_list(), and wfs_retrieve_sql_request_select().
void buffer_add_nstr | ( | buffer * | buf, |
const char * | str, | ||
size_t | n | ||
) |
Definition at line 271 of file buffer.c.
References Buffer::buf, buffer_realloc(), Buffer::size, and Buffer::use.
Referenced by list_split().
void buffer_add_str | ( | buffer * | buf, |
const char * | str | ||
) |
Definition at line 254 of file buffer.c.
References Buffer::buf, buffer_realloc(), Buffer::size, and Buffer::use.
Referenced by buffer_copy(), buffer_encode_json_str(), buffer_encode_xml_entities_str(), buffer_from_str(), buffer_replace(), cgi_add_att(), cgi_add_buffer(), cgi_add_into_buffer(), cgi_add_node(), cgi_add_sortby(), cgi_add_xml_into_buffer(), cgi_parse_xml(), fe_aggregate_functions(), fe_bbox(), fe_bbox_layer(), fe_binary_comparison_op(), fe_binary_logical_op(), fe_distance_functions(), fe_envelope(), fe_expression(), fe_fct_abs(), fe_fct_acos(), fe_fct_asin(), fe_fct_atan(), fe_fct_avg(), fe_fct_cbrt(), fe_fct_ceil(), fe_fct_cos(), fe_fct_cot(), fe_fct_count(), fe_fct_degrees(), fe_fct_exp(), fe_fct_floor(), fe_fct_length(), fe_fct_ln(), fe_fct_log(), fe_fct_max(), fe_fct_min(), fe_fct_radians(), fe_fct_round(), fe_fct_sin(), fe_fct_sqrt(), fe_fct_tan(), fe_fct_trunc(), fe_feature_id(), fe_filter(), fe_functions(), fe_functions_capabilities(), fe_kvp_bbox(), fe_kvp_featureid(), fe_property_is_between(), fe_property_is_like(), fe_property_is_null(), fe_spatial_functions(), fe_unary_logical_op(), fill_fe_error(), list_add_str(), list_implode(), main(), ows_bbox_boundaries(), ows_bbox_set_from_str(), ows_bbox_to_query(), ows_bbox_transform(), ows_geobbox_compute(), ows_layer_storage_fill(), ows_layers_storage_fill(), ows_parse_config_abstract(), ows_parse_config_contact(), ows_parse_config_layer(), ows_parse_config_metadata(), ows_parse_config_pg(), ows_parse_config_tinyows(), ows_psql_column_character_maximum_length(), ows_psql_column_check_constraint(), ows_psql_column_constraint_name(), ows_psql_column_name(), ows_psql_generate_id(), ows_psql_geometry_srid(), ows_psql_gml_to_sql(), ows_psql_is_geometry_valid(), ows_psql_number_features(), ows_psql_timestamp_to_xml_time(), ows_srs_get_from_a_srid(), ows_srs_set(), ows_srs_set_from_srid(), ows_srs_set_geobbox(), ows_storage_fill_attributes(), ows_storage_fill_not_null(), ows_storage_fill_pkey(), wfs_delete(), wfs_delete_xml(), wfs_execute_transaction_request(), wfs_generate_schema(), wfs_geojson_display_results(), wfs_get_capabilities_110(), wfs_gml_display_hits(), wfs_insert_xml(), wfs_parse_operation(), wfs_request_check_output(), wfs_request_check_resulttype(), wfs_request_check_sortby(), wfs_retrieve_sql_request_list(), wfs_retrieve_sql_request_select(), wfs_retrieve_typename(), wfs_retrieve_value(), and wfs_update_xml().
bool buffer_case_cmp | ( | const buffer * | buf, |
const char * | str | ||
) |
Definition at line 330 of file buffer.c.
References Buffer::buf, and Buffer::use.
Referenced by alist_add(), alist_get(), alist_is_key(), array_get(), array_get_key(), array_is_key(), array_is_value(), cgi_parse_kvp(), ows_metadata_fill(), ows_psql_to_xsd(), ows_request_check(), wfs_get_capabilities_110(), and wfs_request_check().
long int buffer_chr | ( | const buffer * | buf, |
char | c | ||
) |
Definition at line 456 of file buffer.c.
References Buffer::buf, and Buffer::use.
Referenced by list_split().
Definition at line 362 of file buffer.c.
References Buffer::buf, buffer_copy(), and buffer_init().
bool buffer_cmp | ( | const buffer * | buf, |
const char * | str | ||
) |
Definition at line 290 of file buffer.c.
References Buffer::buf, and Buffer::use.
Referenced by cgi_parse_kvp(), fe_binary_comparison_op(), fe_feature_id(), fe_property_name(), in_list(), ows_layer_list_by_ns_prefix(), ows_layer_no_uri(), ows_layer_no_uri_to_uri(), ows_layer_ns_prefix(), ows_layer_ns_prefix_to_ns_uri(), ows_layer_ns_uri(), ows_layer_prefix_to_uri(), ows_layer_uri_to_prefix(), ows_layers_storage_fill(), ows_psql_is_numeric(), ows_psql_to_xsd(), ows_request_check(), ows_request_check_version(), ows_storage_fill_attributes(), wfs(), wfs_complex_type(), wfs_describe_feature_type(), wfs_feature_type_list(), wfs_generate_schema(), wfs_get_feature(), wfs_gml_display_feature(), wfs_gml_feature_member(), wfs_insert_xml(), wfs_parse_operation(), wfs_request_check_fid(), wfs_request_check_get_capabilities(), wfs_request_check_operation(), wfs_request_check_output(), wfs_request_check_propertyname(), wfs_request_check_resulttype(), wfs_request_check_sortby(), wfs_transaction_insert_result(), wfs_transaction_response(), wfs_transaction_result(), and wfs_transaction_summary().
Definition at line 350 of file buffer.c.
References Buffer::buf, and buffer_add_str().
Referenced by buffer_add_double(), buffer_add_int(), buffer_clone(), buffer_replace(), cgi_add_buffer(), fe_aggregate_functions(), fe_bbox_layer(), fe_binary_comparison_op(), fe_distance_functions(), fe_feature_id(), fe_filter(), fe_kvp_bbox(), fe_kvp_featureid(), fe_property_is_between(), fe_property_name(), fe_spatial_functions(), fe_xpath_property_name(), list_add_by_copy(), list_add_list(), list_split(), ows_bbox_boundaries(), ows_geobbox_compute(), ows_layer_list_namespaces(), ows_layer_storage_fill(), ows_layers_storage_fill(), ows_metadata_fill(), ows_parse_config_layer(), ows_psql_column_name(), ows_psql_generate_id(), ows_psql_is_geometry_valid(), ows_psql_number_features(), ows_srs_copy(), ows_srs_set(), ows_storage_fill_attributes(), ows_storage_fill_not_null(), ows_storage_fill_pkey(), wfs_delete(), wfs_delete_xml(), wfs_generate_schema(), wfs_geojson_display_results(), wfs_gml_display_results(), wfs_insert_xml(), wfs_request_check_filter(), wfs_request_check_operation(), wfs_request_check_output(), wfs_request_check_resulttype(), wfs_request_check_sortby(), wfs_retrieve_sql_request_list(), wfs_retrieve_sql_request_select(), and wfs_update_xml().
void buffer_empty | ( | buffer * | buf | ) |
Definition at line 100 of file buffer.c.
References Buffer::buf, and Buffer::use.
Referenced by buffer_replace(), fe_binary_comparison_op(), fe_property_is_between(), fe_property_name(), fe_xpath_property_name(), ows_geobbox_compute(), ows_layer_storage_fill(), ows_layers_storage_fill(), ows_psql_gml_to_sql(), ows_srs_set(), ows_srs_set_from_srid(), ows_srs_set_geobbox(), ows_storage_fill_attributes(), ows_storage_fill_pkey(), wfs_geojson_display_results(), wfs_get_capabilities_110(), wfs_insert_xml(), wfs_parse_operation(), and wfs_request_check_sortby().
buffer * buffer_encode_json_str | ( | const char * | str | ) |
Definition at line 544 of file buffer.c.
References buffer_add(), buffer_add_str(), and buffer_init().
Referenced by wfs_geojson_display_results().
buffer * buffer_encode_xml_entities_str | ( | const char * | str | ) |
Definition at line 501 of file buffer.c.
References buffer_add(), buffer_add_str(), and buffer_init().
Referenced by wfs_gml_display_feature().
void buffer_flush | ( | buffer * | buf, |
FILE * | output | ||
) |
Definition at line 112 of file buffer.c.
References Buffer::buf.
Referenced by wfs_complex_type(), wfs_describe_feature_type(), and wfs_feature_type_list().
void buffer_free | ( | buffer * | buf | ) |
Definition at line 83 of file buffer.c.
References Buffer::buf.
Referenced by alist_free(), array_free(), buffer_add_double(), buffer_add_int(), buffer_replace(), cgi_parse_kvp(), cgi_parse_xml(), fe_bbox(), fe_binary_comparison_op(), fe_distance_functions(), fe_envelope(), fe_feature_id(), fe_filter(), fe_functions_capabilities(), fe_property_is_between(), fe_property_is_like(), fe_property_name(), fe_spatial_functions(), fe_xpath_property_name(), filter_encoding_free(), list_node_free(), mlist_explode(), ows_bbox_boundaries(), ows_bbox_set_from_str(), ows_bbox_transform(), ows_contact_free(), ows_free(), ows_geobbox_compute(), ows_layer_free(), ows_layer_storage_fill(), ows_layer_storage_free(), ows_layers_storage_fill(), ows_metadata_fill(), ows_metadata_free(), ows_psql_column_character_maximum_length(), ows_psql_column_constraint_name(), ows_psql_column_name(), ows_psql_generate_id(), ows_psql_geometry_srid(), ows_psql_gml_to_sql(), ows_psql_is_geometry_valid(), ows_psql_number_features(), ows_request_check(), ows_srs_free(), ows_srs_get_from_a_srid(), ows_srs_set(), ows_srs_set_from_srid(), ows_storage_fill_attributes(), ows_storage_fill_not_null(), ows_storage_fill_pkey(), wfs_complex_type(), wfs_delete(), wfs_delete_xml(), wfs_execute_transaction_request(), wfs_feature_type_list(), wfs_geojson_display_results(), wfs_get_capabilities_110(), wfs_gml_display_feature(), wfs_gml_display_hits(), wfs_gml_display_results(), wfs_insert_xml(), wfs_parse_operation(), wfs_request_check_filter(), wfs_request_free(), wfs_retrieve_sql_request_list(), wfs_retrieve_value(), and wfs_update_xml().
buffer * buffer_from_str | ( | const char * | str | ) |
Definition at line 202 of file buffer.c.
References buffer_add_str(), and buffer_init().
Referenced by cgi_parse_xml(), fe_property_name(), ows_metadata_fill(), ows_psql_geometry_srid(), ows_request_check(), wfs_delete_xml(), wfs_gml_display_feature(), wfs_insert_xml(), and wfs_update_xml().
buffer * buffer_ftoa | ( | double | f | ) |
Definition at line 138 of file buffer.c.
References Buffer::buf, buffer_init(), buffer_realloc(), Buffer::size, and Buffer::use.
Referenced by buffer_add_double(), and fe_distance_functions().
buffer * buffer_init | ( | ) |
Definition at line 61 of file buffer.c.
References Buffer::buf, BUFFER_SIZE_INIT, Buffer::realloc, Buffer::size, and Buffer::use.
Referenced by buffer_clone(), buffer_encode_json_str(), buffer_encode_xml_entities_str(), buffer_from_str(), buffer_ftoa(), buffer_itoa(), buffer_replace(), cgi_add_att(), cgi_add_buffer(), cgi_add_node(), cgi_add_sortby(), cgi_parse_kvp(), cgi_parse_xml(), fe_bbox(), fe_binary_comparison_op(), fe_distance_functions(), fe_envelope(), fe_feature_id(), fe_filter(), fe_functions_capabilities(), fe_kvp_bbox(), fe_kvp_featureid(), fe_property_is_between(), fe_property_is_like(), fill_fe_error(), filter_encoding_init(), list_add_by_copy(), list_add_list(), list_add_str(), list_explode(), list_explode_start_end(), list_explode_str(), list_explode_str_trim(), list_split(), main(), mlist_explode(), ows_bbox_boundaries(), ows_bbox_set_from_str(), ows_bbox_transform(), ows_geobbox_compute(), ows_init(), ows_layer_init(), ows_layer_list_namespaces(), ows_layer_storage_fill(), ows_layer_storage_init(), ows_layers_storage_fill(), ows_metadata_fill(), ows_parse_config_abstract(), ows_parse_config_contact(), ows_parse_config_layer(), ows_parse_config_metadata(), ows_parse_config_tinyows(), ows_psql_column_character_maximum_length(), ows_psql_column_check_constraint(), ows_psql_column_constraint_name(), ows_psql_column_name(), ows_psql_generate_id(), ows_psql_gml_to_sql(), ows_psql_is_geometry_valid(), ows_psql_number_features(), ows_psql_timestamp_to_xml_time(), ows_srs_get_from_a_srid(), ows_srs_init(), ows_srs_set(), ows_srs_set_from_srid(), ows_storage_fill_attributes(), ows_storage_fill_not_null(), ows_storage_fill_pkey(), wfs_delete(), wfs_delete_xml(), wfs_execute_transaction_request(), wfs_feature_type_list(), wfs_generate_schema(), wfs_geojson_display_results(), wfs_get_capabilities_110(), wfs_gml_display_results(), wfs_insert_xml(), wfs_parse_operation(), wfs_request_check_filter(), wfs_request_check_operation(), wfs_request_check_output(), wfs_request_check_resulttype(), wfs_request_check_sortby(), wfs_retrieve_sql_request_list(), wfs_retrieve_sql_request_select(), wfs_retrieve_typename(), and wfs_update_xml().
buffer * buffer_itoa | ( | int | i | ) |
Definition at line 188 of file buffer.c.
References Buffer::buf, buffer_init(), buffer_realloc(), Buffer::size, and Buffer::use.
Referenced by buffer_add_int().
bool buffer_ncmp | ( | const buffer * | buf, |
const char * | str, | ||
size_t | n | ||
) |
Definition at line 310 of file buffer.c.
References Buffer::buf, and Buffer::use.
Referenced by ows_psql_is_numeric(), ows_psql_to_xsd(), wfs_gml_display_feature(), and wfs_request_remove_prop_ns_prefix().
void buffer_pop | ( | buffer * | buf, |
size_t | len | ||
) |
Definition at line 379 of file buffer.c.
References Buffer::buf, and Buffer::use.
Referenced by buffer_replace(), cgi_add_buffer(), fe_binary_comparison_op(), and fe_xpath_property_name().
long int buffer_rchr | ( | const buffer * | buf, |
char | c | ||
) |
Definition at line 475 of file buffer.c.
References Buffer::buf, and Buffer::use.
Referenced by list_split().
|
static |
Definition at line 44 of file buffer.c.
References Buffer::buf, Buffer::realloc, Buffer::size, and SIZE_MAX.
Referenced by buffer_add(), buffer_add_head(), buffer_add_nstr(), buffer_add_str(), buffer_ftoa(), and buffer_itoa().
Definition at line 412 of file buffer.c.
References Buffer::buf, buffer_add_str(), buffer_copy(), buffer_empty(), buffer_free(), buffer_init(), buffer_pop(), buffer_shift(), and Buffer::use.
Referenced by fe_property_is_like(), ows_psql_timestamp_to_xml_time(), and wfs_execute_transaction_request().
void buffer_shift | ( | buffer * | buf, |
size_t | len | ||
) |
Definition at line 392 of file buffer.c.
References Buffer::buf, and Buffer::use.
Referenced by buffer_replace(), cgi_add_buffer(), cgi_parse_xml(), fe_binary_comparison_op(), fe_xpath_property_name(), list_split(), wfs_request_remove_prop_ns_prefix(), and wfs_retrieve_typename().