-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expand file tree
/
Copy pathlibrt_strings.h
More file actions
31 lines (25 loc) · 1.1 KB
/
librt_strings.h
File metadata and controls
31 lines (25 loc) · 1.1 KB
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
#ifndef LIBRT_STRINGS_H
#define LIBRT_STRINGS_H
#include <stdbool.h>
#include <Python.h>
#include "librt_strings_common.h"
// ABI version -- only an exact match is compatible. This will only be changed in
// very exceptional cases (likely never) due to strict backward compatibility
// requirements.
#define LIBRT_STRINGS_ABI_VERSION 1
// API version -- more recent versions must maintain backward compatibility, i.e.
// we can add new features but not remove or change existing features (unless
// ABI version is changed, but see the comment above).
#define LIBRT_STRINGS_API_VERSION 4
// Number of functions in the capsule API. If you add a new function, also increase
// LIBRT_STRINGS_API_VERSION.
#define LIBRT_STRINGS_API_LEN 14
typedef struct {
PyObject_HEAD
char *buf; // Beginning of the buffer
char kind; // Bytes per code point (1, 2 or 4)
Py_ssize_t len; // Current length (number of code points written)
Py_ssize_t capacity; // Total capacity of the buffer (number of code points)
char data[WRITER_EMBEDDED_BUF_LEN]; // Default buffer
} StringWriterObject;
#endif // LIBRT_STRINGS_H