1359d9856e982d83be761f3501bd6a87c046dee6 angie Mon Apr 15 15:56:56 2013 -0700 Added determination of data type by asObject comparison instead ofkludges like special annoRowType or checking a few column names. refs #6152 diff --git src/inc/asParse.h src/inc/asParse.h index 8427c83..6616884 100644 --- src/inc/asParse.h +++ src/inc/asParse.h @@ -109,16 +109,30 @@ struct asColumn *asColumnFind(struct asObject *as, char *name); /* Return column of given name from object, or NULL if not found. */ int asColumnFindIx(struct asColumn *list, char *name); /* Return index of first element of asColumn list that matches name. * Return -1 if not found. */ boolean asCompareObjs(char *name1, struct asObject *as1, char *name2, struct asObject *as2, int numColumnsToCheck, int *retNumColumnsSame, boolean abortOnDifference); /* Compare as-objects as1 and as2 making sure several important fields show they are the same name and type. * If difference found, print it to stderr. If abortOnDifference, errAbort. * Othewise, return TRUE if the objects columns match through the first numColumnsToCheck fields. * If retNumColumnsSame is not NULL, then it will be set to the number of contiguous matching columns. */ +INLINE boolean asObjectsMatchFirstN(struct asObject *as1, struct asObject *as2, int n) +/* Return TRUE if as1 has the same first n columns as as2. */ +{ +return asCompareObjs(as1->name, as1, as2->name, as2, n, NULL, FALSE); +} + +INLINE boolean asObjectsMatch(struct asObject *as1, struct asObject *as2) +{ +int colCount = slCount(as1->columnList); +if (slCount(as2->columnList) != colCount) + return FALSE; +return asCompareObjs(as1->name, as1, as2->name, as2, colCount, NULL, FALSE); +} + #endif /* ASPARSE_H */