File: saj2.h

package info (click to toggle)
ruby-oj 3.16.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,852 kB
  • sloc: ansic: 19,402; ruby: 11,451; makefile: 17
file content (23 lines) | stat: -rw-r--r-- 609 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) 2021, Peter Ohler, All rights reserved.

#include <ruby.h>
#include <stdbool.h>

struct _cache;
struct _ojParser;

typedef struct _saj {
    VALUE          handler;
    VALUE         *keys;
    VALUE         *tail;
    size_t         klen;
    struct _cache *str_cache;
    uint8_t        cache_str;
    bool           cache_keys;
    bool           thread_safe;
} *Saj;

// Initialize the parser with the SAJ delegate. If the SAJ delegate is wrapped
// then this function is called first and then the parser functions can be
// replaced.
extern void oj_init_saj(struct _ojParser *p, Saj d);