Scroll to navigation

libnk2(3) Library Functions Manual libnk2(3)

NAME

libnk2.hLibrary to access the Nickfile (NK2) format

SYNOPSIS

#include <libnk2.h>

Support functions
const char *
libnk2_get_version(void);

int
libnk2_get_access_flags_read(void);

int
libnk2_get_codepage(int *codepage, libnk2_error_t **error);

int
libnk2_set_codepage(int codepage, libnk2_error_t **error);

int
libnk2_check_file_signature(const char *filename, libnk2_error_t **error);

Available when compiled with wide character string support:
int
libnk2_check_file_signature_wide(const wchar_t *filename, libnk2_error_t **error);

Available when compiled with libbfio support:
int
libnk2_check_file_signature_file_io_handle(libbfio_handle_t *file_io_handle, libnk2_error_t **error);

Notify functions
void
libnk2_notify_set_verbose(int verbose);

int
libnk2_notify_set_stream(FILE *stream, libnk2_error_t **error);

int
libnk2_notify_stream_open(const char *filename, libnk2_error_t **error);

int
libnk2_notify_stream_close(libnk2_error_t **error);

Error functions
void
libnk2_error_free(libnk2_error_t **error);

int
libnk2_error_fprint(libnk2_error_t *error, FILE *stream);

int
libnk2_error_sprint(libnk2_error_t *error, char *string, size_t size);

int
libnk2_error_backtrace_fprint(libnk2_error_t *error, FILE *stream);

int
libnk2_error_backtrace_sprint(libnk2_error_t *error, char *string, size_t size);

File functions
int
libnk2_file_initialize(libnk2_file_t **file, libnk2_error_t **error);

int
libnk2_file_free(libnk2_file_t **file, libnk2_error_t **error);

int
libnk2_file_signal_abort(libnk2_file_t *file, libnk2_error_t **error);

int
libnk2_file_open(libnk2_file_t *file, const char *filename, int access_flags, libnk2_error_t **error);

int
libnk2_file_close(libnk2_file_t *file, libnk2_error_t **error);

int
libnk2_file_get_ascii_codepage(libnk2_file_t *file, int *ascii_codepage, libnk2_error_t **error);

int
libnk2_file_set_ascii_codepage(libnk2_file_t *file, int ascii_codepage, libnk2_error_t **error);

int
libnk2_file_get_modification_time(libnk2_file_t *file, uint64_t *filetime, libnk2_error_t **error);

int
libnk2_file_get_number_of_items(libnk2_file_t *file, int *number_of_items, libnk2_error_t **error);

int
libnk2_file_get_item(libnk2_file_t *file, int item_index, libnk2_item_t **item, libnk2_error_t **error);

Available when compiled with wide character string support:
int
libnk2_file_open_wide(libnk2_file_t *file, const wchar_t *filename, int access_flags, libnk2_error_t **error);

Available when compiled with libbfio support:
int
libnk2_file_open_file_io_handle(libnk2_file_t *file, libbfio_handle_t *file_io_handle, int access_flags, libnk2_error_t **error);

Item functions
int
libnk2_item_free(libnk2_item_t **item, libnk2_error_t **error);

int
libnk2_item_get_identifier(libnk2_item_t *item, uint32_t *identifier, libnk2_error_t **error);

int
libnk2_item_get_number_of_entries(libnk2_item_t *item, int *number_of_entries, libnk2_error_t **error);

int
libnk2_item_get_entry_by_index(libnk2_item_t *item, int entry_index, libnk2_record_entry_t **record_entry, libnk2_error_t **error);

int
libnk2_item_get_entry_by_type(libnk2_item_t *item, uint32_t entry_type, uint32_t value_type, libnk2_record_entry_t **record_entry, uint8_t flags, libnk2_error_t **error);

Record entry functions
int
libnk2_record_entry_free(libnk2_record_entry_t **record_entry, libnk2_error_t **error);

int
libnk2_record_entry_get_entry_type(libnk2_record_entry_t *record_entry, uint32_t *entry_type, libnk2_error_t **error);

int
libnk2_record_entry_get_value_type(libnk2_record_entry_t *record_entry, uint32_t *value_type, libnk2_error_t **error);

int
libnk2_record_entry_get_data_size(libnk2_record_entry_t *record_entry, size_t *data_size, libnk2_error_t **error);

int
libnk2_record_entry_get_data(libnk2_record_entry_t *record_entry, uint8_t *data, size_t data_size, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_boolean(libnk2_record_entry_t *record_entry, uint8_t *value_boolean, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_16bit_integer(libnk2_record_entry_t *record_entry, uint16_t *value_16bit, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_32bit_integer(libnk2_record_entry_t *record_entry, uint32_t *value_32bit, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_64bit_integer(libnk2_record_entry_t *record_entry, uint64_t *value_64bit, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_filetime(libnk2_record_entry_t *record_entry, uint64_t *filetime, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_floatingtime(libnk2_record_entry_t *record_entry, uint64_t *floatingtime, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_size(libnk2_record_entry_t *record_entry, size64_t *value_size, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_floating_point(libnk2_record_entry_t *record_entry, double *value_floating_point, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_utf8_string_size(libnk2_record_entry_t *record_entry, size_t *utf8_string_size, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_utf8_string(libnk2_record_entry_t *record_entry, uint8_t *utf8_string, size_t utf8_string_size, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_utf16_string_size(libnk2_record_entry_t *record_entry, size_t *utf16_string_size, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_utf16_string(libnk2_record_entry_t *record_entry, uint16_t *utf16_string, size_t utf16_string_size, libnk2_error_t **error);

int
libnk2_record_entry_get_data_as_guid(libnk2_record_entry_t *record_entry, uint8_t *guid_data, size_t guid_data_size, libnk2_error_t **error);

DESCRIPTION

The () function is used to retrieve the library version.

RETURN VALUES

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libnk2.h".

ENVIRONMENT

None

FILES

None

NOTES

libnk2 can be compiled with wide character support (wchar_t).

To compile libnk2 with wide character support use: ./configure --enable-wide-character-type=yes
or define: _UNICODE
or UNICODE
during compilation.

LIBNK2_WIDE_CHARACTER_TYPE
in libnk2/features.h can be used to determine if libnk2 was compiled with wide character support.

BUGS

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libnk2/issues

AUTHOR

These man pages are generated from "libnk2.h".

COPYRIGHT

Copyright (C) 2009-2024, Joachim Metz <joachim.metz@gmail.com>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO

the libnk2.h include file

April 20, 2019 libnk2