pointer.h

Sun, 27 Feb 2005 00:09:12 +0100

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sun, 27 Feb 2005 00:09:12 +0100
changeset 94
f48ffd2f2224
parent 89
17a16ed84bbf
permissions
-rw-r--r--

Added routinesn for generic iterables.

/*
 * libtu/pointer.h
 *
 * Copyright (c) Tuomo Valkonen 2005. 
 *
 * You may distribute and modify this library under the terms of either
 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
 */

#ifndef LIBTU_POINTER_H
#define LIBTU_POINTER_H

#define FIELD_OFFSET(T, F) ((long)((char*)&((T*)0)->F))
#define FIELD_TO_STRUCT(T, F, A) ((T*)(((char*)A)-FIELD_OFFSET(T, F)))

#endif /* LIBTU_POINTER_H */

mercurial