Crate ion_c_sys[][src]

Expand description

Provides basic bindings for Ion C

These bindings are created with bindgen and are considerably low-level.

Examples

Using ion-c-sys directly can be a pretty verbose affair, and requires checking the error code for most calls. This crate provides the result module to make it easier to integrate with std::result::Result with respect to the iERR that Ion C functions generally return. Specifically, any low-level IonC function that returns iERR should be called with the ionc! macro to facilitate Result<(), IonCError> conversion.

This library provides smart pointers over the low-level reader/writer pointers, and should generally be used, especially with Result handling code. These types provide some facade over Ion C, but only for the most generally used APIs. See:

Ion Reader

Here is an end-to-end example of reading some Ion data.

let mut reader = IonCReaderHandle::try_from("{a:2}")?;

// step to the struct
assert_eq!(ION_TYPE_STRUCT, reader.next()?);
// step into the struct
reader.step_in()?;
// step to the field
assert_eq!(ION_TYPE_INT, reader.next()?);
// retrieve the field name
assert_eq!("a", reader.get_field_name()?.as_str());
// read the integer value
assert_eq!(2, reader.read_i64()?);
// step to the end of the struct
assert_eq!(ION_TYPE_EOF, reader.next()?);
// step out of the struct
reader.step_out()?;
// step to the end of the stream
assert_eq!(ION_TYPE_EOF, reader.next()?);

Ion Writer

Here is an end-to-end example of writing some Ion data.

// output buffer
let mut buf: Vec<u8> = vec![0; 128];
let len = {
    let mut writer = IonCWriterHandle::new_buf_mode(buf.as_mut(), WriterMode::Binary)?;
    // start a list
    writer.start_container(ION_TYPE_LIST)?;
    // write some integers
    for n in 0..4 {
        writer.write_i64(n * 2)?;
    }
    // end the list
    writer.finish_container()?;
    // start a struct
    writer.start_container(ION_TYPE_STRUCT)?;
    {
        // write a string
        writer.field("name").annotations(&["version"]).write_string("💩")?;
    }
    // end the struct
    writer.finish_container()?;
    // finish writing
    writer.finish()?
};

// make sure the bytes match what we expect
let expected: &[u8] = &[
    0xE0, 0x01, 0x00, 0xEA,         // IVM
    0xB7,                           // LIST size 7
    0x20,                           // INT 0
    0x21, 0x02,                     // INT 2
    0x21, 0x04,                     // INT 4
    0x21, 0x06,                     // INT 6
    0xD9,                           // STRUCT size 8
    0x84,                           // field "name" (sid 4)
    0xE7, 0x81, 0x85,               // annotation "version" (sid 5)
    0x84, 0xF0, 0x9F, 0x92, 0xA9,   // STRING 💩
];
assert_eq!(expected.len(), len);
assert_eq!(expected, &buf[0..len]);

Re-exports

pub use self::ion_error_code as iERR;
pub use self::_ION_SYMBOL_TABLE_TYPE as ION_SYMBOL_TABLE_TYPE;

Modules

decimal

Provides higher-level APIs for ION_DECIMAL

int

Provides higher-level APIs for ION_INT

reader

Provides higher-level APIs for Ion C’s hREADER.

result

Provides convenient integration with Error and Result for Ion C.

string

Provides higher-level APIs for borrowing str slices safely from Ion C.

timestamp

Provides integration between ION_TIMESTAMP and chrono::DateTime.

writer

Provides higher-level APIs for Ion C’s hWRITER.

Macros

ionc

Macro to transform Ion C error code expressions into Result<(), IonCError>. Higher-level facades over Ion C functions could map this to Result<T, IonCError> or the like.

Structs

_G_fpos64_t
_G_fpos_t
_IO_FILE
_IO_codecvt
_IO_marker
_IO_wide_data
__fsid_t
__locale_data
__locale_struct
__mbstate_t
__pthread_cond_s
__pthread_cond_s__bindgen_ty_1__bindgen_ty_1
__pthread_cond_s__bindgen_ty_2__bindgen_ty_1
__pthread_internal_list
__pthread_internal_slist
__pthread_mutex_s
__pthread_rwlock_arch_t
__sigset_t
__va_list_tag
_fpreg
_fpstate
_fpx_sw_bytes
_fpxreg
_ion_catalog
_ion_collection

The collections used by the parser are linked lists which are managed by the collection header. the memory used for the nodes is allocated on the parent, which is passed in when the user initializes the collection

_ion_collection_node

The node allocation scheme depends on this layout ! currently that there are only 2 members so it uses the size of the ptr as the base to allocate

_ion_decimal
_ion_int
_ion_page
_ion_reader
_ion_reader_context_change_notifier
_ion_reader_options

Reader configuration data, could be supplied by user during reader creation time. All fields in the structure are defaulted to 0, except for the following:

_ion_stream
_ion_stream_paged
_ion_stream_user_paged
_ion_string
_ion_symbol
_ion_symbol_import_location
_ion_symbol_table
_ion_symbol_table_import
_ion_symbol_table_import_descriptor
_ion_timestamp

Structure to store time information. time_t only has up to second precision, and time zone support is OS dependent. _ion_timestamp uses decimal to store fraction of a second

_ion_user_stream
_ion_writer
_ion_writer_options
_libc_fpstate
_libc_fpxreg
_libc_xmmreg
_xmmreg
_xsave_hdr
_xstate
_ymmh_state
decContext
decNumber
ion_type
itimerspec
mcontext_t
sigaction
sigcontext
sigevent
sigevent__bindgen_ty_1__bindgen_ty_1
siginfo_t
siginfo_t__bindgen_ty_1__bindgen_ty_1
siginfo_t__bindgen_ty_1__bindgen_ty_2
siginfo_t__bindgen_ty_1__bindgen_ty_3
siginfo_t__bindgen_ty_1__bindgen_ty_4
siginfo_t__bindgen_ty_1__bindgen_ty_5
siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1
siginfo_t__bindgen_ty_1__bindgen_ty_6
siginfo_t__bindgen_ty_1__bindgen_ty_7
sigstack
stack_t
timespec
tm
ucontext_t

Constants

