PGROUTING
3.2
|
Connecting code with postgres. More...
#include <stdbool.h>
#include "c_common/postgres_connection.h"
#include "utils/array.h"
#include "c_common/debug_macro.h"
#include "c_common/e_report.h"
#include "c_common/time_msg.h"
#include "c_common/edges_input.h"
#include "c_common/arrays_input.h"
#include "drivers/traversal/depthFirstSearch_driver.h"
Go to the source code of this file.
Functions | |
PGDLLEXPORT Datum | _pgr_depthfirstsearch (PG_FUNCTION_ARGS) |
Helps in converting postgres variables to C variables, and returns the result. More... | |
PG_FUNCTION_INFO_V1 (_pgr_depthfirstsearch) | |
static void | process (char *edges_sql, ArrayType *roots, bool directed, int64_t max_depth, pgr_mst_rt **result_tuples, size_t *result_count) |
Static function, loads the data from postgres to C types for further processing. More... | |
Connecting code with postgres.
Definition in file depthFirstSearch.c.
PGDLLEXPORT Datum _pgr_depthfirstsearch | ( | PG_FUNCTION_ARGS | ) |
Helps in converting postgres variables to C variables, and returns the result.
Definition at line 133 of file depthFirstSearch.c.
References pgr_mst_rt::agg_cost, pgr_mst_rt::cost, pgr_mst_rt::depth, pgr_mst_rt::edge, pgr_mst_rt::from_v, if(), pgr_mst_rt::node, and process().
PG_FUNCTION_INFO_V1 | ( | _pgr_depthfirstsearch | ) |
|
static |
Static function, loads the data from postgres to C types for further processing.
It first connects the C function to the SPI manager. Then converts the postgres array to C array and loads the edges belonging to the graph in C types. Then it calls the function do_pgr_depthFirstSearch
defined in the depthFirstSearch_driver.h
file for further processing. Finally, it frees the memory and disconnects the C function to the SPI manager.
edges_sql | the edges of the SQL query |
roots | the root vertices |
directed | whether the graph is directed or undirected |
max_depth | the maximum depth of traversal |
result_tuples | the rows in the result |
result_count | the count of rows in the result |
Definition at line 69 of file depthFirstSearch.c.
References do_pgr_depthFirstSearch(), pgr_get_bigIntArray(), pgr_get_edges(), pgr_global_report(), pgr_SPI_connect(), pgr_SPI_finish(), and time_msg().
Referenced by _pgr_depthfirstsearch().