MCPcopy Create free account
hub / github.com/Kitware/VTK / pj_param_exists

Function pj_param_exists

ThirdParty/libproj/vtklibproj/src/param.cpp:98–131  ·  view source on GitHub ↗

/

Source from the content-addressed store, hash-verified

96
97/**************************************************************************************/
98paralist *pj_param_exists (paralist *list, const char *parameter) {
99/***************************************************************************************
100 Determine whether a given parameter exists in a paralist. If it does, return
101 a pointer to the corresponding list element - otherwise return 0.
102
103 In support of the pipeline syntax, the search is terminated once a "+step" list
104 element is reached, in which case a 0 is returned, unless the parameter
105 searched for is actually "step", in which case a pointer to the "step" list
106 element is returned.
107
108 This function is equivalent to the pj_param (...) call with the "opt" argument
109 set to the parameter name preceeeded by a 't'. But by using this one, one avoids
110 writing the code allocating memory for a new copy of parameter name, and prepending
111 the t (for compile time known names, this is obviously not an issue).
112***************************************************************************************/
113 paralist *next = list;
114 const char *c = strchr (parameter, '=');
115 size_t len = strlen (parameter);
116 if (c)
117 len = c - parameter;
118 if (list==nullptr)
119 return nullptr;
120
121 for (next = list; next; next = next->next) {
122 if (0==strncmp (parameter, next->param, len) && (next->param[len]=='=' || next->param[len]==0)) {
123 next->used = 1;
124 return next;
125 }
126 if (0==strcmp (parameter, "step"))
127 return nullptr;
128 }
129
130 return nullptr;
131}
132
133
134/************************************************************************/

Callers 13

pj_paramFunction · 0.85
setup_pushpopFunction · 0.85
cs2cs_emulation_setupFunction · 0.85
PROJECTIONFunction · 0.85
axisswap.cppFile · 0.85
set.cppFile · 0.85
topocentric.cppFile · 0.85
read_conventionFunction · 0.85
helmert.cppFile · 0.85
PROJECTIONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected