|
GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
|
GIS Library - Find raster map. More...
#include <string.h>#include <stdlib.h>#include <ctype.h>#include <sys/types.h>#include <grass/gis.h>
Go to the source code of this file.
Macros | |
| #define | NULL 0 |
Functions | |
| int | G_strcasecmp (const char *x, const char *y) |
| String compare ignoring case (upper or lower) | |
| int | G_strncasecmp (const char *x, const char *y, int n) |
| String compare ignoring case (upper or lower) - limited number of characters. | |
| char * | G_store (const char *s) |
| Copy string to allocated memory. | |
| char * | G_store_upper (const char *s) |
| Copy string to allocated memory and convert copied string to upper case. | |
| char * | G_store_lower (const char *s) |
| Copy string to allocated memory and convert copied string to lower case. | |
| char * | G_strchg (char *bug, char character, char new) |
| Replace all occurrences of character in string bug with new. | |
| char * | G_str_replace (const char *buffer, const char *old_str, const char *new_str) |
| Replace all occurrences of old_str in buffer with new_str. | |
| char * | G_str_concat (const char **src_strings, int num_strings, const char *sep, int maxsize) |
| String concatenation. | |
| void | G_strip (char *buf) |
| Removes all leading and trailing white space from string. | |
| char * | G_chop (char *line) |
| Chop leading and trailing white spaces. | |
| void | G_str_to_upper (char *str) |
| Convert string to upper case. | |
| void | G_str_to_lower (char *str) |
| Convert string to lower case. | |
| int | G_str_to_sql (char *str) |
| Make string SQL compliant. | |
| void | G_squeeze (char *line) |
| Remove superfluous white space. | |
| char * | G_strcasestr (const char *str, const char *substr) |
| Finds the first occurrence of the sub-string in the null-terminated string ignoring case (upper or lower) | |
GIS Library - Find raster map.
GIS Library - string/chring movement functions.
(C) 1999-2009 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
(C) 1999-2008, 2011 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file strings.c.
| #define NULL 0 |
Definition at line 26 of file strings.c.
Referenced by G_store(), G_str_concat(), G_str_replace(), and G_strcasestr().
| char * G_chop | ( | char * | line | ) |
Chop leading and trailing white spaces.
space, \f, \n, \r, \t, \v
Modified copy of G_squeeze() by RB in March 2000.
| line | buffer to be worked on |
Definition at line 331 of file strings.c.
References t.
Referenced by check_create_export_opts(), check_create_import_opts(), check_mapset_in_layer_name(), G_get_projsrid(), G_get_projwkt(), G_parser(), G_str_to_color(), get_key_data(), read_coor(), and S_read().
| void G_squeeze | ( | char * | line | ) |
Remove superfluous white space.
Leading and trailing white space is removed from the string line and internal white space which is more than one character is reduced to a single space character. White space here means spaces, tabs, linefeeds, newlines, and formfeeds.
| [in,out] | line |
| char * G_store | ( | const char * | s | ) |
Copy string to allocated memory.
This routine allocates enough memory to hold the string s, copies s to the allocated memory, and returns a pointer to the allocated memory.
If s is NULL then empty string is returned.
| s | string |
Definition at line 87 of file strings.c.
References NULL.
Referenced by cairo_read_ppm(), cairo_write_ppm(), COM_Set_encoding(), font_get_encoding(), font_init_freetype(), G__home(), G__read_Cell_head(), G__wps_print_process_description(), G_add_keyword(), G_config_path(), G_database_datum_name(), G_database_ellipse_name(), G_date(), G_define_standard_option(), G_fully_qualified_name(), G_get_available_mapsets(), G_init_logging(), G_ls2(), G_myname(), G_option_to_separator(), G_parser(), G_putenv(), G_read_datum_table(), G_read_ellipsoid_table(), G_set_key_value(), G_set_program_name(), G_store_lower(), G_store_upper(), G_str_concat(), G_str_replace(), G_tempfile_pid(), G_tempfile_pid_basedir(), G_whoami(), GP_get_sitename(), GP_load_site(), GP_set_style_thematic(), GPJ__get_datum_params(), GPJ__get_ellipsoid_params(), GPJ_get_datum_by_name(), GPJ_get_datum_transform_by_name(), GPJ_get_default_datum_params_by_name(), GPJ_get_ellipsoid_by_name(), GPJ_get_equivalent_latlong(), GPJ_grass_to_osr(), GPJ_init_transform(), GPJ_osr_to_grass(), gsds_newh(), GV_get_vectname(), GV_load_vector(), GV_set_style_thematic(), gvl_file_newh(), html_polygon(), M__add_element(), M_read_list(), parse_fontcap_entry(), pj_get_kv(), pj_get_string(), read_datum_table(), read_ellipsoid_table(), read_pgm(), Segment_open(), and write_pgm().
| char * G_store_lower | ( | const char * | s | ) |
Copy string to allocated memory and convert copied string to lower case.
This routine allocates enough memory to hold the string s, copies s to the allocated memory, and returns a pointer to the allocated memory.
If s is NULL then empty string is returned.
| s | string |
Definition at line 141 of file strings.c.
References G_store(), and G_str_to_lower().
Referenced by GPJ_init_transform().
| char * G_store_upper | ( | const char * | s | ) |
Copy string to allocated memory and convert copied string to upper case.
This routine allocates enough memory to hold the string s, copies s to the allocated memory, and returns a pointer to the allocated memory.
If s is NULL then empty string is returned.
| s | string |
Definition at line 117 of file strings.c.
References G_store(), and G_str_to_upper().
Referenced by GPJ_init_transform().
| char * G_str_concat | ( | const char ** | src_strings, |
| int | num_strings, | ||
| const char * | sep, | ||
| int | maxsize ) |
String concatenation.
Concatenates the strings in src_strings, which consists of num_strings number of strings, with the separator sep. The size of the concatenated string is limited by maxsize.
| src_strings | array of strings to concatenate |
| num_strings | count of strings in src_strings |
| sep | separator string |
| maxsize | maximum number of characters of returned string |
| char * G_str_replace | ( | const char * | buffer, |
| const char * | old_str, | ||
| const char * | new_str ) |
Replace all occurrences of old_str in buffer with new_str.
Code example:
| buffer | input string buffer |
| old_str | string to be replaced |
| new_str | new string |
| void G_str_to_lower | ( | char * | str | ) |
Convert string to lower case.
| [in,out] | str | pointer to string |
Definition at line 382 of file strings.c.
Referenced by G_store_lower().
| int G_str_to_sql | ( | char * | str | ) |
| void G_str_to_upper | ( | char * | str | ) |
Convert string to upper case.
| [in,out] | str | pointer to string |
Definition at line 364 of file strings.c.
Referenced by G_store_upper().
| int G_strcasecmp | ( | const char * | x, |
| const char * | y ) |
String compare ignoring case (upper or lower)
Returning a value that has the same sign as the difference between the first differing pair of characters.
Note: strcasecmp() is affected by the locale (LC_CTYPE), while G_strcasecmp() isn't.
| x | first string to compare |
| y | second string to compare |
Definition at line 47 of file strings.c.
References x.
Referenced by AS_option_to_algorithm(), Cairo_Graph_set(), check_mapset_in_layer_name(), clean_dir(), G_basename(), G_compare_projections(), G_compressor_number(), G_get_datum_by_name(), G_get_ellipsoid_by_name(), G_get_spheroid_by_name(), G_init_logging(), G_parser(), G_str_to_color(), GPJ_get_datum_by_name(), GPJ_get_datum_transform_by_name(), GPJ_get_ellipsoid_by_name(), GPJ_grass_to_osr(), GPJ_osr_to_grass(), M_do_copy(), M_do_remove(), M_do_rename(), M_get_element(), PNG_Graph_set(), PS_Graph_set(), read_image(), S_read(), and write_image().
| char * G_strcasestr | ( | const char * | str, |
| const char * | substr ) |
Finds the first occurrence of the sub-string in the null-terminated string ignoring case (upper or lower)
| str | string where to find sub-string |
| substr | sub-string |
Definition at line 476 of file strings.c.
References G_strncasecmp(), and NULL.
| char * G_strchg | ( | char * | bug, |
| char | character, | ||
| char | new ) |
| void G_strip | ( | char * | buf | ) |
Removes all leading and trailing white space from string.
| [in,out] | buf | buffer to be worked on |
Definition at line 299 of file strings.c.
References b.
Referenced by G_fread_key_value(), G_read_datum_table(), G_read_ellipsoid_table(), GPJ_get_datum_transform_by_name(), M_read_list(), read_datum_table(), and read_ellipsoid_table().
| int G_strncasecmp | ( | const char * | x, |
| const char * | y, | ||
| int | n ) |
String compare ignoring case (upper or lower) - limited number of characters.
Returning a value that has the same sign as the difference between the first differing pair of characters.
Note: strcasecmp() is affected by the locale (LC_CTYPE), while G_strcasecmp() isn't.
| x | first string to compare |
| y | second string to compare |
| n | number or characters to compare |
Definition at line 69 of file strings.c.
References x.
Referenced by check_create_export_opts(), check_create_import_opts(), G__json(), and G_strcasestr().