* http://localhost/cgi-bin/barcode?string
* where string is the code to be converted
*
- * $Id: BarCode.c,v 1.9 2003/05/02 09:55:13 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <sys/stat.h> /* stat deinitiions */
-#include <unistd.h> /* include unix standard library */
-/* */
-#include <stdio.h> /* include standard I/O library */
-#include <stdlib.h> /* include standard library */
-#include <string.h> /* include string library */
-#include <wait.h> /* include wait call */
-#include <fcntl.h>
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
+#include <unistd.h> /* unix standard library */
+#include <stdio.h> /* standard I/O library */
+#include <stdlib.h> /* C standard library */
+#include <string.h> /* C strings library */
+#include <wait.h>
+#include <fcntl.h> /* file control functions */
#include <assert.h>
-#include <time.h>
+#include <time.h> /* date and time constants, types and functions */
#include"macros.h"
* http://localhost/cgi-bin/barcode?string
* where string is the code to be converted
*
- * $Id: BarCodePage.c,v 1.4 2003/05/02 09:55:13 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <sys/stat.h> /* stat deinitiions */
-#include <unistd.h> /* include unix standard library */
-#include <stdio.h> /* include standard I/O library */
-#include <stdlib.h> /* include standard library */
-#include <string.h> /* include string library */
-#include <wait.h> /* include wait call */
-#include <fcntl.h>
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
+#include <unistd.h> /* unix standard library */
+#include <stdio.h> /* standard I/O library */
+#include <stdlib.h> /* C standard library */
+#include <string.h> /* C strings library */
+#include <wait.h> /* */
+#include <fcntl.h> /* file control functions */
#include <assert.h>
-#include <time.h>
+#include <time.h> /* date and time constants, types and functions */
+
#include"macros.h"
void WriteMess(char *mess);
*
* Usage: errcode -h give all info's
*
- * $Id: ErrCode.c,v 1.8 2003/07/27 14:28:19 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
+#include <string.h> /* C strings library */
#include <limits.h> /* system limits values */
/* Help printing routine */
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
-#include <fcntl.h> /* string functions */
+#include <string.h> /* C strings library */
+#include <fcntl.h> /* file control functions */
+
+
/* user defined header */
#include "macros.h" /* some useful macros */
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
+#include <string.h> /* C strings library */
#include "Gapil.h"
#include "macros.h"
*
* Usage: fortune -h give all info
*
- * $Id: FortuneClient.c,v 1.4 2003/05/02 09:55:13 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <stdio.h> /* include standard I/O library */
-#include <errno.h>
-#include <fcntl.h>
+#include <stdio.h> /* standard I/O library */
+#include <errno.h>> /* error definitions and routines */
+#include <fcntl.h> /* file control functions */
#include "macros.h"
* Read n fortunes from fortune file file, and put it into the
* string array fortune
*
- * $Id: FortuneParse.c,v 1.5 2003/05/02 09:55:13 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
#include <sys/types.h> /* predefined types */
-#include <sys/stat.h> /* */
-#include <unistd.h> /* include unix standard library */
-#include <stdio.h> /* include standard I/O library */
-#include <stdlib.h> /* standard library */
-#include <string.h> /* ANSI C standard string */
-#include <errno.h> /* error definitions */
-#include <fcntl.h> /* */
+#include <sys/stat.h> /* file characteristics constants and functions */
+#include <unistd.h> /* unix standard library */
+#include <stdio.h> /* standard I/O library */
+#include <stdlib.h> /* C standard library */
+#include <string.h> /* C strings library */
+#include <errno.h> /* error definitions and routines */
+#include <fcntl.h> /* file control functions */
#include "macros.h"
*
* Usage: fortuned -h give all info
*
- * $Id: FortuneServer.c,v 1.8 2003/05/02 09:55:13 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <sys/stat.h> /* */
-#include <unistd.h> /* include unix standard library */
-#include <stdio.h> /* include standard I/O library */
-#include <stdlib.h> /* standard library */
-#include <string.h> /* ANSI C standard string */
-#include <errno.h> /* errorstring */
-#include <signal.h> /* signals */
-#include <fcntl.h> /* */
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
+#include <unistd.h> /* unix standard library */
+#include <stdio.h> /* standard I/O library */
+#include <stdlib.h> /* C standard library */
+#include <string.h> /* C strings library */
+#include <errno.h> /* error definitions and routines */
+#include <signal.h> /* signal constants, types and functions */
+#include <fcntl.h> /* file control functions */
#include "macros.h"
#include "Gapil.h"
*
* Usage: ipctestid -h give all info's
*
- * $Id: IPCTestId.c,v 1.4 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
+#include <string.h> /* C strings library */
#include <sys/ipc.h> /* SysV IPC functions */
-#include <sys/msg.h> /* SysV Message Queue */
-#include <sys/sem.h> /* SysV Semaphores */
-#include <sys/shm.h> /* SysV Shared Memory */
+#include <sys/msg.h> /* SysV message queues */
+#include <sys/sem.h> /* SysV semaphores */
+#include <sys/shm.h> /* SysV shared memory */
#include "macros.h" /* My macros */
/* Help printing routine */
*****************************************************************************/
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h> /* unix standard functions */
-#include <fcntl.h> /* file control (lock) functions */
+#include <unistd.h> /* unix standard functions */
+#include <fcntl.h> /* file control functions */
/*
* Function LockFile:
*
*
* Usage: fortune -h give all info
*
- * $Id: MQFortuneClient.c,v 1.4 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <sys/stat.h> /* */
-#include <unistd.h> /* include unix standard library */
-#include <stdio.h> /* include standard I/O library */
-#include <stdlib.h> /* standard library */
-#include <string.h> /* ANSI C standard string */
-#include <errno.h> /* errorstring */
-#include <signal.h> /* signals */
-#include <sys/ipc.h>
-#include <sys/msg.h>
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
+#include <unistd.h> /* unix standard library */
+#include <stdio.h> /* standard I/O library */
+#include <stdlib.h> /* C standard library */
+#include <string.h> /* C strings library */
+#include <errno.h> /* error definitions and routines */
+#include <signal.h> /* signal constants, types and functions */
+#include <sys/ipc.h> /* SysV IPC functions */
+#include <sys/msg.h> /* SysV message queues */
+
#include "macros.h"
*
* Usage: fortuned -h give all info
*
- * $Id: MQFortuneServer.c,v 1.6 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <sys/stat.h> /* */
-#include <unistd.h> /* include unix standard library */
-#include <stdio.h> /* include standard I/O library */
-#include <stdlib.h> /* standard library */
-#include <string.h> /* ANSI C standard string */
-#include <errno.h> /* errorstring */
-#include <signal.h> /* signals */
-#include <sys/ipc.h>
-#include <sys/msg.h>
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
+#include <unistd.h> /* unix standard library */
+#include <stdio.h> /* standard I/O library */
+#include <stdlib.h> /* C standard library */
+#include <string.h> /* C strings library */
+#include <errno.h> /* error definitions and routines */
+#include <signal.h> /* signal constants, types and functions */
+#include <sys/ipc.h> /* SysV IPC functions */
+#include <sys/msg.h> /* SysV message queues */
#include "macros.h"
#include "Gapil.h"
#include <sys/sem.h> /* IPC semaphore declarations */
#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
+#include <fcntl.h> /* file control functions */
#include <signal.h> /* signal handling declarations */
#include "Gapil.h"
*
* Usage: procinfo -h give all info's
*
- * $Id: ProcInfo.c,v 1.3 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
+#include <string.h> /* C strings library */
/* Help printing routine */
void usage(void);
*
* Author: S. Piccardi
*
- * $Id: SharedMem.c,v 1.8 2003/05/02 09:55:14 piccardi Exp $
- *
***************************************************************/
-#include <sys/shm.h> /* SysV IPC shared memory declarations */
-#include <sys/types.h>
+#include <sys/shm.h> /* SysV IPC shared memory */
+#include <sys/types.h> /* primitive system data types */
#include <sys/stat.h>
-#include <stdio.h> /* standard I/O functions */
-#include <fcntl.h>
-#include <signal.h> /* signal handling declarations */
-#include <unistd.h>
+#include <stdio.h> /* standard I/O functions */
+#include <fcntl.h> /* file control functions */
+#include <signal.h> /* signal constants, types and functions */
+#include <unistd.h> /* unix standard library */
#include <sys/mman.h>
-#include <string.h>
-#include <errno.h>
+#include <string.h> /* C strings library */
+#include <errno.h> /* error definitions and routines */
#include "macros.h"
/* *************************************************************************
-/* Sockutils.c
+/* SockUtil.c
*
* Copyright (C) 2004 Simone Piccardi
*
*/
/***************************************************************
*
- * File SockUtils.c
+ * File SockUtil.c
* Routines for socket operations.
*
* Define routines for socket handling
*
* Author: S. Piccardi
*
- * $Id$
- *
***************************************************************/
-#include <sys/types.h>
-#include <stdio.h> /* standard I/O functions */
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
+#include <sys/types.h> /* primitive system data types */
+#include <stdio.h> /* standard I/O library */
+#include <unistd.h> /* unix standard library */
+#include <string.h> /* C strings library */
+#include <errno.h> /* error definitions and routines */
+#include <sys/socket.h> /* socket constants, types and functions */
#include <arpa/inet.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
* Author: Simone Piccardi
* Dec. 2004
*
- * $Id$
- *
**************************************************************************/
char *ip_ntop(struct addrinfo *addr, char *dst, socklen_t cnt)
{
* Author: Simone Piccardi
* Dec. 2004
*
- * $Id$
- *
****************************************************************/
int sockconn(char *host, char *serv, int prot, int type)
{
* Author: Simone Piccardi
* Dec. 2004
*
- * $Id$
- *
****************************************************************/
int sockbind(char *host, char *serv, int prot, int type)
{
* Author: Simone Piccardi
* Mar. 2005
*
- * $Id$
- *
****************************************************************/
int sockbindopt(char *host, char *serv, int prot, int type, int reuse)
{
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <sys/mman.h>
#include <semaphore.h>
#include <syslog.h> /* syslog system functions */
-#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <string.h> /* error strings */
-#include <stdlib.h>
+#include <signal.h> /* signal constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "Gapil.h"
*
* Usage: daytimed -h give all info
*
- * $Id: TCP_cunc_daytimed.c,v 1.4 2003/12/25 17:31:09 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#define MAXLINE 80
#define BACKLOG 10
*
* Usage: daytime -h give all info's
*
- * $Id: TCP_daytime.c,v 1.5 2004/03/20 22:42:07 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
#define MAXLINE 80
/* Program begin */
*
* Usage: echo -h give all info's
*
- * $Id: TCP_echo.c,v 1.11 2003/10/20 22:44:16 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <errno.h> /* include error codes */
-#include <string.h> /* include erroro strings definitions */
-#include <stdlib.h>
-#include <netinet/tcp.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
+#include <netinet/tcp.h> /* TCP constants and types */
/* still not defined in some include, because too new ... */
#ifndef TCP_CONGESTION
*
* Usage: echo -h give all info's
*
- * $Id: TCP_echo.c,v 1.11 2003/10/20 22:44:16 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <errno.h> /* include error codes */
-#include <string.h> /* include erroro strings definitions */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
#include "Gapil.h"
#include "macros.h"
*
* Usage: echo -h give all info's
*
- * $Id$
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
#define MAXLINE 256
void usage(void);
*
* Usage: echo -h give all info's
*
- * $Id: TCP_echo.c,v 1.11 2003/10/20 22:44:16 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <errno.h> /* include error codes */
-#include <string.h> /* include erroro strings definitions */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
#include "macros.h"
*
* Usage: echo -h give all info's
*
- * $Id$
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <errno.h> /* include error codes */
-#include <string.h> /* include erroro strings definitions */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
#define MAXLINE 256
void usage(void);
*
* Usage: echo -h give all info's
*
- * $Id$
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <errno.h> /* include error codes */
-#include <string.h> /* include erroro strings definitions */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
#include "macros.h"
*
* Usage: echod -h give all info
*
- * $Id$
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <syslog.h> /* syslog system functions */
-#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <string.h> /* error strings */
-#include <stdlib.h>
+#include <signal.h> /* signal constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "Gapil.h"
-/* TCP_echod.c
+/* TCP_echod_fifth.c
*
* Copyright (C) 2001-2004 Simone Piccardi
*
*
* Program echod
* Elementary TCP server for echo service (port 7)
+ * Fifth version
*
* Author: Simone Piccardi
* Jun. 2001
*
* Usage: echod -h give all info
*
- * $Id$
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <syslog.h> /* syslog system functions */
-#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <string.h> /* error strings */
-#include <stdlib.h>
+#include <signal.h> /* signal constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "Gapil.h"
*
* Program echod
* Elementary TCP server for echo service (port 7)
+ * First version
*
* Author: Simone Piccardi
* Jun. 2001
*
* Usage: echod -h give all info
*
- * $Id: TCP_echod_first.c,v 1.3 2003/12/25 17:31:09 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <syslog.h> /* syslog system functions */
#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <string.h> /* error strings */
-#include <stdlib.h>
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "Gapil.h"
-/* TCP_echod.c
+/* TCP_echod_fourth.c
*
* Copyright (C) 2001-2004 Simone Piccardi
*
*
* Program echod
* Elementary TCP server for echo service (port 7)
+ * Fourth version
*
* Author: Simone Piccardi
* Jun. 2001
*
* Usage: echod -h give all info
*
- * $Id$
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <syslog.h> /* syslog system functions */
-#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <string.h> /* error strings */
-#include <stdlib.h>
+#include <signal.h> /* signal constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "Gapil.h"
*
* Usage: echod -h give all info
*
- * $Id$
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <syslog.h> /* syslog system functions */
-#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <string.h> /* error strings */
-#include <stdlib.h>
+#include <signal.h> /* signal constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "Gapil.h"
-/* TCP_echod.c
+/* TCP_echod_third.c
*
* Copyright (C) 2001-2004 Simone Piccardi
*
*
* Program echod
* Elementary TCP server for echo service (port 7)
+ * Third version
*
* Author: Simone Piccardi
* Jun. 2001
*
* Usage: echod -h give all info
*
- * $Id$
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <syslog.h> /* syslog system functions */
-#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <string.h> /* error strings */
-#include <stdlib.h>
+#include <signal.h> /* signal constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "Gapil.h"
*
* Usage: daytimed -h give all info
*
- * $Id: TCP_iter_daytimed.c,v 1.3 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#define MAXLINE 80
#define BACKLOG 10
*
* Usage: testrem -h give all info's
*
- * $Id: TestRen.c,v 1.4 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
+#include <string.h> /* C strings library */
/* Help printing routine */
void usage(void);
*
* Usage: daytime -h give all info's
*
- * $Id: UDP_daytime.c,v 1.1 2004/03/20 22:42:07 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
#define MAXLINE 80
/* Program begin */
*
* Usage: daytimed -h give all info
*
- * $Id: UDP_daytimed.c,v 1.2 2004/03/21 23:01:01 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
-#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
+#include <arpa/inet.h> /* IP addresses conversion utilities */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#define MAXLINE 80
/* Program begin */
*
* Usage: echo -h give all info's
*
- * $Id: UDP_echo.c,v 1.4 2004/06/04 00:31:33 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
-#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <errno.h> /* include error codes */
-#include <string.h> /* include erroro strings definitions */
-#include <stdlib.h>
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
+#include <arpa/inet.h> /* IP addresses conversion utilities */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "macros.h"
*
* Usage: echo -h give all info's
*
- * $Id: UDP_echo_first.c,v 1.1 2004/06/02 16:31:50 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
-#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <errno.h> /* include error codes */
-#include <string.h> /* include erroro strings definitions */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
+#include <arpa/inet.h> /* IP addresses conversion utilities */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
#include "macros.h"
*
* Author: S. Piccardi Jan. 2003
*
- * $Id: WriteShm.c,v 1.3 2003/05/02 09:55:14 piccardi Exp $
- *
*****************************************************************************/
-#include <sys/types.h>
+#include <sys/types.h> /* primitive system data types */
#include <sys/stat.h>
#include <dirent.h> /* directory */
#include <stdlib.h> /* C standard library */
-#include <unistd.h>
-#include <stdio.h>
+#include <unistd.h> /* unix standard library */
+#include <stdio.h> /* standard I/O library */
#include "Gapil.h"
#include "macros.h"
* Author: S. Piccardi Jul. 2007
*
*****************************************************************************/
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
#include <sys/inotify.h> /* Linux inotify interface */
#include <sys/epoll.h> /* Linux epoll interface */
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* Unix standard library */
#include <errno.h> /* error definitions and routines */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
-#include <fcntl.h> /* fcntl function */
+#include <string.h> /* C strings library */
+#include <fcntl.h> /* file control function */
#include <sys/ioctl.h> /* ioctl function */
*
* Usage: getcap -h give all info's
*
- *
****************************************************************/
/*
* Include needed headers
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
-#include <sys/types.h>
+#include <string.h> /* C strings library */
+#include <sys/types.h> /* primitive system data types */
#include <sys/capability.h>
/* Help printing routine */
*
* Usage: gethost -h give all info's
*
- * $Id: gethost.c,v 1.3 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
-#include <sys/types.h>
-#include <sys/socket.h>
+#include <string.h> /* C strings library */
+#include <sys/types.h> /* primitive system data types */
+#include <sys/socket.h> /* socket constants, types and functions */
#include <netdb.h>
/* Help printing routine */
*
* Usage: getparam -h give all info's
*
- * $Id: getparam.c,v 1.3 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
#include <errno.h> /* error definitions and routines */
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
-#include <string.h> /* string functions */
+#include <string.h> /* C strings library */
#include <limits.h>
-#include <stdio.h>
-
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
-#include <time.h> /* for CLK_TCK e CLOCKS_PER_SEC */
/* Table of constants for sysconf() */
char *sc_names[]={"_SC_ARG_MAX",
* Author: S. Piccardi Jul. 2007
*
*****************************************************************************/
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
#include <sys/inotify.h> /* Linux inotify interface */
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* Unix standard library */
#include <errno.h> /* error definitions and routines */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
-#include <fcntl.h> /* fcntl function */
+#include <string.h> /* C strings library */
+#include <fcntl.h> /* file control functions */
#include <sys/ioctl.h> /* ioctl function */
*
* Author: S. Piccardi Nov. 2004
*
- * $Id$
- *
*****************************************************************************/
-#include <netdb.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdlib.h> /* C standard library */
-#include <stdio.h> /* I/O standard library */
-#include <unistd.h>
+#include <string.h> /* C strings library */
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
+#include <unistd.h> /* unix standard library */
+#include <stdlib.h> /* C standard library */
+#include <stdio.h> /* I/O standard library */
#include <arpa/inet.h>
-#include <sys/socket.h>
+#include <sys/socket.h> /* socket constants, types and functions */
#include <netinet/in.h>
+#include <netdb.h>
#include "Gapil.h"
/*
*
* Author: S. Piccardi Jul. 2004
*
- * $Id$
- *
*****************************************************************************/
-#include <netdb.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdlib.h> /* C standard library */
-#include <stdio.h> /* I/O standard library */
-#include <unistd.h>
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
+#include <stdlib.h> /* C standard library */
+#include <stdio.h> /* I/O standard library */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h>
+#include <netdb.h>
+
+
+
extern int h_errno;
#include "Gapil.h"
*
* Usage: echod -h give all info
*
- * $Id: poll_echod.c,v 1.3 2004/02/17 23:48:46 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
*/
#define _XOPEN_SOURCE
#include <limits.h> /* system limits */
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <syslog.h> /* syslog system functions */
-#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <string.h> /* error strings */
-#include <stdlib.h>
-#include <sys/poll.h> /* poll function definition */
+#include <signal.h> /* signal constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
+#include <sys/poll.h> /* poll syscall */
#include "macros.h"
#include "Gapil.h"
/*
* Include needed headers
*/
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
+#include <sys/types.h> /* primitive system data types */
+#include <unistd.h> /* unix standard library */
#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <syslog.h> /* syslog system functions */
-#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <string.h> /* error strings */
-#include <stdlib.h>
+#include <signal.h> /* signal constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
+#include <stdlib.h> /* C standard library */
#include "macros.h"
#include "Gapil.h"
*/
#define _GNU_SOURCE
#include <unistd.h> /* unix standard library */
-#include <signal.h> /* signal standard library */
+#include <signal.h> /* signal constants, types and functions */
void alarm_hand(int sig) {
/* check if the signal is the right one */
*
* Usage: testfopen -h give all info's
*
- * $Id: test_fopen.c,v 1.3 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
/*
* Include needed headers
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /* string functions */
+#include <string.h> /* C strings library */
/* Help printing routine */
void usage(void);
*
* Usage: wwwd -h give all info
*
- * $Id$
- *
****************************************************************/
/*
* Include needed headers
*/
#define _GNU_SOURCE
-#include <string.h> /* error strings */
-#include <sys/types.h> /* predefined types */
-#include <unistd.h> /* include unix standard library */
-#include <arpa/inet.h> /* IP addresses conversion utiliites */
-#include <sys/socket.h> /* socket library */
-#include <stdio.h> /* include standard I/O library */
-#include <time.h>
+#include <sys/types.h> /* primitive system data types */
+#include <sys/stat.h> /* file characteristics constants and functions */
+#include <unistd.h> /* unix standard library */
+#include <stdlib.h> /* C standard library */
+#include <arpa/inet.h> /* IP addresses conversion utilities */
+#include <sys/socket.h> /* socket constants, types and functions */
+#include <stdio.h> /* standard I/O library */
+#include <time.h> /* date and time constants, types and functions */
#include <syslog.h> /* syslog system functions */
-#include <signal.h> /* signal functions */
-#include <errno.h> /* error code */
-#include <stdlib.h>
+#include <signal.h> /* signal constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <string.h> /* C strings library */
#include "Gapil.h"