📄 common.c
字号:
/* $Id: common.c 16856 2006-08-19 01:13:25Z evands $ *//* * (C) Copyright 2001-2002 Wojtek Kaniewski <wojtekka@irc.pl> * Robert J. Wo糿y <speedy@ziew.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License Version * 2.1 as published by the Free Software Foundation. * * 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, * USA. */#ifndef _WIN32#include <sys/types.h>#include <sys/ioctl.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#ifdef sun# include <sys/filio.h>#endif#endif#include <errno.h>#include <fcntl.h>#ifndef _WIN32#include <netdb.h>#endif#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include "libgadu.h"FILE *gg_debug_file = NULL;#ifndef GG_DEBUG_DISABLE/* * gg_debug() // funkcja wewn阾rzna * * wy秝ietla komunikat o danym poziomie, o ile u縴tkownik sobie tego 縴czy. * * - level - poziom wiadomo禼i * - format... - tre舵 wiadomo禼i (kompatybilna z printf()) */void gg_debug(int level, const char *format, ...){ va_list ap; int old_errno = errno; if (gg_debug_handler) { va_start(ap, format); (*gg_debug_handler)(level, format, ap); va_end(ap); goto cleanup; } if ((gg_debug_level & level)) { va_start(ap, format); vfprintf((gg_debug_file) ? gg_debug_file : stderr, format, ap); va_end(ap); }cleanup: errno = old_errno;}#endif/* * gg_vsaprintf() // funkcja pomocnicza * * robi dok砤dnie to samo, co vsprintf(), tyle 縠 alokuje sobie wcze秐iej * miejsce na dane. powinno dzia砤
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -