FreeBSD/contrib/mdocml/tag.c
/*
 * Write out the tags file using the previously collected
 * information and clear the ohash table while going along.
 */
Write out the tags file using the previously collected
information and clear the ohash table while going along.
Write out the tags file using the previously collected information and clear the ohash table while going along .
void
tag_write(void)
{
	FILE			*stream;
	struct tag_entry	*entry;
	unsigned int		 slot;
	if (tag_files.tfd <= 0)
		return;
	stream = fdopen(tag_files.tfd, "w");
	entry = ohash_first(&tag_data, &slot);
	while (entry != NULL) {
		if (stream != NULL)
			fprintf(stream, "%s %s %zu\n",
			    entry->s, tag_files.ofn, entry->line);
		free(entry);
		entry = ohash_next(&tag_data, &slot);
	}
	ohash_delete(&tag_data);
	if (stream != NULL)
		fclose(stream);
}
void tag_write ( void ) { FILE * stream ; struct tag_entry * entry ; unsigned int slot ; if ( tag_files . tfd <= 0 ) return ; stream = fdopen ( tag_files . tfd , " " ) ; entry = ohash_first ( & tag_data , & slot ) ; while ( entry != NULL ) { if ( stream != NULL ) fprintf ( stream , " \n " , entry -> s , tag_files . ofn , entry -> line ) ; free ( entry ) ; entry = ohash_next ( & tag_data , & slot ) ; } ohash_delete ( & tag_data ) ; if ( stream != NULL ) fclose ( stream ) ; }
Write out the tags file using the previously collected
 information and clear the ohash table while going along.
Write out the tags file using the previously collected information and clear the ohash table while going along .