Add a comment explaining why we're defining S_ISDIR and company.
[obnox/wireshark/wip.git] / ptvcursor.h
1 /* ptvcursor.h
2  * 
3  * Proto Tree TVBuff cursor
4  * Gilbert Ramirez <gram@xiexie.org>
5  *
6  * $Id: ptvcursor.h,v 1.1 2000/07/28 20:03:43 gram Exp $
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@zing.org>
10  * Copyright 2000 Gerald Combs
11  * 
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  * 
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <glib.h>
32
33 #ifndef __PACKET_H__
34 #include "packet.h"
35 #endif
36
37 #ifndef __PTVCURSOR_H__
38 #define __PTVCURSOR_H__
39
40 typedef struct ptvcursor ptvcursor_t;
41
42 #define PTVC_VARIABLE_LENGTH    -1
43
44 /* Allocates an initializes a ptvcursor_t with 3 variables:
45  *      proto_tree, tvbuff, and offset. */
46 ptvcursor_t*
47 ptvcursor_new(proto_tree*, tvbuff_t*, gint);
48
49 /* Gets data from tvbuff, adds it to proto_tree, increments offset,
50  * and returns proto_item* */
51 proto_item*
52 ptvcursor_add(ptvcursor_t*, int hf, gint length, gboolean endianness);
53
54 /* Frees memory for ptvcursor_t, but nothing deeper than that. */
55 void
56 ptvcursor_free(ptvcursor_t*);
57
58 #endif /* __PTVCURSOR_H__ */