⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logger.c

📁 ShowLyric是一款用于Audacious的歌词显示插件
💻 C
字号:
/*  * * Author: Allan <qimingos_lsk@163.com>, (C) 2005-2007 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA * */#include <stdio.h>#include <glib.h>#include <string.h>#include "../include/Version.h"#include "../include/Defines.h"int StrLeftFind(gchar* szFrom, int iFrom, gchar ch){	gchar* pWork = szFrom + strlen(szFrom) - 1 - iFrom;	while (pWork >= szFrom)	{		if (*pWork == ch)			return (int)(pWork - szFrom);		pWork--;	}	return -1;}void LyricDebug(const gchar * format, ...){#ifdef LYRIC_DEBUG	va_list args;	gchar szBuf[512] =	{ 0 };	va_start(args, format);	vsnprintf(szBuf, 511, format, args);	va_end(args);	fprintf(stderr, "%s(%s): %s\n", PLUGIN_NAME, VERSION, szBuf);#endif // LYRIC_DEBUG}void LyricLog(const gchar * format, ...){#ifdef LYRIC_LOG	va_list args;	gchar szBuf[512] =	{ 0 };	va_start(args, format);	vsnprintf(szBuf, 511, format, args);	va_end(args);	char szLogFileName[512] =	{ 0 };	sprintf(szLogFileName, "%s/log.txt", theApp.m_szConfigPath);	FILE * f = fopen(szLogFileName, "a+");	fprintf(f, "%s(%s):%s\n", PLUGIN_NAME, VERSION, szBuf);	fprintf(stderr, "%s(%s): %s\n", PLUGIN_NAME, VERSION, szBuf);	fclose(f);#endif}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -