MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cgiGetArray

Function cgiGetArray

cgi-bin/var.c:164–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 */
163
164char * /* O - Element value or NULL */
165cgiGetArray(const char *name, /* I - Name of array variable */
166 int element) /* I - Element number (0 to N) */
167{
168 _cgi_var_t *var; /* Pointer to variable */
169
170
171 if ((var = cgi_find_variable(name)) == NULL)
172 return (NULL);
173
174 if (element < 0 || element >= var->nvalues)
175 return (NULL);
176
177 if (var->values[element] == NULL)
178 return (NULL);
179
180 return (strdup(var->values[element]));
181}
182
183
184/*

Callers 3

cgiCheckVariablesFunction · 0.85
cgi_copyFunction · 0.85
do_am_classFunction · 0.85

Calls 1

cgi_find_variableFunction · 0.85

Tested by

no test coverage detected