X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=blobdiff_plain;f=sources%2FIPCTestId.c;fp=sources%2FIPCTestId.c;h=0000000000000000000000000000000000000000;hb=d12bc3e1e4b3ee762036d1c226c3b2ba1a720fb9;hp=2aa66ee03d5e450c6bcdfbc94586b8c8babfaf45;hpb=e3e15ed6d698e5cc35f3b7f4c5db96adc38255c3;p=gapil.git diff --git a/sources/IPCTestId.c b/sources/IPCTestId.c deleted file mode 100644 index 2aa66ee..0000000 --- a/sources/IPCTestId.c +++ /dev/null @@ -1,145 +0,0 @@ -/* IPCTestId.c - * - * Copyright (C) 2001 Simone Piccardi - * - * This program 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 2 of the License, or (at - * your option) any later version. - * - * 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/**************************************************************** - * - * Program IPCTestId.c: - * Program to test IPC identifiers - * - * Author: Simone Piccardi - * Aug. 2002 - * - * Usage: ipctestid -h give all info's - * - * $Id: IPCTestId.c,v 1.2 2002/08/19 17:34:23 piccardi Exp $ - * - ****************************************************************/ -/* - * Include needed headers - */ -#include /* error definitions and routines */ -#include /* C standard library */ -#include /* unix standard library */ -#include /* standard I/O library */ -#include /* string functions */ -#include /* SysV IPC functions */ -#include /* SysV Message Queue */ -#include /* SysV Semaphores */ -#include /* SysV Shared Memory */ - -#include "macros.h" /* My macros */ -/* Help printing routine */ -void usage(void); - -int main(int argc, char *argv[]) -{ -/* - * Variables definition - */ - int i; - int n = 5; /* default is 10 tryes */ - char type='q'; /* default is use queues */ - int id; - /* - * Input section: decode command line parameters - * Use getopt function - */ - opterr = 0; /* don't want writing to stderr */ - while ( (i = getopt(argc, argv, "hqsmn:")) != -1) { - switch (i) { - /* - * Handling options - */ - case 'h': /* help option */ - printf("Wrong -h option use\n"); - usage(); - return -1; - break; - case 'q': /* Message Queue */ - debug("Message Queue\n"); - type = i; - break; - case 's': /* Semaphore */ - debug("Semaphore\n"); - type = i; - break; - case 'm': /* Shared Memory */ - debug("Shared Memory\n"); - type = i; - break; - case 'n': /* Number of tryes */ - debug("Number of tryes\n"); - n = strtol(optarg, NULL, 10); - break; - default: /* should not reached */ - usage(); - } - } - /* *********************************************************** - * - * Options processing completed - * - * Main code beginning - * - * ***********************************************************/ - switch (type) { - case 'q': /* Message Queue */ - debug("Message Queue Try\n"); - for (i=0; i