Files
wget2/libwget/private.h
Tim Rühsen 0fe5f9282d New function wget_logger_is_active()
* include/wget/wget.h: Add prototype
* libwget/Makefile.am: Add logger.h
* libwget/log.c: Include logger.h
* libwget/logger.c: Include logger.h, add wget_logger_is_active()
* libwget/net.c: Use wget_logger_is_active()
* libwget/private.h: Remove struct _wget_logger_st
2017-01-23 16:55:52 +01:00

59 lines
1.9 KiB
C

/*
* Copyright(c) 2012 Tim Ruehsen
* Copyright(c) 2015-2016 Free Software Foundation, Inc.
*
* This file is part of libwget.
*
* Libwget 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 3 of the License, or
* (at your option) any later version.
*
* Libwget 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 Libwget. If not, see <http://www.gnu.org/licenses/>.
*
*
* Header file for memory allocation routines
*
* Changelog
* 25.06.2012 Tim Ruehsen
*
*/
#ifndef _LIBWGET_PRIVATE_H
# define _LIBWGET_PRIVATE_H
# include <stdio.h> // needed for FILE
# include <stdlib.h> // needed for free()
# include <stdarg.h> // needed for va_list
// I try to never leave freed pointers hanging around
# define xfree(a) do { if (a) { free((void *)(a)); a=NULL; } } while (0)
// number of elements within an array
# define countof(a) (sizeof(a)/sizeof(*(a)))
// allow us to use wget_* functions without it's wget_ prefix within the library code
// #define _WGET_PREFIX wget_
//#define _WGET_CONCAT(a,b) a ## b
//#define _WGET_CONCAT2(a,b) _WGET_CONCAT(a,b)
// #define _GET_ADDPREFIX(a) _WGET_CONCAT2(_WGET_PREFIX,a)
// #define xmalloc _WGET_ADDPREFIX(xmalloc)
# define xmalloc wget_malloc
# define xcalloc wget_calloc
# define xrealloc wget_realloc
# define info_printf wget_info_printf
# define error_printf wget_error_printf
# define error_printf_exit wget_error_printf_exit
# define debug_printf wget_debug_printf
# define debug_write wget_debug_write
#endif /* _LIBWGET_PRIVATE_H */