Ejemplo n.º 1
0
static void addPseudoTags (void)
{
	if (! Option.xref)
	{
		char format [11];
		const char *formatComment = "unknown format";
#ifdef KANJI
		const char *encoding = NULL;
#endif

		sprintf (format, "%u", Option.tagFileFormat);

		if (Option.tagFileFormat == 1)
			formatComment = "original ctags format";
		else if (Option.tagFileFormat == 2)
			formatComment =
				"extended format; --format=1 will not append ;\" to lines";

		writePseudoTag ("TAG_FILE_FORMAT", format, formatComment);
		writePseudoTag ("TAG_FILE_SORTED",
			Option.sorted == SO_FOLDSORTED ? "2" :
			(Option.sorted == SO_SORTED ? "1" : "0"),
			"0=unsorted, 1=sorted, 2=foldcase");
		writePseudoTag ("TAG_PROGRAM_AUTHOR",  AUTHOR_NAME,  AUTHOR_EMAIL);
		writePseudoTag ("TAG_PROGRAM_NAME",    PROGRAM_NAME, "");
		writePseudoTag ("TAG_PROGRAM_URL",     PROGRAM_URL,  "official site");
#ifndef KANJI
		writePseudoTag ("TAG_PROGRAM_VERSION", PROGRAM_VERSION, "");
#else
		writePseudoTag ("TAG_PROGRAM_JP_AUTHOR",
					JP_AUTHOR_NAME, JP_AUTHOR_TWITTER);
		writePseudoTag ("TAG_PROGRAM_JP_URL",	JP_AUTHOR_URL, "");
		writePseudoTag ("TAG_PROGRAM_VERSION",
					PROGRAM_VERSION PROGRAM_JP_VERSION, "");

		switch (Option.jcode)
		{
			case JCODE_ASCII:	break;
			case JCODE_SJIS:	encoding = "cp932";		break;
			case JCODE_EUC:		encoding = "euc-jp";	break;
			case JCODE_UTF8:	encoding = "utf-8";		break;
		}

		if (encoding != NULL)
		{
			writePseudoTag ("TAG_FILE_ENCODING", encoding, "");
		}
#endif
	}
}
Ejemplo n.º 2
0
Archivo: entry.c Proyecto: jonthn/ctags
static void addPseudoTags (void)
{
	if (! Option.xref)
	{
		char format [11];
		const char *formatComment = "unknown format";
		const char* repoinfo;

		sprintf (format, "%u", Option.tagFileFormat);

		if (Option.tagFileFormat == 1)
			formatComment = "original ctags format";
		else if (Option.tagFileFormat == 2)
			formatComment =
				"extended format; --format=1 will not append ;\" to lines";

		writePseudoTag ("TAG_FILE_FORMAT", format, formatComment, NULL);
		writePseudoTag ("TAG_FILE_SORTED",
			Option.sorted == SO_FOLDSORTED ? "2" :
			(Option.sorted == SO_SORTED ? "1" : "0"),
			"0=unsorted, 1=sorted, 2=foldcase",
			NULL);
		writePseudoTag ("TAG_PROGRAM_AUTHOR",  AUTHOR_NAME,  "", NULL);
		writePseudoTag ("TAG_PROGRAM_NAME",    PROGRAM_NAME, "Derived from Exuberant Ctags", NULL);
		writePseudoTag ("TAG_PROGRAM_URL",     PROGRAM_URL,  "official site", NULL);
		repoinfo = ctags_repoinfo? ctags_repoinfo: "";
		writePseudoTag ("TAG_PROGRAM_VERSION", PROGRAM_VERSION, repoinfo, NULL);

#ifdef HAVE_ICONV
		if (Option.outputEncoding)
			writePseudoTag ("TAG_FILE_ENCODING", Option.outputEncoding, "", NULL);
#endif
	}
}
Ejemplo n.º 3
0
static void addPseudoTags (void)
{
	if (! Option.xref)
	{
		char format [11];
		const char *formatComment = "unknown format";

		sprintf (format, "%u", Option.tagFileFormat);

		if (Option.tagFileFormat == 1)
			formatComment = "original ctags format";
		else if (Option.tagFileFormat == 2)
			formatComment =
				"extended format; --format=1 will not append ;\" to lines";

		writePseudoTag ("TAG_FILE_FORMAT", format, formatComment);
		writePseudoTag ("TAG_FILE_SORTED",
			Option.sorted == SO_FOLDSORTED ? "2" :
			(Option.sorted == SO_SORTED ? "1" : "0"),
			"0=unsorted, 1=sorted, 2=foldcase");
		writePseudoTag ("TAG_PROGRAM_AUTHOR",  AUTHOR_NAME,  AUTHOR_EMAIL);
		writePseudoTag ("TAG_PROGRAM_NAME",    PROGRAM_NAME, "");
		writePseudoTag ("TAG_PROGRAM_URL",     PROGRAM_URL,  "official site");
		writePseudoTag ("TAG_PROGRAM_VERSION", PROGRAM_VERSION, "");
	}
}
Ejemplo n.º 4
0
static void writePseudoTagForXcmdData (ptagDesc *desc,
				       struct ptagXcmdData *pdata)
{
	writePseudoTag (desc,
			pdata->fileName,  pdata->pattern, pdata->language);
}