extern void writePseudoTag ( const char *const tagName, const char *const fileName, const char *const pattern, const char *const language) { const int length = language ? fprintf (TagFile.fp, "%s%s%s%s\t%s\t%s\n", PSEUDO_TAG_PREFIX, tagName, PSEUDO_TAG_SEPARATOR, language, fileName, pattern) : fprintf (TagFile.fp, "%s%s\t%s\t/%s/\n", PSEUDO_TAG_PREFIX, tagName, fileName, pattern); abort_if_ferror (TagFile.fp); ++TagFile.numTags.added; rememberMaxLengths (strlen (tagName), (size_t) length); }
extern void closeTagFile (const boolean resize) { long desiredSize, size; if (Option.etags) writeEtagsIncludes (TagFile.fp); abort_if_ferror (TagFile.fp); desiredSize = ftell (TagFile.fp); fseek (TagFile.fp, 0L, SEEK_END); size = ftell (TagFile.fp); if (fclose (TagFile.fp) != 0) error (FATAL | PERROR, "cannot close tag file"); if (resize && desiredSize < size) { DebugStatement ( debugPrintf (DEBUG_STATUS, "shrinking %s from %ld to %ld bytes\n", TagFile.name, size, desiredSize); )
extern void writePseudoTag (const struct sPtagDesc *desc, const char *const fileName, const char *const pattern, const char *const parserName) { const int length = parserName #define OPT(X) ((X)?(X):"") ? fprintf (TagFile.fp, "%s%s%s%s\t%s\t%s\n", PSEUDO_TAG_PREFIX, desc->name, PSEUDO_TAG_SEPARATOR, parserName, OPT(fileName), OPT(pattern)) : fprintf (TagFile.fp, "%s%s\t%s\t/%s/\n", PSEUDO_TAG_PREFIX, desc->name, OPT(fileName), OPT(pattern)); #undef OPT abort_if_ferror (TagFile.fp); ++TagFile.numTags.added; rememberMaxLengths (strlen (desc->name), (size_t) length); }