2016-02-11 13:32:30 +01:00
|
|
|
/* g13tuple.h - Tuple handling
|
2009-09-30 15:28:38 +00:00
|
|
|
* Copyright (C) 2009 Free Software Foundation, Inc.
|
|
|
|
*
|
|
|
|
* This file is part of GnuPG.
|
|
|
|
*
|
|
|
|
* GnuPG is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GnuPG is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2016-11-05 12:02:19 +01:00
|
|
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
2009-09-30 15:28:38 +00:00
|
|
|
*/
|
|
|
|
|
2016-02-11 13:32:30 +01:00
|
|
|
#ifndef G13_G13TUPLE_H
|
|
|
|
#define G13_G13TUPLE_H
|
2009-09-30 15:28:38 +00:00
|
|
|
|
|
|
|
#include "../common/membuf.h"
|
|
|
|
|
2009-10-13 19:17:24 +00:00
|
|
|
/* Append a new tuple to a memory buffer. */
|
2009-09-30 15:28:38 +00:00
|
|
|
void append_tuple (membuf_t *membuf,
|
|
|
|
int tag, const void *value, size_t length);
|
2016-02-10 20:44:19 +01:00
|
|
|
void append_tuple_uint (membuf_t *membuf, int tag,
|
|
|
|
unsigned long long value);
|
2009-09-30 15:28:38 +00:00
|
|
|
|
2009-10-13 19:17:24 +00:00
|
|
|
/* The tuple descriptor object. */
|
|
|
|
struct tupledesc_s;
|
|
|
|
typedef struct tupledesc_s *tupledesc_t;
|
|
|
|
|
2011-02-04 12:57:53 +01:00
|
|
|
gpg_error_t create_tupledesc (tupledesc_t *r_tupledesc,
|
2009-10-13 19:17:24 +00:00
|
|
|
void *data, size_t datalen);
|
|
|
|
void destroy_tupledesc (tupledesc_t tupledesc);
|
|
|
|
tupledesc_t ref_tupledesc (tupledesc_t tupledesc);
|
2016-02-13 17:01:45 +01:00
|
|
|
#define unref_tupledesc(a) destroy_tupledesc ((a))
|
|
|
|
const void *get_tupledesc_data (tupledesc_t tupledesc, size_t *r_datalen);
|
|
|
|
|
2011-02-04 12:57:53 +01:00
|
|
|
const void *find_tuple (tupledesc_t tupledesc,
|
2009-10-13 19:17:24 +00:00
|
|
|
unsigned int tag, size_t *r_length);
|
2016-02-10 20:44:19 +01:00
|
|
|
gpg_error_t find_tuple_uint (tupledesc_t tupledesc, unsigned int tag,
|
|
|
|
unsigned long long *r_value);
|
2011-02-04 12:57:53 +01:00
|
|
|
const void *next_tuple (tupledesc_t tupledesc,
|
2009-10-13 19:17:24 +00:00
|
|
|
unsigned int *r_tag, size_t *r_length);
|
2009-09-30 15:28:38 +00:00
|
|
|
|
2016-02-11 13:57:35 +01:00
|
|
|
void dump_tupledesc (tupledesc_t tuples);
|
|
|
|
|
2009-09-30 15:28:38 +00:00
|
|
|
|
2016-02-11 13:32:30 +01:00
|
|
|
#endif /*G13_G13TUPLE_H*/
|