From 51d8abdce6a1856a531afc5ef6cef5b1c4f2f728 Mon Sep 17 00:00:00 2001 From: octo Date: Mon, 17 Apr 2006 08:18:53 +0000 Subject: [PATCH] Moved the actual struct-definition from the header file to the .c-file. This way the definition is not visible to the user and he cannot access the fields.. --- src/liboping/liboping.c | 24 ++++++++++++++++++++++++ src/liboping/liboping.h | 26 ++++---------------------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/liboping/liboping.c b/src/liboping/liboping.c index 43d5fd50..12cb7407 100644 --- a/src/liboping/liboping.c +++ b/src/liboping/liboping.c @@ -89,6 +89,30 @@ #define PING_DATA "Florian Forster http://verplant.org/" +struct pinghost +{ + char *hostname; + struct sockaddr_storage *addr; + socklen_t addrlen; + int addrfamily; + int fd; + int ident; + int sequence; + struct timeval *timer; + double latency; + + struct pinghost *next; +}; + +struct pingobj +{ + double timeout; + int ttl; + int addrfamily; + + pinghost_t *head; +}; + /* * private (static) functions */ diff --git a/src/liboping/liboping.h b/src/liboping/liboping.h index 065ae950..9f854ebe 100644 --- a/src/liboping/liboping.h +++ b/src/liboping/liboping.h @@ -37,31 +37,13 @@ /* * Type definitions */ -typedef struct pinghost -{ - char *hostname; - struct sockaddr_storage *addr; - socklen_t addrlen; - int addrfamily; - int fd; - int ident; - int sequence; - struct timeval *timer; - double latency; - - struct pinghost *next; -} pinghost_t; +struct pinghost; +typedef struct pinghost pinghost_t; typedef pinghost_t pingobj_iter_t; -typedef struct pingobj -{ - double timeout; - int ttl; - int addrfamily; - - pinghost_t *head; -} pingobj_t; +struct pingobj; +typedef struct pingobj pingobj_t; #define PING_OPT_TIMEOUT 0x01 #define PING_OPT_TTL 0x02 -- 2.30.2