1272343Sngie/*	$NetBSD: returns.h,v 1.1 2011/04/10 09:55:09 blymn Exp $	*/
2272343Sngie
3272343Sngie/*-
4272343Sngie * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
5272343Sngie *
6272343Sngie * All rights reserved.
7272343Sngie *
8272343Sngie * This code has been donated to The NetBSD Foundation by the Author.
9272343Sngie *
10272343Sngie * Redistribution and use in source and binary forms, with or without
11272343Sngie * modification, are permitted provided that the following conditions
12272343Sngie * are met:
13272343Sngie * 1. Redistributions of source code must retain the above copyright
14272343Sngie *    notice, this list of conditions and the following disclaimer.
15272343Sngie * 2. The name of the author may not be used to endorse or promote products
16272343Sngie *    derived from this software withough specific prior written permission
17272343Sngie *
18272343Sngie * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19272343Sngie * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20272343Sngie * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21272343Sngie * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22272343Sngie * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23272343Sngie * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24272343Sngie * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25272343Sngie * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26272343Sngie * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27272343Sngie * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28272343Sngie *
29272343Sngie *
30272343Sngie */
31272343Sngie#ifndef CTF_RETURNS_H
32272343Sngie#define CTF_RETURNS_H 1
33272343Sngie
34272343Sngie
35272343Sngietypedef enum {
36272343Sngie	ret_number = 1,
37272343Sngie	ret_string,
38272343Sngie	ret_byte,
39272343Sngie	ret_err,
40272343Sngie	ret_ok,
41272343Sngie	ret_null,
42272343Sngie	ret_nonnull,
43272343Sngie	ret_var,
44272343Sngie	ret_ref,
45272343Sngie	ret_count,
46272343Sngie	ret_slave_error
47272343Sngie} returns_enum_t;
48272343Sngie
49272343Sngietypedef struct {
50272343Sngie	returns_enum_t	return_type;
51272343Sngie	void		*return_value;	/* used if return_type is ret_num or
52272343Sngie					   or ret_byte or ret_string */
53272343Sngie	size_t		return_len;	/* number of bytes in return_value iff
54272343Sngie					   return_type is ret_byte */
55272343Sngie	int		return_index;	/* index into var array for return
56272343Sngie					   if return_type is ret_var */
57272343Sngie} returns_t;
58272343Sngie
59272343Sngietypedef struct {
60272343Sngie	size_t	count;
61272343Sngie	size_t	allocated;
62272343Sngie	size_t	readp;
63272343Sngie	char	*data;
64272343Sngie} saved_data_t;
65272343Sngie
66272343Sngie#endif /* CTF_RETURNS_H */
67