BUFSIZ
BUS_ADRALN
BUS_ADRERR
BUS_MCEERR_AO
BUS_MCEERR_AR
BUS_OBJERR
CLD_CONTINUED
CLD_DUMPED
CLD_EXITED
CLD_KILLED
CLD_STOPPED
CLD_TRAPPED
CLOCK_BOOTTIME
CLOCK_BOOTTIME_ALARM
CLOCK_MONOTONIC
CLOCK_MONOTONIC_COARSE
CLOCK_MONOTONIC_RAW
CLOCK_PROCESS_CPUTIME_ID
CLOCK_REALTIME
CLOCK_REALTIME_ALARM
CLOCK_REALTIME_COARSE
CLOCK_TAI
CLOCK_THREAD_CPUTIME_ID
DECAUTHOR
DECCAUTHOR
DECCFULLNAME
DECCNAME
DECDPUN
DECEXTFLAG
DECFLOAT_Inf
DECFLOAT_MinSp
DECFLOAT_NaN
DECFLOAT_Sign
DECFLOAT_qNaN
DECFLOAT_sNaN
DECFULLNAME
DECINF
DECNAME
DECNAN
DECNEG
DECPMINUS
DECPMINUSALT
DECPPLUS
DECPPLUSALT
DECPPLUSALT2
DECPUNSIGNED
DECQUADAUTHOR
DECQUADNAME
DECQUADTITLE
DECQUAD_Bias
DECQUAD_Bytes
DECQUAD_Declets
DECQUAD_EconL
DECQUAD_Ehigh
DECQUAD_Emax
DECQUAD_EmaxD
DECQUAD_Emin
DECQUAD_Pmax
DECQUAD_String
DECSNAN
DECSPECIAL
DECSUBSET
DEC_Clamped
DEC_ClassString_NI
DEC_ClassString_NN
DEC_ClassString_NS
DEC_ClassString_NZ
DEC_ClassString_PI
DEC_ClassString_PN
DEC_ClassString_PS
DEC_ClassString_PZ
DEC_ClassString_QN
DEC_ClassString_SN
DEC_ClassString_UN
DEC_Condition_CS
DEC_Condition_DI
DEC_Condition_DU
DEC_Condition_DZ
DEC_Condition_IC
DEC_Condition_IE
DEC_Condition_IO
DEC_Condition_IS
DEC_Condition_Length
DEC_Condition_MU
DEC_Condition_OV
DEC_Condition_PA
DEC_Condition_RO
DEC_Condition_SU
DEC_Condition_UN
DEC_Condition_ZE
DEC_Conversion_syntax
DEC_Division_by_zero
DEC_Division_impossible
DEC_Division_undefined
DEC_Errors
DEC_IEEE_754_Division_by_zero
DEC_IEEE_754_Inexact
DEC_IEEE_754_Invalid_operation
DEC_IEEE_754_Overflow
DEC_IEEE_754_Underflow
DEC_IEEE_854_Division_by_zero
DEC_IEEE_854_Inexact
DEC_IEEE_854_Invalid_operation
DEC_IEEE_854_Overflow
DEC_IEEE_854_Underflow
DEC_INIT_BASE
DEC_INIT_DECDOUBLE
DEC_INIT_DECIMAL32
DEC_INIT_DECIMAL64
DEC_INIT_DECIMAL128
DEC_INIT_DECQUAD
DEC_INIT_DECSINGLE
DEC_Inexact
DEC_Information
DEC_Insufficient_storage
DEC_Invalid_context
DEC_Invalid_operation
DEC_MAX_DIGITS
DEC_MAX_EMAX
DEC_MAX_EMIN
DEC_MAX_MATH
DEC_MIN_DIGITS
DEC_MIN_EMAX
DEC_MIN_EMIN
DEC_NaNs
DEC_Overflow
DEC_Rounded
DEC_Subnormal
DEC_Underflow
DEFAULT_STRING_LENGTH
EOF
FALSE
FILENAME_MAX
FOPEN_MAX
FPE_CONDTRAP
FPE_FLTDIV
FPE_FLTINV
FPE_FLTOVF
FPE_FLTRES
FPE_FLTSUB
FPE_FLTUND
FPE_FLTUNK
FPE_INTDIV
FPE_INTOVF
FP_XSTATE_MAGIC1
FP_XSTATE_MAGIC2
II_BINARY_BASE
II_BINARY_RADIX_CHARS
II_BITS_PER_BINARY_DIGIT
II_BITS_PER_BYTE
II_BITS_PER_DEC_DIGIT
II_BITS_PER_HEX_DIGIT
II_BYTE_BASE
II_BYTE_MASK
II_BYTE_NEG_OVERFLOW_LIMIT
II_BYTE_SIGN_BIT
II_DEC_DIGITS_PER_II_DIGIT
II_DEC_DIGIT_PER_BITS
II_HEX_BASE
II_HEX_RADIX_CHARS
II_II_DIGITS_PER_DEC_DIGIT
II_MINUS
II_PLUS
II_STRING_BASE
ILL_BADIADDR
ILL_BADSTK
ILL_COPROC
ILL_ILLADR
ILL_ILLOPC
ILL_ILLOPN
ILL_ILLTRP
ILL_PRVOPC
ILL_PRVREG
INT8_MAX
INT8_MIN
INT16_MAX
INT16_MIN
INT32_MAX
INT32_MIN
INTPTR_MAX
INTPTR_MIN
INT_FAST8_MAX
INT_FAST8_MIN
INT_FAST16_MAX
INT_FAST16_MIN
INT_FAST32_MAX
INT_FAST32_MIN
INT_LEAST8_MAX
INT_LEAST8_MIN
INT_LEAST16_MAX
INT_LEAST16_MIN
INT_LEAST32_MAX
INT_LEAST32_MIN
ION_DECIMAL_TYPE_ION_DECIMAL_TYPE_NUMBER

The _ion_decimal holds an unowned decNumber.

ION_DECIMAL_TYPE_ION_DECIMAL_TYPE_NUMBER_OWNED

The _ion_decimal holds a decNumber whose memory is managed by an owner.

ION_DECIMAL_TYPE_ION_DECIMAL_TYPE_QUAD

The _ion_decimal holds a decQuad.

