summaryrefslogtreecommitdiff
path: root/src/upb_text.h
blob: bc15c3f8685ebf8aabec6d8309d2b5929249d69b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * upb - a minimalist implementation of protocol buffers.
 *
 * Copyright (c) 2009 Joshua Haberman.  See LICENSE for details.
 */

#ifndef UPB_TEXT_H_
#define UPB_TEXT_H_

#include "upb.h"

#ifdef __cplusplus
extern "C" {
#endif

struct upb_text_printer {
  int indent_depth;
  bool single_line;
};

INLINE void upb_text_printer_init(struct upb_text_printer *p, bool single_line) {
  p->indent_depth = 0;
  p->single_line = single_line;
}
void upb_text_printval(upb_field_type_t type, union upb_value p, FILE *file);
void upb_text_printfield(struct upb_text_printer *p, upb_strptr name,
                         upb_field_type_t valtype, union upb_value val,
                         FILE *stream);
void upb_text_push(struct upb_text_printer *p, upb_strptr submsg_type,
                   FILE *stream);
void upb_text_pop(struct upb_text_printer *p, FILE *stream);

#ifdef __cplusplus
}  /* extern "C" */
#endif

#endif  /* UPB_TEXT_H_ */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback