|
mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
|
Go to the source code of this file.
Functions | |
| double | min_max_double_opt (const char *opt_arg, const char *opt_type_name, double minimum, double maximum) |
| Parse and validate a double command-line or config option against optional bounds. | |
| int | min_max_int_opt (const char *opt_arg, const char *opt_type_name, int minimum, int maximum) |
| Parse and validate an int command-line or config option against optional bounds. | |
| void | free_map_section (xmlconfigitem *map_section) |
| Free all heap-allocated string fields inside a single xmlconfigitem and zero the struct. | |
| void | free_map_sections (xmlconfigitem *map_sections) |
| Free all populated entries in an array of XMLCONFIGS_MAX map configurations. | |
| void | free_renderd_section (renderd_config *renderd_section) |
| Free all heap-allocated string fields inside a single renderd_config and zero the struct. | |
| void | free_renderd_sections (renderd_config *renderd_sections) |
| Free all populated entries in an array of MAX_SLAVES renderd instance configurations. | |
| void | process_config_file (const char *config_file_name, int active_renderd_section_num, int log_level) |
| Load and parse a complete renderd.conf file and populate global configuration state. | |
| void | process_map_sections (const dictionary *ini, const char *config_file_name, xmlconfigitem *maps_dest, const char *default_tile_dir, int num_threads) |
| Parse all map style sections from a renderd.conf INI file into maps_dest[]. | |
| void | process_mapnik_section (const dictionary *ini, const char *config_file_name, renderd_config *config_dest) |
| Parse the [mapnik] section from a renderd.conf INI file into config_dest. | |
| void | process_renderd_sections (const dictionary *ini, const char *config_file_name, renderd_config *configs_dest) |
| Parse all [renderd] and [renderdN] sections from a renderd.conf INI file. | |
Variables | |
| int | num_maps |
| Total number of map style sections parsed into maps[]. | |
| int | num_slave_threads |
| Sum of num_threads across all inactive (slave) [renderdN] sections. | |
| renderd_config * | config |
| Pointer to the active renderd_config entry inside config_slaves[]. | |
| renderd_config | config_slaves [5] |
| Array of parsed [renderd] / [renderdN] instance configurations indexed by section number. | |
| xmlconfigitem | maps [100] |
| Array of parsed map style configurations ([default], etc.) up to XMLCONFIGS_MAX. | |
| void free_map_section | ( | xmlconfigitem * | map_section | ) |
Free all heap-allocated string fields inside a single xmlconfigitem and zero the struct.
| map_section | Pointer to the xmlconfigitem structure to release. |
| void free_map_sections | ( | xmlconfigitem * | map_sections | ) |
Free all populated entries in an array of XMLCONFIGS_MAX map configurations.
| map_sections | Array of xmlconfigitem structures (XMLCONFIGS_MAX elements). |
| void free_renderd_section | ( | renderd_config * | renderd_section | ) |
Free all heap-allocated string fields inside a single renderd_config and zero the struct.
| renderd_section | Pointer to the renderd_config structure to release. |
| void free_renderd_sections | ( | renderd_config * | renderd_sections | ) |
Free all populated entries in an array of MAX_SLAVES renderd instance configurations.
| renderd_sections | Array of renderd_config structures (MAX_SLAVES elements). |
| double min_max_double_opt | ( | const char * | opt_arg, |
| const char * | opt_type_name, | ||
| double | minimum, | ||
| double | maximum ) |
Parse and validate a double command-line or config option against optional bounds.
Terminates the process with exit(1) if opt_arg cannot be parsed as a floating-point number or violates [minimum, maximum] (where -1 disables the corresponding bound check).
| opt_arg | Input string to parse as a double. |
| opt_type_name | Descriptive option name used in error log messages. |
| minimum | Inclusive lower bound, or -1 to skip lower-bound validation. |
| maximum | Inclusive upper bound, or -1 to skip upper-bound validation. |
| int min_max_int_opt | ( | const char * | opt_arg, |
| const char * | opt_type_name, | ||
| int | minimum, | ||
| int | maximum ) |
Parse and validate an int command-line or config option against optional bounds.
Rejects non-numeric strings as well as fractional numbers (by comparing strtol() and strtof() results), and enforces [minimum, maximum] (where -1 disables a bound check). Terminates with exit(1) on invalid input.
| opt_arg | Input string to parse as an int. |
| opt_type_name | Descriptive option name used in error log messages. |
| minimum | Inclusive lower bound, or -1 to skip lower-bound validation. |
| maximum | Inclusive upper bound, or -1 to skip upper-bound validation. |
| void process_config_file | ( | const char * | config_file_name, |
| int | active_renderd_section_num, | ||
| int | log_level ) |
Load and parse a complete renderd.conf file and populate global configuration state.
Orchestrates parsing of [renderd*] sections into config_slaves[], selects config = &config_slaves[active_renderd_section_num], parses [mapnik] into the active config, parses all map sections into maps[], totals num_slave_threads across non-active instances, and logs the effective runtime configuration.
| config_file_name | Filesystem path to renderd.conf. |
| active_renderd_section_num | Index (0 .. MAX_SLAVES - 1) of the [renderd*] section this process instance should run as. |
| log_level | GLib log level used to emit the parsed configuration summary. |
| void process_map_sections | ( | const dictionary * | ini, |
| const char * | config_file_name, | ||
| xmlconfigitem * | maps_dest, | ||
| const char * | default_tile_dir, | ||
| int | num_threads ) |
Parse all map style sections from a renderd.conf INI file into maps_dest[].
Treats every INI section whose name neither starts with "renderd" nor equals "mapnik" as a map configuration section. Parses tile dimensions, zoom range (0..MAX_ZOOM), scale factor (0.1..8.0), paths, HTCP settings, and space-delimited type (<ext> <mime> [format]), then verifies that at least one map exists and no earlier map's xmluri is a prefix of a later map's xmluri. Updates the global num_maps counter.
| ini | Pre-loaded iniparser dictionary, or NULL to load config_file_name locally. |
| config_file_name | Path to the configuration file (used for loading if ini == NULL and in logs). |
| maps_dest | Destination array of XMLCONFIGS_MAX xmlconfigitem entries. |
| default_tile_dir | Fallback tile directory inherited from the active [renderd] section. |
| num_threads | Active worker thread count propagated to each xmlconfigitem. |
| void process_mapnik_section | ( | const dictionary * | ini, |
| const char * | config_file_name, | ||
| renderd_config * | config_dest ) |
Parse the [mapnik] section from a renderd.conf INI file into config_dest.
Extracts font_dir_recurse, font_dir, and plugins_dir. Exits with code 1 if the [mapnik] section is missing.
| ini | Pre-loaded iniparser dictionary, or NULL to load config_file_name locally. |
| config_file_name | Path to the configuration file (used for loading if ini == NULL and in logs). |
| config_dest | Destination renderd_config structure receiving the Mapnik paths. |
| void process_renderd_sections | ( | const dictionary * | ini, |
| const char * | config_file_name, | ||
| renderd_config * | configs_dest ) |
Parse all [renderd] and [renderdN] sections from a renderd.conf INI file.
Maps [renderd] and [renderd0] to index 0, and [renderdN] (1 <= N < MAX_SLAVES) to index N in configs_dest[]. Resolves num_threads = -1 to the online CPU core count (sysconf(_SC_NPROCESSORS_ONLN)), validates Unix socket path length against sockaddr_un.sun_path, and rejects duplicate or out-of-range section indices.
| ini | Pre-loaded iniparser dictionary, or NULL to load config_file_name locally. |
| config_file_name | Path to the configuration file (used for loading if ini == NULL and in logs). |
| configs_dest | Destination array of MAX_SLAVES renderd_config entries. |
|
extern |
Pointer to the active renderd_config entry inside config_slaves[].
|
extern |
Array of parsed [renderd] / [renderdN] instance configurations indexed by section number.
|
extern |
Array of parsed map style configurations ([default], etc.) up to XMLCONFIGS_MAX.
|
extern |
Total number of map style sections parsed into maps[].
|
extern |
Sum of num_threads across all inactive (slave) [renderdN] sections.