ION_DECIMAL_TYPE_ION_DECIMAL_TYPE_UNKNOWN
ION_ERROR_MESSAGE_MAX_LENGTH
ION_MAX_TIMESTAMP_STRING
ION_SYS_SID_IMPORTS
ION_SYS_SID_ION
ION_SYS_SID_IVM
ION_SYS_SID_MAX_ID
ION_SYS_SID_NAME
ION_SYS_SID_SHARED_SYMBOL_TABLE
ION_SYS_SID_SYMBOLS
ION_SYS_SID_SYMBOL_TABLE
ION_SYS_SID_VERSION
ION_SYS_STRLEN_IMPORTS
ION_SYS_STRLEN_ION
ION_SYS_STRLEN_IVM
ION_SYS_STRLEN_MAX_ID
ION_SYS_STRLEN_NAME
ION_SYS_STRLEN_SHARED_SYMBOL_TABLE
ION_SYS_STRLEN_SYMBOLS
ION_SYS_STRLEN_SYMBOL_TABLE
ION_SYS_STRLEN_VERSION
ION_SYS_SYMBOL_IMPORTS
ION_SYS_SYMBOL_ION
ION_SYS_SYMBOL_ION_SYMBOL_TABLE
ION_SYS_SYMBOL_IVM
ION_SYS_SYMBOL_MAX_ID
ION_SYS_SYMBOL_MAX_ID_UNDEFINED
ION_SYS_SYMBOL_NAME
ION_SYS_SYMBOL_SHARED_SYMBOL_TABLE
ION_SYS_SYMBOL_SYMBOLS
ION_SYS_SYMBOL_VERSION
ION_TIMESTAMP_STRING_LENGTH
ION_TS_DAY
ION_TS_FRAC
ION_TS_MIN
ION_TS_MONTH
ION_TS_SEC
ION_TS_YEAR
ION_TT_BIT_DAY
ION_TT_BIT_FRAC
ION_TT_BIT_MIN
ION_TT_BIT_MONTH
ION_TT_BIT_SEC
ION_TT_BIT_YEAR
ION_TYPE_BLOB
ION_TYPE_BOOL
ION_TYPE_CLOB
ION_TYPE_DATAGRAM
ION_TYPE_DECIMAL
ION_TYPE_EOF
ION_TYPE_FLOAT
ION_TYPE_INT
ION_TYPE_LIST
ION_TYPE_NONE
ION_TYPE_NULL
ION_TYPE_SEXP
ION_TYPE_STRING
ION_TYPE_STRUCT
ION_TYPE_SYMBOL
ION_TYPE_TIMESTAMP
ION_VERSION_MARKER_LENGTH
L_ctermid
L_tmpnam
MAX_INT32
MAX_INT64
MAX_SIZE
MINSIGSTKSZ
MIN_INT32
MIN_INT64
NGREG
NSIG
POLL_ERR
POLL_HUP
POLL_IN
POLL_MSG
POLL_OUT
POLL_PRI
PTRDIFF_MAX
PTRDIFF_MIN
P_tmpdir
SA_INTERRUPT
SA_NOCLDSTOP
SA_NOCLDWAIT
SA_NODEFER
SA_NOMASK
SA_ONESHOT
SA_ONSTACK
SA_RESETHAND
SA_RESTART
SA_SIGINFO
SA_STACK
SEEK_CUR
SEEK_END
SEEK_SET
SEGV_ACCADI
SEGV_ACCERR
SEGV_ADIDERR
SEGV_ADIPERR
SEGV_BNDERR
SEGV_MAPERR
SEGV_PKUERR
SIGABRT
SIGALRM
SIGBUS
SIGCHLD
SIGCLD
SIGCONT
SIGEV_NONE
SIGEV_SIGNAL
SIGEV_THREAD
SIGEV_THREAD_ID
SIGFPE
SIGHUP
SIGILL
SIGINT
SIGIO
SIGIOT
SIGKILL
SIGPIPE
SIGPOLL
SIGPROF
SIGPWR
SIGQUIT
SIGSEGV
SIGSTKFLT
SIGSTKSZ
SIGSTOP
SIGSYS
SIGTERM
SIGTRAP
SIGTSTP
SIGTTIN
SIGTTOU
SIGURG
SIGUSR1
SIGUSR2
SIGVTALRM
SIGWINCH
SIGXCPU
SIGXFSZ
SIG_ATOMIC_MAX
SIG_ATOMIC_MIN
SIG_BLOCK
SIG_SETMASK
SIG_UNBLOCK
SIZE_MAX
SI_ASYNCIO
SI_ASYNCNL
SI_DETHREAD
SI_KERNEL
SI_MESGQ
SI_QUEUE
SI_SIGIO
SI_TIMER
SI_TKILL
SI_USER
SS_DISABLE
SS_ONSTACK
TIMER_ABSTIME
TIME_UTC
TMP_MAX
TRUE
UINT8_MAX
UINT16_MAX
UINT32_MAX
UINTPTR_MAX
UINT_FAST8_MAX
UINT_FAST16_MAX
UINT_FAST32_MAX
UINT_LEAST8_MAX
UINT_LEAST16_MAX
UINT_LEAST32_MAX
UNKNOWN_SID
WINT_MAX
WINT_MIN
_ATFILE_SOURCE
_BITS_ENDIANNESS_H
_BITS_ENDIAN_H
_BITS_PTHREADTYPES_ARCH_H
_BITS_PTHREADTYPES_COMMON_H
_BITS_SIGACTION_H
_BITS_SIGCONTEXT_H
_BITS_SIGEVENT_CONSTS_H
_BITS_SIGINFO_ARCH_H
_BITS_SIGINFO_CONSTS_H
_BITS_SIGNUM_GENERIC_H
_BITS_SIGNUM_H
_BITS_SIGSTACK_H
_BITS_SIGTHREAD_H
_BITS_SS_FLAGS_H
_BITS_STDINT_INTN_H
_BITS_STDINT_UINTN_H
_BITS_STDIO_LIM_H
_BITS_TIME64_H
_BITS_TIME_H
_BITS_TYPESIZES_H
_BITS_TYPES_H
_BITS_TYPES_LOCALE_T_H
_BITS_TYPES___LOCALE_T_H
_BITS_WCHAR_H
_DEFAULT_SOURCE
_FEATURES_H
_IOFBF
_IOLBF
_IONBF
_ION_SYMBOL_TABLE_TYPE_ist_EMPTY
_ION_SYMBOL_TABLE_TYPE_ist_LOCAL
_ION_SYMBOL_TABLE_TYPE_ist_SHARED
_ION_SYMBOL_TABLE_TYPE_ist_SYSTEM
_IO_EOF_SEEN
_IO_ERR_SEEN
_IO_USER_LOCK
_NSIG
_POSIX_C_SOURCE
_POSIX_SOURCE
_STDC_PREDEF_H
_STDINT_H
_STDIO_H
_STRINGS_H
_STRING_H
_STRUCT_TIMESPEC
_SYS_CDEFS_H
_SYS_UCONTEXT_H
_THREAD_MUTEX_INTERNAL_H
_THREAD_SHARED_TYPES_H
_TIME_H
__BIG_ENDIAN
__BYTE_ORDER
__FD_SETSIZE
__FILE_defined
__FLOAT_WORD_ORDER
__GLIBC_MINOR__
__GLIBC_USE_DEPRECATED_GETS
__GLIBC_USE_DEPRECATED_SCANF
__GLIBC_USE_IEC_60559_BFP_EXT
__GLIBC_USE_IEC_60559_BFP_EXT_C2X
__GLIBC_USE_IEC_60559_FUNCS_EXT
__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X
__GLIBC_USE_IEC_60559_TYPES_EXT
__GLIBC_USE_ISOC2X
__GLIBC_USE_LIB_EXT2
__GLIBC__
__GNUC_VA_LIST
__GNU_LIBRARY__
__HAVE_GENERIC_SELECTION
__INO_T_MATCHES_INO64_T
__LITTLE_ENDIAN
__LONG_DOUBLE_USES_FLOAT128
__NGREG
__OFF_T_MATCHES_OFF64_T
__PDP_ENDIAN
__PTHREAD_MUTEX_HAVE_PREV
__RLIM_T_MATCHES_RLIM64_T
__SIGEV_MAX_SIZE
__SIGRTMAX
__SIGRTMIN
__SIZEOF_PTHREAD_ATTR_T
__SIZEOF_PTHREAD_BARRIERATTR_T
__SIZEOF_PTHREAD_BARRIER_T
__SIZEOF_PTHREAD_CONDATTR_T
__SIZEOF_PTHREAD_COND_T
__SIZEOF_PTHREAD_MUTEXATTR_T
__SIZEOF_PTHREAD_MUTEX_T
__SIZEOF_PTHREAD_RWLOCKATTR_T
__SIZEOF_PTHREAD_RWLOCK_T
__SI_ASYNCIO_AFTER_SIGIO
__SI_ERRNO_THEN_CODE
__SI_HAVE_SIGSYS
__SI_MAX_SIZE
__STATFS_MATCHES_STATFS64
__STDC_IEC_559_COMPLEX__
__STDC_IEC_559__
__STDC_ISO_10646__
__SYSCALL_WORDSIZE
__TIMESIZE
__USE_ATFILE
__USE_FORTIFY_LEVEL
__USE_ISOC11
__USE_ISOC95
__USE_ISOC99
__USE_MISC
__USE_POSIX
__USE_POSIX2
__USE_POSIX199309
__USE_POSIX199506
__USE_POSIX_IMPLICITLY
__USE_XOPEN2K
__USE_XOPEN2K8
__WORDSIZE
__WORDSIZE_TIME64_COMPAT32
____FILE_defined
_____fpos64_t_defined
_____fpos_t_defined
____mbstate_t_defined
__clock_t_defined
__clockid_t_defined
__glibc_c99_flexarr_available
__have_pthread_attr_t
__itimerspec_defined
__sig_atomic_t_defined
__sigevent_t_defined
__siginfo_t_defined
__sigset_t_defined
__sigstack_defined
__stack_t_defined
__struct_FILE_defined
__struct_tm_defined
__time_t_defined
__timer_t_defined
decClass_DEC_CLASS_NEG_INF
decClass_DEC_CLASS_NEG_NORMAL
decClass_DEC_CLASS_NEG_SUBNORMAL
decClass_DEC_CLASS_NEG_ZERO
decClass_DEC_CLASS_POS_INF
decClass_DEC_CLASS_POS_NORMAL
decClass_DEC_CLASS_POS_SUBNORMAL
decClass_DEC_CLASS_POS_ZERO
decClass_DEC_CLASS_QNAN
decClass_DEC_CLASS_SNAN
ion_error_code_IERR_BAD_BASE64_BLOB
ion_error_code_IERR_BAD_HANDLE
ion_error_code_IERR_BUFFER_TOO_SMALL
ion_error_code_IERR_CANT_FIND_FILE
ion_error_code_IERR_DUPLICATE_SYMBOL
ion_error_code_IERR_DUPLICATE_SYMBOL_ID
ion_error_code_IERR_ENTRY_NOT_FOUND
ion_error_code_IERR_EOF
ion_error_code_IERR_HAS_LOCAL_SYMBOLS
ion_error_code_IERR_IMPORT_NOT_FOUND
ion_error_code_IERR_INTERNAL_ERROR
ion_error_code_IERR_INVALID_ARG
ion_error_code_IERR_INVALID_BINARY
ion_error_code_IERR_INVALID_ESCAPE_SEQUENCE
ion_error_code_IERR_INVALID_FIELDNAME
ion_error_code_IERR_INVALID_ION_VERSION
ion_error_code_IERR_INVALID_LEADING_ZEROS
ion_error_code_IERR_INVALID_LOB_TERMINATOR
ion_error_code_IERR_INVALID_STATE
ion_error_code_IERR_INVALID_SYMBOL
ion_error_code_IERR_INVALID_SYMBOL_LIST
ion_error_code_IERR_INVALID_SYMBOL_TABLE
ion_error_code_IERR_INVALID_SYNTAX
ion_error_code_IERR_INVALID_TIMESTAMP
ion_error_code_IERR_INVALID_TOKEN
ion_error_code_IERR_INVALID_TOKEN_CHAR
ion_error_code_IERR_INVALID_UNICODE_SEQUENCE
ion_error_code_IERR_INVALID_UTF8
ion_error_code_IERR_INVALID_UTF8_CHAR
ion_error_code_IERR_IS_IMMUTABLE
ion_error_code_IERR_KEY_ADDED
ion_error_code_IERR_KEY_ALREADY_EXISTS
ion_error_code_IERR_KEY_NOT_FOUND
ion_error_code_IERR_LOOKAHEAD_OVERFLOW
ion_error_code_IERR_MARK_NOT_SET
ion_error_code_IERR_MAX_ERROR_CODE
ion_error_code_IERR_NEW_LINE_IN_STRING
ion_error_code_IERR_NOT_A_SYMBOL_TABLE
ion_error_code_IERR_NOT_IMPL
ion_error_code_IERR_NO_MEMORY
ion_error_code_IERR_NO_SUCH_ELEMENT
ion_error_code_IERR_NULL_VALUE
ion_error_code_IERR_NUMERIC_OVERFLOW
ion_error_code_IERR_OK
ion_error_code_IERR_PARSER_INTERNAL
ion_error_code_IERR_READ_ERROR
ion_error_code_IERR_SEEK_ERROR
ion_error_code_IERR_STACK_UNDERFLOW
ion_error_code_IERR_STREAM_FAILED
ion_error_code_IERR_TOKEN_TOO_LONG
ion_error_code_IERR_TOO_MANY_ANNOTATIONS
ion_error_code_IERR_UNEXPECTED_EOF
ion_error_code_IERR_UNREAD_LIMIT_EXCEEDED
ion_error_code_IERR_UNRECOGNIZED_FLOAT
ion_error_code_IERR_WRITE_ERROR
rounding_DEC_ROUND_05UP
rounding_DEC_ROUND_CEILING
rounding_DEC_ROUND_DOWN
rounding_DEC_ROUND_FLOOR
rounding_DEC_ROUND_HALF_DOWN
rounding_DEC_ROUND_HALF_EVEN
rounding_DEC_ROUND_HALF_UP
rounding_DEC_ROUND_MAX
rounding_DEC_ROUND_UP
tid_BLOB_INT
tid_BOOL_INT
tid_CLOB_INT
tid_DATAGRAM_INT
tid_DECIMAL_INT
tid_EOF_INT
tid_FLOAT_INT
tid_INT_INT
tid_LIST_INT
tid_NULL_INT
tid_SEXP_INT
tid_STRING_INT
tid_STRUCT_INT
tid_SYMBOL_INT
tid_TIMESTAMP_INT
tid_none_INT

Statics

ION_SYMBOL_IMPORTS_BYTES
ION_SYMBOL_IMPORTS_STRING
ION_SYMBOL_ION_BYTES
ION_SYMBOL_ION_STRING
ION_SYMBOL_MAX_ID_BYTES
ION_SYMBOL_MAX_ID_STRING
ION_SYMBOL_NAME_BYTES
ION_SYMBOL_NAME_STRING
ION_SYMBOL_SHARED_SYMBOL_TABLE_BYTES
ION_SYMBOL_SHARED_SYMBOL_TABLE_STRING
ION_SYMBOL_SYMBOLS_BYTES
ION_SYMBOL_SYMBOLS_STRING
ION_SYMBOL_SYMBOL_TABLE_BYTES
ION_SYMBOL_SYMBOL_TABLE_STRING
ION_SYMBOL_VERSION_BYTES
ION_SYMBOL_VERSION_STRING
ION_SYMBOL_VTM_BYTES
ION_SYMBOL_VTM_STRING
SYSTEM_SYMBOLS
__daylight
__timezone
__tzname
_sys_siglist
daylight
g_Int_Null
g_Int_Zero
g_digit_base_number
g_digit_base_quad
g_int_zero_bytes
g_ion_debug_tracing
g_ion_int_globals_initialized
stderr
stdin
stdout
sys_errlist
sys_nerr
sys_siglist
timezone
tzname

Functions

__getdelim
__libc_current_sigrtmax
__libc_current_sigrtmin
__overflow
__stpcpy
__stpncpy
__strtok_r
__sysv_signal
__uflow
_ion_decimal_from_string_helper
_ion_decimal_number_alloc
_ion_decimal_to_string_number_helper
_ion_decimal_to_string_quad_helper
_ion_int_abs_bytes_length_helper
_ion_int_abs_bytes_signed_length_helper
_ion_int_add_digit
_ion_int_buffer_temp_copy
_ion_int_bytes_length_helper
_ion_int_divide_by_digit
_ion_int_dump_quad
_ion_int_extend_digits
_ion_int_free_temp
_ion_int_from_binary_chars_helper
_ion_int_from_bytes_helper
_ion_int_from_chars_helper
_ion_int_from_decimal_number
_ion_int_from_hex_chars_helper
_ion_int_from_radix_chars_helper
_ion_int_get_char_len_helper
_ion_int_highest_bit_set_helper
_ion_int_init
_ion_int_init_globals
_ion_int_is_high_bytes_high_bit_set_helper
_ion_int_is_null_helper
_ion_int_is_zero
_ion_int_is_zero_bytes
_ion_int_multiply_and_add
_ion_int_realloc_helper
_ion_int_sub_digit
_ion_int_to_bytes_helper
_ion_int_to_decimal_number
_ion_int_to_int64_helper
_ion_int_to_string_helper
_ion_int_validate_arg
_ion_int_validate_arg_with_ptr
_ion_int_validate_non_null_arg_with_ptr
_ion_int_zero
asctime
asctime_r
bcmp
bcopy
bzero
clearerr
clearerr_unlocked
clock
clock_getcpuclockid
clock_getres
clock_gettime
clock_nanosleep
clock_settime
ctermid
ctime
ctime_r
decContextClearStatus
decContextDefault
decContextGetRounding
decContextGetStatus
decContextRestoreStatus
decContextSaveStatus
decContextSetRounding
decContextSetStatus
decContextSetStatusFromString
decContextSetStatusFromStringQuiet
decContextSetStatusQuiet
decContextStatusToString
decContextTestEndian
decContextTestSavedStatus
decContextTestStatus
decContextZeroStatus
decNumberAbs
decNumberAdd
decNumberAnd
decNumberClass
decNumberClassToString
decNumberCompare
decNumberCompareSignal
decNumberCompareTotal
decNumberCompareTotalMag
decNumberCopy
decNumberCopyAbs
decNumberCopyNegate
decNumberCopySign
decNumberDivide
decNumberDivideInteger
decNumberExp
decNumberFMA
decNumberFromInt32
decNumberFromString
decNumberFromUInt32
decNumberGetBCD
decNumberInvert
decNumberIsNormal
decNumberIsSubnormal
decNumberLn
decNumberLog10
decNumberLogB
decNumberMax
decNumberMaxMag
decNumberMin
decNumberMinMag
decNumberMinus
decNumberMultiply
decNumberNextMinus
decNumberNextPlus
decNumberNextToward
decNumberNormalize
decNumberOr
decNumberPlus
decNumberPower
decNumberQuantize
decNumberReduce
decNumberRemainder
decNumberRemainderNear
decNumberRescale
decNumberRotate
decNumberSameQuantum
decNumberScaleB
decNumberSetBCD
decNumberShift
decNumberSquareRoot
decNumberSubtract
decNumberToEngString
decNumberToInt32
decNumberToIntegralExact
decNumberToIntegralValue
decNumberToString
decNumberToUInt32
decNumberTrim
decNumberVersion
decNumberXor
decNumberZero
decQuadAbs
decQuadAdd
decQuadAnd
decQuadCanonical
decQuadClass
decQuadClassString
decQuadCompare
decQuadCompareSignal
decQuadCompareTotal
decQuadCompareTotalMag
decQuadCopy
decQuadCopyAbs
decQuadCopyNegate
decQuadCopySign
decQuadDigits
decQuadDivide
decQuadDivideInteger
decQuadFMA
decQuadFromBCD
decQuadFromInt32
decQuadFromPacked
decQuadFromPackedChecked
decQuadFromString
decQuadFromUInt32
decQuadGetCoefficient
decQuadGetExponent
decQuadInvert
decQuadIsCanonical
decQuadIsFinite
decQuadIsInfinite
decQuadIsInteger
decQuadIsLogical
decQuadIsNaN
decQuadIsNegative
decQuadIsNormal
decQuadIsPositive
decQuadIsSignaling
decQuadIsSignalling
decQuadIsSigned
decQuadIsSubnormal
decQuadIsZero
decQuadLogB
decQuadMax
decQuadMaxMag
decQuadMin
decQuadMinMag
decQuadMinus
decQuadMultiply
decQuadNextMinus
decQuadNextPlus
decQuadNextToward
decQuadOr
decQuadPlus
decQuadQuantize
decQuadRadix
decQuadReduce
decQuadRemainder
decQuadRemainderNear
decQuadRotate
decQuadSameQuantum
decQuadScaleB
decQuadSetCoefficient
decQuadSetExponent
decQuadShift
decQuadShow
decQuadSubtract
decQuadToBCD
decQuadToEngString
decQuadToInt32
decQuadToInt32Exact
decQuadToIntegralExact
decQuadToIntegralValue
decQuadToPacked
decQuadToString
decQuadToUInt32
decQuadToUInt32Exact
decQuadVersion
decQuadXor
decQuadZero
difftime
dprintf
dysize
explicit_bzero
fclose
fdopen
feof
feof_unlocked
ferror
ferror_unlocked
fflush
fflush_unlocked
ffs
ffsl
ffsll
fgetc
fgetc_unlocked
fgetpos
fgets
fileno
fileno_unlocked
flockfile
fmemopen
fopen
fprintf
fputc
fputc_unlocked
fputs
fread
fread_unlocked
freopen
fscanf
fscanf1
fseek
fseeko
fsetpos
ftell
ftello
ftrylockfile
funlockfile
fwrite
fwrite_unlocked
getc
getc_unlocked
getchar
getchar_unlocked
getdelim
getline
getw
gmtime
gmtime_r
gsignal
index
ion_catalog_add_symbol_table
ion_catalog_close

If the given catalog is its own memory owner, its memory and everything it owns is freed. If the given catalog has an external owner and that owner has not been freed, this does nothing; this catalog will be freed when its memory owner is freed. If the given symbol table has an external owner which has been freed, the behavior of this function is undefined.

ion_catalog_find_best_match
ion_catalog_find_symbol_table
ion_catalog_get_symbol_table_count
ion_catalog_open

Allocates a new catalog with itself as its memory owner. Must be freed using ion_catalog_close. @param p_hcatalog - Pointer to a handle to the newly-allocated catalog.

ion_catalog_open_with_owner

Allocates a new catalog with the given owner as its memory owner. @param p_hcatalog - Pointer to a handle to the newly-allocated catalog. @param owner - Handle to the new catalog’s memory owner. If NULL, the resulting catalog is its own memory owner and must be freed using ion_catalog_close.

ion_catalog_release_symbol_table
ion_debug_has_tracing
ion_debug_set_tracing
ion_decimal_abs
ion_decimal_add
ion_decimal_and
ion_decimal_canonical
ion_decimal_claim

If necessary, copies the given decimal’s internal data so that owner of that data may safely go out of scope. This is useful, for example, when it is necessary to keep the value in scope after the reader that produced it is closed. Values produced through calls to ion_decimal_* APIs (with the possible exception of ion_decimal_from_number) do NOT need to be claimed.

ion_decimal_compare

Compares ION_DECIMALs for ordering and equivalence under the Ion data model. A negative result indicates that left is less than right. A positive result indicates that left is greater than right. A result of zero indicates that left and right are equivalent under the Ion data model. Non-equivalent values are ordered according to the IEEE 754 total ordering.

ion_decimal_copy
ion_decimal_copy_abs
ion_decimal_copy_negate
ion_decimal_copy_sign
ion_decimal_digits
ion_decimal_divide
ion_decimal_divide_integer
ion_decimal_equals

Compares ION_DECIMALs for equivalence under the Ion data model. That is, the sign, coefficient, and exponent must be equivalent for the normalized values (even for zero).

ion_decimal_equals_quad

Compares decQuads for equivalence under the Ion data model. That is, the sign, coefficient, and exponent must be equivalent for the normalized values (even for zero).

ion_decimal_fma
ion_decimal_free

Frees any memory that was allocated when constructing this value. This should be called to clean up all ION_DECIMALs.

ion_decimal_from_int32

Represents the given int32 as an ION_DECIMAL.

ion_decimal_from_ion_int

Converts the given ION_INT to its ION_DECIMAL representation.

ion_decimal_from_number

Represents the given decNumber as an ION_DECIMAL. This function does not allocate or copy any memory, so the caller IS required to keep the given decNumber in scope for the lifetime of the resulting ION_DECIMAL. If desired, the caller can alleviate this requirement by calling ion_decimal_claim on the resulting ION_DECIMAL (note that this forces a copy). It is the caller’s responsibility to eventually free any dynamically allocated memory used by the given decNumber (calling ion_decimal_free will not free this memory).

ion_decimal_from_quad

Represents the given decQuad as an ION_DECIMAL. The caller IS NOT required to keep the given decQuad in scope for the lifetime of the resulting ION_DECIMAL.

ion_decimal_from_string

Converts the given string to its ION_DECIMAL representation.

ion_decimal_from_uint32

Represents the given uint32 as an ION_DECIMAL.

ion_decimal_get_exponent
ion_decimal_invert
ion_decimal_is_canonical
ion_decimal_is_finite
ion_decimal_is_infinite
ion_decimal_is_integer
ion_decimal_is_nan
ion_decimal_is_negative
ion_decimal_is_normal
ion_decimal_is_subnormal
ion_decimal_is_zero
ion_decimal_logb
ion_decimal_max
ion_decimal_max_mag
ion_decimal_min
ion_decimal_min_mag
ion_decimal_minus
ion_decimal_multiply
ion_decimal_or
ion_decimal_plus
ion_decimal_quantize
ion_decimal_radix
ion_decimal_reduce
ion_decimal_remainder
ion_decimal_remainder_near
ion_decimal_rotate
ion_decimal_same_quantum
ion_decimal_scaleb
ion_decimal_shift
ion_decimal_subtract
ion_decimal_to_int32
ion_decimal_to_integral_exact
ion_decimal_to_integral_value
ion_decimal_to_ion_int

Converts the given ION_DECIMAL to its ION_INT representation. If the given ION_DECIMAL is not an integer, IERR_INVALID_ARG will be returned; rounding will never occur. If rounding is desired, use ion_decimal_to_integral_exact or ion_decimal_to_integral_value first.

ion_decimal_to_string

Converts the given ION_DECIMAL to a string. ION_DECIMAL_STRLEN may be used to determine the amount of space required to hold the string representation.

ion_decimal_to_uint32
ion_decimal_xor
ion_decimal_zero

Zeroes the given ION_DECIMAL in-place. NOTE: this has better performance than memset in certain environments.

ion_error_to_str

Gets a static string representation of an error code.

ion_float_is_negative_zero
ion_int_abs_bytes_length
ion_int_alloc
ion_int_byte_length
ion_int_char_length
ion_int_compare
ion_int_copy
ion_int_free
ion_int_from_abs_bytes
ion_int_from_binary_chars
ion_int_from_binary_string
ion_int_from_bytes
ion_int_from_chars
ion_int_from_decimal

@deprecated use of decQuads directly is deprecated. ION_DECIMAL should be used. See ion_decimal_to_ion_int.

ion_int_from_hex_chars
ion_int_from_hex_string
ion_int_from_long
ion_int_from_string
ion_int_highest_bit_set
ion_int_init
ion_int_is_null
ion_int_is_zero
ion_int_signum
ion_int_to_abs_bytes
ion_int_to_bytes
ion_int_to_char
ion_int_to_decimal

@deprecated use of decQuads directly is deprecated. ION_DECIMAL should be used. See ion_decimal_from_ion_int.

ion_int_to_int32
ion_int_to_int64
ion_int_to_string
ion_reader_close

Closes a reader and releases associated memory. The caller is responsible for releasing the underlying buffer (if any). After calling this method the given handle will no longer be value.

ion_reader_get_an_annotation
ion_reader_get_an_annotation_symbol
ion_reader_get_annotation_count
ion_reader_get_annotation_symbols
ion_reader_get_annotations
ion_reader_get_catalog
ion_reader_get_depth
ion_reader_get_field_name
ion_reader_get_field_name_symbol
ion_reader_get_lob_size
ion_reader_get_position
ion_reader_get_string_length

Determines the content of the current text value, which must be an Ion string or symbol. The reader retains ownership of the returned byte array, and the caller must copy the data out (if necessary) before moving the cursor.

ion_reader_get_symbol_table

returns the current symbol table the value the reader is currently positioned on. This can be used to reset the readers symbol table is you wish to seek in a stream which contains multiple symbol tables. This symbol table handle can be used to call ion_reader_set_symbol_table.

ion_reader_get_type

Returns the type of the current value, or tid_none if no value has been assigned. (before next() is called)

ion_reader_get_value_length

returns the length of the value the reader is currently positioned on. This length is appropriate to use later when calling ion_reader_seek to limit “over-reading” in the underlying stream which could result in errors that are not really of interest. NOTE: readers of text data will always set *p_length to -1 because text Ion data is not length-prefixed. When the reader may be reading text Ion data, the correct way to calculate a value’s length is by subtracting the current value’s offset (see ion_reader_get_value_offset) from the next value’s offset. This technique will work for both binary and text Ion data.

ion_reader_get_value_offset

returns the offset of the value the reader is currently positioned on. This offset is appropriate to use later to seek to.

ion_reader_has_annotation
ion_reader_has_any_annotations
ion_reader_is_in_struct
ion_reader_is_null
ion_reader_next

Returns the next ION_TYPE in the stream. In case of EOF, IERR_OK will be returned. p_value_type = tid_EOF. @param hreader @param p_value_type ION_TYPE (tid_EOF, tid_BOOL, etc, defined in ion_const.h). tid_EOF if EOF.

ion_reader_open
ion_reader_open_buffer

Allocates a new reader consuming a given buffer of data.

ion_reader_open_stream

Create hREADER object, and associate it with the stream for reading.

ion_reader_read_bool
ion_reader_read_decimal

@deprecated use of decQuads directly is deprecated. ION_DECIMAL should be used. See ion_reader_read_ion_decimal.

ion_reader_read_double
ion_reader_read_int

Read integer value from Ion stream. The size of the integer is sizeof(int) If the value in the Ion stream does not fit into the variable, it will return with IERR_NUMERIC_OVERFLOW.

ion_reader_read_int32

Read integer value from Ion stream. The size of the integer is sizeof(int32_t) If the value in the Ion stream does not fit into the variable, it will return with IERR_NUMERIC_OVERFLOW.

ion_reader_read_int64

Read integer value from Ion stream. The size of the integer is sizeof(int64_t) If the value in the Ion stream does not fit into the variable, it will return with IERR_NUMERIC_OVERFLOW.

ion_reader_read_ion_decimal
ion_reader_read_ion_int

Read integer value from Ion stream. This supports arbitary length integers defined by ion_int.

ion_reader_read_ion_symbol

Read the current symbol value as an ION_SYMBOL.

ion_reader_read_lob_bytes
ion_reader_read_lob_partial_bytes
ion_reader_read_long

Read integer value from Ion stream. The size of the integer is sizeof(long), which is 4 or 8 bytes depends on the OS If the value in the Ion stream does not fit into the variable, it will return with IERR_NUMERIC_OVERFLOW.

ion_reader_read_null
ion_reader_read_partial_string
ion_reader_read_string
ion_reader_read_timestamp

@return IERR_NULL_VALUE if the current value is null.timestamp.

ion_reader_reset_stream

Resets input stream for given reader.

ion_reader_reset_stream_with_length

Resets input user-managed stream for given reader.

ion_reader_seek

moves the stream position to the specified offset. Resets the the state of the reader to be at the top level. As long as the specified position is at the first byte of a top-level value (just before the type description byte) this will work neatly. Do not attempt to seek to a value below the top level, as the view of the data is likely to be invalid.

ion_reader_set_symbol_table

set the current symbol table to the table passed in. This can be used to reset the readers symbol table is you wish to seek in a stream which contains multiple symbol tables. This symbol table handle should be a handle returned by ion_reader_get_symbol_table.

ion_reader_step_in
ion_reader_step_out
ion_stream_can_mark
ion_stream_can_read
ion_stream_can_seek
ion_stream_can_write
ion_stream_close
ion_stream_flush
ion_stream_get_file_stream
ion_stream_get_mark_start
ion_stream_get_marked_length
ion_stream_get_position
ion_stream_is_dirty
ion_stream_is_mark_open
ion_stream_mark
ion_stream_mark_clear
ion_stream_mark_remark
ion_stream_mark_rewind
ion_stream_open_buffer
ion_stream_open_fd_in
ion_stream_open_fd_out
ion_stream_open_fd_rw
ion_stream_open_file_in
ion_stream_open_file_out
ion_stream_open_file_rw
ion_stream_open_handler_in
ion_stream_open_handler_out
ion_stream_open_memory_only
ion_stream_open_stderr
ion_stream_open_stdin
ion_stream_open_stdout
ion_stream_read
ion_stream_read_byte
ion_stream_seek
ion_stream_skip
ion_stream_truncate
ion_stream_unread_byte
ion_stream_write
ion_stream_write_byte
ion_stream_write_byte_no_checks
ion_stream_write_stream
ion_string_assign
ion_string_assign_cstr
ion_string_copy_to_owner
ion_string_get_byte

Returns -1 is idx is out of range or str is null

ion_string_get_bytes

Gets a pointer to the UTF-8 bytes held by the string. The number of bytes in the string is determined via ion_string_get_length().

ion_string_get_length

Gets the number of UTF-8 bytes held by the string.

ion_string_init
ion_string_is_equal
ion_string_is_null
ion_string_strdup
ion_symbol_copy_to_owner

Copies an ION_SYMBOL to a new memory owner.

ion_symbol_is_equal

Compares the two given ION_SYMBOLs for equality under the Ion data model.

ion_symbol_table_add_import

Imports a shared symbol table into a local symbol table, given a description of the import and the catalog in which it can be found. NOTE: the best match for the described shared symbol table import that is available in the catalog will be used. If no match is found, all of the import’s symbols will be considered to have unknown text. @param hsymtab - The local symbol table into which the imported symbol table will be incorporated. @param pimport - The description of the shared symbol table to be imported. @param catalog - The catalog to query for the matching shared symbol table.

ion_symbol_table_add_symbol
ion_symbol_table_clone

Clones the given symbol table, using that symbol table’s memory owner as the owner of the newly allocated symbol table. @param hsymtab - They symbol table to clone. @param p_hclone - Pointer to a handle to the newly-allocated symbol table clone.

ion_symbol_table_clone_with_owner

Clones the given symbol table, using the given owner as the newly-allocated symbol table’s memory owner. @param hsymtab - They symbol table to clone. @param p_hclone - Pointer to a handle to the newly-allocated symbol table clone. @param owner - Handle to the new symbol table’s memory owner. If NULL, the resulting symbol table is its own memory owner and must be freed using ion_symbol_table_close.

ion_symbol_table_close

If the given symbol table is its own memory owner, its memory and everything it owns is freed. If the given symbol table has an external owner and that owner has not been freed, this does nothing; this symbol table will be freed when its memory owner is freed. If the given symbol table has an external owner which has been freed, the behavior of this function is undefined. NOTE: Symbol tables constructed and returned by readers and writers are owned by those readers and writers.

ion_symbol_table_find_by_name
ion_symbol_table_find_by_sid
ion_symbol_table_get_imports
ion_symbol_table_get_local_symbol
ion_symbol_table_get_max_sid
ion_symbol_table_get_name
ion_symbol_table_get_symbol
ion_symbol_table_get_system_table

Gets the global system symbol table for the given Ion version. This global system symbol table must never be closed. @param p_hsystem_table - Pointer to a handle to the global system symbol table. @param version - The Ion version. Currently, must be 1.

ion_symbol_table_get_type
ion_symbol_table_get_version
ion_symbol_table_import_symbol_table

Imports a shared symbol table into a local symbol table. @param hsymtab - The local symbol table into which the imported symbol table will be incorporated. @param hsymtab_import - The shared symbol table to import.

ion_symbol_table_is_locked
ion_symbol_table_is_symbol_known
ion_symbol_table_load

Deserializes a symbol table (shared or local) from the given reader. @param hreader - The reader, positioned at the start of the symbol table struct. @param owner - Handle to the new symbol table’s memory owner. If NULL, the resulting symbol table is its own memory owner and must be freed using ion_symbol_table_close. @param p_hsymtab - Pointer to a handle to the newly-allocated symbol table.

ion_symbol_table_lock
ion_symbol_table_open

Allocates a new local symbol table. @param p_hsymtab - Pointer to a handle to the newly-allocated symbol table. @param owner - Handle to the new symbol table’s memory owner. If NULL, the resulting symbol table is its own memory owner and must be freed using ion_symbol_table_close.

ion_symbol_table_open_with_type

Allocates a new local symbol table of the given type (i.e. shared or local). @param p_hsymtab - Pointer to a handle to the newly-allocated symbol table. @param owner - Handle to the new symbol table’s memory owner. If NULL, the resulting symbol table is its own memory owner and must be freed using ion_symbol_table_close.

ion_symbol_table_set_max_sid
ion_symbol_table_set_name
ion_symbol_table_set_version
ion_symbol_table_type_to_str
ion_symbol_table_unload

Serializes a symbol table (shared or local) using the given writer. @param hsymtab - The symbol table to serialize. @param hwriter - The writer (text or binary).

ion_timestamp_equals

Comparing two timestamps to see whether they represent the same point in time. Two timestamp of different precision will return false

ion_timestamp_for_day

Initialize ION_TIMESTAMP object with value specified. It will have ION_TS_DAY precision

ion_timestamp_for_fraction

Initialize ION_TIMESTAMP object with value specified. *p_fraction have a range of (0, 1), not including 0 (without significant digit) and 1. 0.0 (0d-1), 0.00(0d-2) is valid, while 0 or 0. is not.

ion_timestamp_for_minute

Initialize ION_TIMESTAMP object with value specified. It will have ION_TS_MIN precision

ion_timestamp_for_month

Initialize ION_TIMESTAMP object with value specified. It will have ION_TS_MONTH precision

ion_timestamp_for_second

Initialize ION_TIMESTAMP object with value specified. It will have ION_TS_SEC precision

ion_timestamp_for_time_t

Initialize ION_TIMESTAMP object with value specified in time_t time_t can be constructed using time() or mktime(), timegm, and it contains ION_TS_SEC precision.

ion_timestamp_for_year

Initialize ION_TIMESTAMP object with value specified. It will have ION_TS_YEAR precision

ion_timestamp_get_local_offset

Gets the effective local offset of a timestamp. The result is zero for timestamps with offsets “Z”, “+00:00”, or “-00:00”. In other words, if ion_timestamp_has_local_offset returns false, this returns zero.

ion_timestamp_get_precision

Get the time precision for the given timestamp object. The precision values are defined as ION_TS_YEAR, ION_TS_MONTH, ION_TS_DAY, ION_TS_MIN, ION_TS_SEC and ION_TS_FRAC

ion_timestamp_get_thru_day

Get year, month, day If precision is not up to month/day, 0 will be returned as month/day value.

ion_timestamp_get_thru_fraction

Get time up to fraction of second precision. If precision is not up to fraction, 0 will be returned.

ion_timestamp_get_thru_minute

Get time up to minute precision. If precision is not up to hour/minute, 0 will be returned as hour/minute value.

ion_timestamp_get_thru_month

Get year, month If precision is not up to month, 0 will be returned as month value.

ion_timestamp_get_thru_second

Get time up to second precision. If precision is not up to hour/minute/second, 0 will be returned as hour/minute/second value.

ion_timestamp_get_thru_year

Get year

ion_timestamp_has_local_offset

