#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
+#include <cgraph/startswith.h>
#include <common/types.h>
#include <common/utils.h>
#include "convert.h"
#define GXL_LOC "_gxl_locator_"
#define GXL_COMP_LEN (SLEN(GXL_COMP))
-#define GXL_LOC_LEN (SLEN(GXL_LOC))
typedef struct {
Agrec_t h;
static int isGxlGrammar(char *name)
{
- return (strncmp(name, GXL_ATTR, (sizeof(GXL_ATTR) - 1)) == 0);
+ return startswith(name, GXL_ATTR);
}
static int isLocatorType(char *name)
{
- return (strncmp(name, GXL_LOC, GXL_LOC_LEN) == 0);
+ return startswith(name, GXL_LOC);
}
static void *idexists(Dt_t * ids, char *id)
}
} else {
/* gxl attr; check for special cases like composites */
- if (strncmp(sym->name, GXL_COMP, GXL_COMP_LEN) == 0) {
+ if (startswith(sym->name, GXL_COMP)) {
if (EMPTY(sym->defval)) {
if (view == NULL)
continue;
}
} else {
/* gxl attr; check for special cases like composites */
- if (strncmp(sym->name, GXL_COMP, GXL_COMP_LEN) == 0) {
+ if (startswith(sym->name, GXL_COMP)) {
if (data->str[sym->id] != sym->defval) {
tabover(gxlFile);