a18f9612e9fdc813d6a8ae1653b4af004f5cb8a3 kent Thu Jan 22 14:55:22 2015 -0800 Adding maxDepth parameter to metaWriteAll. diff --git src/inc/meta.h src/inc/meta.h index b9bc371..5a09103 100644 --- src/inc/meta.h +++ src/inc/meta.h @@ -57,33 +57,35 @@ * use the parentTag (which must be set) to define the hierarchy. Otherwise the program * will look at the indentation, and if there is a parentTag complain about any * disagreements between indentation and parentTag. */ void metaFree(struct meta **pMeta); /* Free up memory associated with a meta. */ void metaFreeForest(struct meta **pForest); /* Free up all metas in forest and their children. */ void metaFreeList(struct meta **pList); /* Free a list of dynamically allocated meta's. Use metaFreeForest to free children too. */ #define META_DEFAULT_INDENT 4 /* Default size for meta indentation */ -void metaWriteAll(struct meta *metaList, char *fileName, int indent, boolean withParent); +void metaWriteAll(struct meta *metaList, char *fileName, int indent, boolean withParent, + int maxDepth); /* Write out metadata, including children, optionally adding meta tag. By convention - * for out meta.txt/meta.ra files, indent is 4, withParent is FALSE. */ + * for out meta.txt/meta.ra files, indent is 4, withParent is FALSE. If maxDepth is + * non-zero just write out up to that many levels. Root level is 0. */ char *metaLocalTagVal(struct meta *meta, char *tag); /* Return value of tag found in this node, not going up to parents. */ char *metaTagVal(struct meta *meta, char *tag); /* Return value of tag found in this node or if its not there in parents. * Returns NULL if tag not found. */ void metaAddTag(struct meta *meta, char *tag, char *val); /* Add tag/val to meta. */ void metaSortTags(struct meta *meta); /* Do canonical sort so that the first tag stays first but the * rest are alphabetical. */