Determines whether a timestamp has a defined local offset (for example, “+08:00” or “Z”. Otherwise, it’s local offest is unknown (“-00:00”), and effectively zero.

ion_timestamp_instant_equals

Compare timestamps for instant equality only (i.e. precision and local offsets need not be equivalent). NOTE: if this has any use externally, it could be exposed. If not, it should be removed.

ion_timestamp_parse

Parse timestamp string and construct timestamp object in ptime. This expects a null terminated string.

ion_timestamp_set_local_offset

Changes the local offset of a timestamp. If the timestamp has less than minute precision, the given offset is ignored and the timestamp is unchanged. If the timestamp is changed, ion_timestamp_has_local_offset will be true, and ion_timestamp_get_local_offset will be the given offset.

ion_timestamp_to_string

Get the string format of timestamp.

ion_timestamp_to_time_t

Fill time_t with value in ION_TIMESTAMP

ion_timestamp_unset_local_offset

Removes any local offset from a timestamp. Afterwards, ion_timestamp_has_local_offset will be false, and ion_timestamp_get_local_offset will be zero.

ion_writer_add_annotation
ion_writer_add_annotation_symbol
ion_writer_add_imported_tables

Adds the given list of imports to the writer’s list of imports. These imports will only be used in the writer’s current symbol table context. To configure the writer to use the same list of imports for each new symbol table context, convey that list of imports through ION_WRITER_OPTIONS.

ion_writer_append_lob
ion_writer_clear_annotations
ion_writer_clear_field_name
ion_writer_close

Finishes the writer, frees the writer’s associated resources, and finally frees the writer itself. The writer may not continue writing to the stream after this function is called. If any value is in-progress, closing any writer raises an error, but still frees the writer and any associated memory.

ion_writer_finish

Flushes pending bytes, ending the current symbol table context and forcing an Ion Version Marker if the writer continues writing to the stream. If writer was created using open_stream, also flushes write buffer to stream. If any value is in-progress, finishing any writer is an error. @param p_bytes_flushed - the number of bytes written into the buffer/stream.

ion_writer_finish_container
ion_writer_finish_lob
ion_writer_flush

Flushes pending bytes without forcing an Ion Version Marker or ending the current symbol table context. If writer was created using open_stream, also flushes write buffer to stream. If any value is in-progress, flushing any writer is an error. @param p_bytes_flushed - the number of bytes written into the buffer/stream.

ion_writer_get_catalog
ion_writer_get_depth
ion_writer_get_symbol_table
ion_writer_open
ion_writer_open_buffer

Ion Writer interfaces. Takes a byte buffer and length which will contain the text or binary content, returns handle to a writer. @param p_hwriter @param buffer Byte buffer, allocated and provided by caller. @param buf_length size of the buffer (0 or greater). If the buffer is not big enough, ion_write operation will return IERR_EOF rather than IERR_OK. @param p_option writer configuration object.

ion_writer_open_stream

Open stream to write ion data. @param p_hwriter @param fn_block_handler User provided function to write from handler_state buffer to file, @param handler_state Related to write buffer. ion_writer will write to the buffer provided by the handler_state, fn_block_handler will write the buffer to file. @param p_options writer configuration object. @see ion_reader_open_stream @see ion_writer_open_buffer

ion_writer_options_add_shared_imports

Adds the imports from the given collection of ION_SYMBOL_TABLE_IMPORT to the options’ imports list. ion_writer_options_initialize_shared_imports must have been called first. The given collection must not contain a system symbol table.

ion_writer_options_add_shared_imports_symbol_tables

Adds the given array of ION_SYMBOL_TABLE (which must be shared symbol tables) to the options’ imports list. ion_writer_options_initialize_shared_imports must have been called first. The given array must not contain a system symbol table.

ion_writer_options_close_shared_imports

Frees the options’ imports list. This must be done once the options are no longer needed, and only if ion_writer_options_initialize_shared_imports was called.

ion_writer_options_initialize_shared_imports

Initializes the options’ imports list. This must be done before calling ion_writer_options_add_*. NOTE: This does NOT need to be called if the writer does not need to use shared imports. @param options - The writer options containing the imports list to initialize.

ion_writer_set_catalog
ion_writer_set_symbol_table

Sets the writer’s symbol table.

ion_writer_start_container
ion_writer_start_lob
ion_writer_write_all_values
ion_writer_write_annotation_symbols
ion_writer_write_annotations
ion_writer_write_blob
ion_writer_write_bool
ion_writer_write_clob
ion_writer_write_decimal

@deprecated use of decQuads directly is deprecated. ION_DECIMAL should be used. See ion_writer_write_ion_decimal.

ion_writer_write_double
ion_writer_write_field_name

Sets the writer’s current field name. Only valid if the writer is currently in a struct. It is the caller’s responsibility to keep name in scope until the writer’s next value is written.

ion_writer_write_field_name_symbol

Sets the writer’s current field name from the given Ion symbol. Only valid if the writer is currently in a struct. It is the caller’s responsibility to keep field_name in scope until the writer’s next value is written.

ion_writer_write_float
ion_writer_write_int
ion_writer_write_int32
ion_writer_write_int64
ion_writer_write_ion_decimal
ion_writer_write_ion_int
ion_writer_write_ion_symbol
ion_writer_write_long
ion_writer_write_null
ion_writer_write_one_value
ion_writer_write_string
ion_writer_write_symbol
ion_writer_write_timestamp
ion_writer_write_typed_null
kill
killpg
localtime
localtime_r
memccpy
memchr
memcmp
memcpy
memmove
memset
mktime
nanosleep
open_memstream
pclose
perror
popen
printf
psiginfo
psignal
pthread_kill
pthread_sigmask
putc
putc_unlocked
putchar
putchar_unlocked
puts
putw
raise
remove
rename
renameat
rewind
rindex
scanf
scanf1
setbuf
setbuffer
setlinebuf
setvbuf
sigaction
sigaddset
sigaltstack
sigblock
sigdelset
sigemptyset
sigfillset
siggetmask
siginterrupt
sigismember
signal
sigpending
sigprocmask
sigqueue
sigreturn
sigsetmask
sigstack
sigsuspend
sigtimedwait
sigwait
sigwaitinfo
snprintf
sprintf
sscanf
sscanf1
ssignal
stpcpy
stpncpy
strcasecmp
strcasecmp_l
strcat
strchr
strcmp
strcoll
strcoll_l
strcpy
strcspn
strdup
strerror
strerror_l
strerror_r
strftime
strftime_l
strlen
strncasecmp
strncasecmp_l
strncat
strncmp
strncpy
strndup
strnlen
strpbrk
strrchr
strsep
strsignal
strspn
strstr
strtok
strtok_r
strxfrm
strxfrm_l
tempnam
time
timegm
timelocal
timer_create
timer_delete
timer_getoverrun
timer_gettime
timer_settime
timespec_get
tmpfile
tmpnam
tmpnam_r
tzset
ungetc
vdprintf
vfprintf
vfscanf
vfscanf1
vprintf
vscanf
vscanf1
vsnprintf
vsprintf
vsscanf
vsscanf1

Type Definitions

BOOL
BYTE
FILE
II_DIGIT
II_LONG_DIGIT
ION_CATALOG
ION_COLLECTION
ION_COLLECTION_CURSOR
ION_COLLECTION_NODE
ION_DECIMAL
ION_DECIMAL_TYPE

Determines which value of the _ion_decimal’s value field is active.

ION_INT
ION_PAGE
ION_READER
ION_READER_CONTEXT_CALLBACK

A function that may be called by the reader upon a change to the stream’s symbol table context.

ION_READER_CONTEXT_CHANGE_NOTIFIER
ION_READER_OPTIONS

Reader configuration data, could be supplied by user during reader creation time. All fields in the structure are defaulted to 0, except for the following:

ION_STREAM
ION_STREAM_HANDLER
ION_STREAM_PAGED
ION_STREAM_USER_PAGED
ION_STRING

An Ion String.

ION_SYMBOL
ION_SYMBOL_IMPORT_LOCATION
ION_SYMBOL_TABLE
ION_SYMBOL_TABLE_IMPORT
ION_SYMBOL_TABLE_IMPORT_DESCRIPTOR
ION_TIMESTAMP
ION_TYPE

Strong typed enum over pointer type.

ION_WRITER
ION_WRITER_OPTIONS
PAGE_ID
POSITION
SID
SIZE
_ION_SYMBOL_TABLE_TYPE
_IO_lock_t
__FILE
__blkcnt64_t
__blkcnt_t
__blksize_t
__builtin_va_list
__caddr_t
__clock_t
__clockid_t
__daddr_t
__dev_t
__fpos64_t
__fpos_t
__fsblkcnt64_t
__fsblkcnt_t
__fsfilcnt64_t
__fsfilcnt_t
__fsword_t
__gid_t
__gnuc_va_list
__id_t
__ino64_t
__ino_t
__int8_t
__int16_t
__int32_t
__int64_t
__int_least8_t
__int_least16_t
__int_least32_t
__int_least64_t
__intmax_t
__intptr_t
__key_t
__locale_t
__loff_t
__mode_t
__nlink_t
__off64_t
__off_t
__pid_t
__pthread_list_t
__pthread_slist_t
__quad_t
__rlim64_t
__rlim_t
__sig_atomic_t
__sighandler_t
__sigval_t
__socklen_t
__ssize_t
__suseconds_t
__syscall_slong_t
__syscall_ulong_t
__time_t
__timer_t
__u_char
__u_int
__u_long
__u_quad_t
__u_short
__uid_t
__uint8_t
__uint16_t
__uint32_t
__uint64_t
__uint_least8_t
__uint_least16_t
__uint_least32_t
__uint_least64_t
__uintmax_t
__useconds_t
_bindgen_ty_1
_bindgen_ty_2
_bindgen_ty_3
_bindgen_ty_4
_bindgen_ty_5
_bindgen_ty_6
_bindgen_ty_7
_bindgen_ty_8
_bindgen_ty_9
clock_t
clockid_t
decClass
fpos_t
fpregset_t
greg_t
gregset_t
hCATALOG
hOWNER
hREADER
hSYMTAB
hWRITER
iCATALOG
iIMPORT
iSTREAM
iSTRING
iSYMBOL
iSYMTAB
iTIMESTAMP
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
int_least8_t
int_least16_t
int_least32_t
int_least64_t
intmax_t
ion_error_code

define the Ion error code enumeration.

locale_t
off_t
pid_t
pthread_key_t
pthread_once_t
pthread_spinlock_t
pthread_t
rounding
sig_atomic_t
sig_t
sigevent_t
sigset_t
sigval_t
size_t
ssize_t
time_t
timer_t
uid_t
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
uintmax_t
va_list

Unions

__mbstate_t__bindgen_ty_1
__pthread_cond_s__bindgen_ty_1
__pthread_cond_s__bindgen_ty_2
_ion_decimal__bindgen_ty_1
decQuad
pthread_attr_t
pthread_barrier_t
pthread_barrierattr_t
pthread_cond_t
pthread_condattr_t
pthread_mutex_t
pthread_mutexattr_t
pthread_rwlock_t
pthread_rwlockattr_t
sigaction__bindgen_ty_1
sigcontext__bindgen_ty_1
sigevent__bindgen_ty_1
siginfo_t__bindgen_ty_1
siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1
sigval