00001 /*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- 00002 * 00003 * librsync -- library for network deltas 00004 * $Id: util.h,v 1.1.1.1 2002/01/25 22:15:09 kergoth Exp $ 00005 * 00006 * Copyright (C) 1999, 2000, 2001 by Martin Pool <mbp@samba.org> 00007 * Copyright (C) 1999 by Andrew Tridgell <tridge@samba.org> 00008 * 00009 * This program is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public License 00011 * as published by the Free Software Foundation; either version 2.1 of 00012 * the License, or (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, but 00015 * WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00022 */ 00023 00024 00025 void * rs_alloc(size_t size, char const *name); 00026 void *rs_alloc_struct0(size_t size, char const *name); 00027 00028 void rs_bzero(void *buf, size_t size); 00029 00030 00031 /* 00032 * Allocate and zero-fill an instance of TYPE. 00033 */ 00034 #define rs_alloc_struct(type) \ 00035 ((type *) rs_alloc_struct0(sizeof(type), #type)) 00036 00037 00038 #ifdef __GNUC__ 00039 # define UNUSED(x) x __attribute__((unused)) 00040 #elif __LCLINT__ 00041 # define UNUSED(x) /*@unused@*/ x 00042 #else /* !__GNUC__ && !__LCLINT__ */ 00043 # define UNUSED(x) x 00044 #endif /* !__GNUC__ && !__LCLINT__ */
1.4.2