00001 /* 00002 * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). 00003 * s_misc.h: A header for the miscellaneous functions. 00004 * 00005 * Copyright (C) 2002 by the past and present ircd coders, and others. 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 * USA 00021 * 00022 * $Id: s_misc.h 33 2005-10-02 20:50:00Z knight $ 00023 */ 00024 00025 #ifndef INCLUDED_s_misc_h 00026 #define INCLUDED_s_misc_h 00027 00028 extern char *date(time_t); 00029 extern char *small_file_date(time_t); 00030 extern const char *smalldate(time_t); 00031 #ifdef HAVE_LIBCRYPTO 00032 extern char *ssl_get_cipher(SSL *); 00033 #endif 00034 00035 #define _1MEG (1024.0) 00036 #define _1GIG (1024.0*1024.0) 00037 #define _1TER (1024.0*1024.0*1024.0) 00038 #define _GMKs(x) (((x) > _1TER) ? "Terabytes" : (((x) > _1GIG) ? "Gigabytes" :\ 00039 (((x) > _1MEG) ? "Megabytes" : "Kilobytes"))) 00040 #define _GMKv(x) (((x) > _1TER) ? (float)((x)/_1TER) : (((x) > _1GIG) ? \ 00041 (float)((x)/_1GIG) : (((x) > _1MEG) ? (float)((x)/_1MEG) : \ 00042 (float)(x)))) 00043 #endif