do {
api = token(&nest, &s);
gv_api = gvplugin_api(api);
- if (gv_api == -1) {
- agerr(AGERR, "invalid api in config: %s %s\n", path, api);
- return 0;
- }
do {
if (nest == 2) {
type = token(&nest, &s);
/* translate api_t into string name, or NULL */
char *gvplugin_api_name(api_t api)
{
- if (api < 0 || api >= ARRAY_SIZE(api_names))
+ if (api >= ARRAY_SIZE(api_names))
return NULL;
return api_names[api];
}
#define TYPSIZ 63
char *p, pins[TYPSIZ + 1], pnxt[TYPSIZ + 1];
- if (api < 0)
- return FALSE;
-
strncpy(pins, typestr, TYPSIZ);
if ((p = strchr(pins, ':')))
*p = '\0';
{
gvplugin_available_t **pnext;
-
- if (api < 0)
- return FALSE;
-
/* point to the beginning of the linked list of plugins for this api */
pnext = &(gvc->apis[api]);
int i;
api_t apidep;
- /* check for valid apis[] index */
- if (api < 0)
- return NULL;
-
if (api == API_device || api == API_loadimage)
/* api dependencies - FIXME - find better way to code these *s */
apidep = API_render;
boolean new = TRUE;
static agxbuf xb;
- /* check for valid apis[] index */
- if (api < 0)
- return NULL;
-
/* check for valid str */
if (!str)
return NULL;