summaryrefslogtreecommitdiff
path: root/upb/json/printer.h
diff options
context:
space:
mode:
Diffstat (limited to 'upb/json/printer.h')
-rw-r--r--upb/json/printer.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/upb/json/printer.h b/upb/json/printer.h
index a7a37bb..857ae47 100644
--- a/upb/json/printer.h
+++ b/upb/json/printer.h
@@ -24,10 +24,12 @@ class PrinterPtr;
struct upb_json_printer;
typedef struct upb_json_printer upb_json_printer;
-UPB_BEGIN_EXTERN_C
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Native C API. */
-upb_json_printer *upb_json_printer_create(upb_env *e, const upb_handlers *h,
+upb_json_printer *upb_json_printer_create(upb_arena *a, const upb_handlers *h,
upb_bytessink output);
upb_sink upb_json_printer_input(upb_json_printer *p);
const upb_handlers *upb_json_printer_newhandlers(const upb_msgdef *md,
@@ -36,18 +38,18 @@ const upb_handlers *upb_json_printer_newhandlers(const upb_msgdef *md,
upb_handlercache *upb_json_printer_newcache(bool preserve_proto_fieldnames);
-UPB_END_EXTERN_C
-
#ifdef __cplusplus
+} /* extern "C" */
/* Prints an incoming stream of data to a BytesSink in JSON format. */
class upb::json::PrinterPtr {
public:
PrinterPtr(upb_json_printer* ptr) : ptr_(ptr) {}
- static PrinterPtr Create(Environment *env, const upb::Handlers *handlers,
+ static PrinterPtr Create(Arena *arena, const upb::Handlers *handlers,
BytesSink output) {
- return PrinterPtr(upb_json_printer_create(env, handlers, output.sink()));
+ return PrinterPtr(
+ upb_json_printer_create(arena->ptr(), handlers, output.sink()));
}
/* The input to the printer. */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback