static void findTag (const char *const name, const int options)
{
	tagFileInfo info;
	tagEntry entry;
	tagFile *const file = tagsOpen (TagFileName, &info);
	if (file == NULL)
	{
		fprintf (stderr, "%s: cannot open tag file: %s: %s\n",
			ProgramName, strerror (info.status.error_number), name);
		exit (1);
	}
	else
	{
		if (SortOverride)
			tagsSetSortType (file, SortMethod);
		if (tagsFind (file, &entry, name, options) == TagSuccess)
		{
			do
			{
				printTag (&entry);
			} while (tagsFindNext (file, &entry) == TagSuccess);
		}
		tagsClose (file);
	}
}
Beispiel #2
0
static void findTag (const char *const name, const int options)
{
	tagFileInfo info;
	tagEntry entry;
	tagFile *const file = tagsOpen (TagFileName, &info);
	if (file == NULL)
	{
		fprintf (stderr, "%s: cannot open tag file: %s: %s\n",
				ProgramName, strerror (info.status.error_number), name);
		exit (1);
	}
	else
	{
		if (SortOverride)
			tagsSetSortType (file, SortMethod);
		if (debugMode)
			fprintf (stderr, "%s: searching for \"%s\" in \"%s\"\n",
					 ProgramName, name, TagFileName);
		if (tagsFind (file, &entry, name, options) == TagSuccess)
		{
			do
			{
#ifdef QUALIFIER
				if (Qualifier)
				{
					int i = q_is_acceptable (Qualifier, &entry);
					switch (i)
					{
					case Q_REJECT:
						continue;
					case Q_ERROR:
						exit (1);
					}
				}
#endif
				printTag (&entry);
			} while (tagsFindNext (file, &entry) == TagSuccess);
		}
		tagsClose (file);
	}
}