From f9b5245da125cfa51849ae6782b567b4f60fc07e Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 13 Dec 2000 15:14:26 +0000 Subject: [PATCH] Renamed unregsig module to signature. Now that Petidomo is released under GPL, there is no such thing as an "unregistered" version anymore. --- signature.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++ unregsig.c | 79 -------------------------------------------- unregsig.h | 12 ------- 3 files changed, 94 insertions(+), 91 deletions(-) create mode 100644 signature.c delete mode 100644 unregsig.c delete mode 100644 unregsig.h diff --git a/signature.c b/signature.c new file mode 100644 index 0000000..373858b --- /dev/null +++ b/signature.c @@ -0,0 +1,94 @@ +/* + * $Source$ + * $Revision$ + * $Date$ + * + * Copyright (c) 1996-99 by CyberSolutions GmbH, Germany. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by CyberSolutions GmbH. + * + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#ifndef RUSAGE_SELF +# define RUSAGE_SELF 0 +#endif +#ifndef RUSAGE_CHILDREN +# define RUSAGE_CHILDREN -1 +#endif + +#include "petidomo.h" + +void +AppendSignature(FILE * fh) +{ + const struct PD_Config * MasterConfig = getMasterConfig(); + struct utsname machine_name; + struct rusage resource_usage; + + if (MasterConfig->show_stats == TRUE) { + + /* Start with the part of the signature that never fails. */ + + fflush(fh); + fprintf(fh, "\n\n-- \n"); + fprintf(fh, " /*\n"); + fprintf(fh, " * Listserver software: OpenPetidomo\n"); + + /* Determine what machine we are. */ + + if (uname(&machine_name) == 0) { + fprintf(fh, " * Server hardware : %s-%s\n", + machine_name.sysname, + machine_name.machine); + } + + /* Determine our resource usage. */ + + getrusage(RUSAGE_SELF, &resource_usage); + + fprintf(fh, " * Utilized cpu time : %ld.%ld seconds\n", + resource_usage.ru_utime.tv_sec + resource_usage.ru_stime.tv_sec, + resource_usage.ru_utime.tv_usec + resource_usage.ru_stime.tv_usec); + fprintf(fh, " * Utilized memory : %ld KByte\n", + (resource_usage.ru_idrss > 0) ? resource_usage.ru_idrss : + (long int)sbrk(0) / 1024); + + /* Close signature. */ + + fprintf(fh, " */\n"); + fflush(fh); + + } +} diff --git a/unregsig.c b/unregsig.c deleted file mode 100644 index 414e49d..0000000 --- a/unregsig.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * $Source$ - * $Revision$ - * $Date$ - * - * Copyright (C) 1996 by CyberSolutions GmbH. - * All rights reserved. - */ - -#include -#include -#include -#include -#include -#ifndef RUSAGE_SELF -# define RUSAGE_SELF 0 -#endif -#ifndef RUSAGE_CHILDREN -# define RUSAGE_CHILDREN -1 -#endif - -#include -#include "version.h" - -void -AppendSignature(FILE * fh) -{ -#ifdef COMMERCIAL_VERSION - const struct PD_Config * MasterConfig = getMasterConfig(); -#endif - struct utsname machine_name; - struct rusage resource_usage; - -#ifdef COMMERCIAL_VERSION - char whoami[] = VERS " (commercial)"; -#else - char whoami[] = VERS " (non-commercial)"; -#endif - whoami[0] = 'P'; /* cosmetics */ - -#ifdef COMMERCIAL_VERSION - if (MasterConfig->show_stats == TRUE) { -#endif - - /* Start with the part of the signature that never fails. */ - - fflush(fh); - fprintf(fh, "\n\n-- \n"); - fprintf(fh, " /*\n"); - fprintf(fh, " * Listserver software: %s\n", whoami); - - /* Determine what machine we are. */ - - if (uname(&machine_name) == 0) { - fprintf(fh, " * Server hardware : %s-%s\n", - machine_name.sysname, - machine_name.machine); - } - - /* Determine our resource usage. */ - - getrusage(RUSAGE_SELF, &resource_usage); - - fprintf(fh, " * Utilized cpu time : %ld.%ld seconds\n", - resource_usage.ru_utime.tv_sec + resource_usage.ru_stime.tv_sec, - resource_usage.ru_utime.tv_usec + resource_usage.ru_stime.tv_usec); - fprintf(fh, " * Utilized memory : %ld KByte\n", - (resource_usage.ru_idrss > 0) ? resource_usage.ru_idrss : - (long int)sbrk(0) / 1024); - - /* Close signature. */ - - fprintf(fh, " */\n"); - fflush(fh); - -#ifdef COMMERCIAL_VERSION - } -#endif -} diff --git a/unregsig.h b/unregsig.h deleted file mode 100644 index 8f1086c..0000000 --- a/unregsig.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * $Source$ - * $Revision$ - * $Date$ - * - * Copyright (C) 1996 by CyberSolutions GmbH. - * All rights reserved. - */ - -#include - -void AppendSignature(FILE * fh);