libwrc(3)

NAME
libwrc.h - Library to access the Windows Resource Compiler (WRC) format

SYNOPSIS
#include <libwrc.h>

Support functions
const char *
libwrc_get_version(void);
int
libwrc_get_access_flags_read(void);
int
libwrc_get_codepage(int *codepage, libwrc_error_t **error);
int
libwrc_set_codepage(int codepage, libwrc_error_t **error);

Notify functions
void
libwrc_notify_set_verbose(int verbose);
int
libwrc_notify_set_stream(FILE *stream, libwrc_error_t **error);
int
libwrc_notify_stream_open(const char *filename, libwrc_error_t **error);
int
libwrc_notify_stream_close(libwrc_error_t **error);

Error functions
void
libwrc_error_free(libwrc_error_t **error);
int
libwrc_error_fprint(libwrc_error_t *error, FILE *stream);
int
libwrc_error_sprint(libwrc_error_t *error, char *string, size_t size);
int
libwrc_error_backtrace_fprint(libwrc_error_t *error, FILE *stream);
int
libwrc_error_backtrace_sprint(libwrc_error_t *error, char *string, size_t size);

Stream functions
int
libwrc_stream_initialize(libwrc_stream_t **stream, libwrc_error_t **error);
int
libwrc_stream_free(libwrc_stream_t **stream, libwrc_error_t **error);
int
libwrc_stream_signal_abort(libwrc_stream_t *stream, libwrc_error_t **error);
int
libwrc_stream_open(libwrc_stream_t *stream, const char *filename, int access_flags, libwrc_error_t **error);
int
libwrc_stream_close(libwrc_stream_t *stream, libwrc_error_t **error);
int
libwrc_stream_get_ascii_codepage(libwrc_stream_t *stream, int *ascii_codepage, libwrc_error_t **error);
int
libwrc_stream_set_ascii_codepage(libwrc_stream_t *stream, int ascii_codepage, libwrc_error_t **error);
int
libwrc_stream_get_virtual_address(libwrc_stream_t *stream, uint32_t *virtual_address, libwrc_error_t **error);
int
libwrc_stream_set_virtual_address(libwrc_stream_t *stream, uint32_t virtual_address, libwrc_error_t **error);
int
libwrc_stream_get_number_of_resources(libwrc_stream_t *stream, int *number_of_resources, libwrc_error_t **error);
int
libwrc_stream_get_resource_by_index(libwrc_stream_t *stream, int resource_index, libwrc_resource_t **resource, libwrc_error_t **error);
int
libwrc_stream_get_resource_by_identifier(libwrc_stream_t *stream, uint32_t identifier, libwrc_resource_t **resource, libwrc_error_t **error);
int
libwrc_stream_get_resource_by_type(libwrc_stream_t *stream, int type, libwrc_resource_t **resource, libwrc_error_t **error);
int
libwrc_stream_get_resource_by_utf8_name(libwrc_stream_t *stream, const uint8_t *utf8_string, size_t utf8_string_length, libwrc_resource_t **resource, libwrc_error_t **error);
int
libwrc_stream_get_resource_by_utf16_name(libwrc_stream_t *stream, const uint16_t *utf16_string, size_t utf16_string_length, libwrc_resource_t **resource, libwrc_error_t **error);

Available when compiled with wide character string support:
int
libwrc_stream_open_wide(libwrc_stream_t *stream, const wchar_t *filename, int access_flags, libwrc_error_t **error);

Available when compiled with libbfio support:
int
libwrc_stream_open_file_io_handle(libwrc_stream_t *stream, libbfio_handle_t *file_io_handle, int access_flags, libwrc_error_t **error);

Resource functions
int
libwrc_resource_free(libwrc_resource_t **resource, libwrc_error_t **error);
int
libwrc_resource_get_identifier(libwrc_resource_t *resource, uint32_t *identifier, libwrc_error_t **error);
int
libwrc_resource_get_utf8_name_size(libwrc_resource_t *resource, size_t *utf8_string_size, libwrc_error_t **error);
int
libwrc_resource_get_utf8_name(libwrc_resource_t *resource, uint8_t *utf8_string, size_t utf8_string_size, libwrc_error_t **error);
int
libwrc_resource_get_utf16_name_size(libwrc_resource_t *resource, size_t *utf16_string_size, libwrc_error_t **error);
int
libwrc_resource_get_utf16_name(libwrc_resource_t *resource, uint16_t *utf16_string, size_t utf16_string_size, libwrc_error_t **error);
int
libwrc_resource_get_type(libwrc_resource_t *resource, int *type, libwrc_error_t **error);
int
libwrc_resource_get_number_of_items(libwrc_resource_t *resource, int *number_of_items, libwrc_error_t **error);
int
libwrc_resource_get_item_by_index(libwrc_resource_t *resource, int item_index, libwrc_resource_item_t **resource_item, libwrc_error_t **error);

Resource item functions
int
libwrc_resource_item_free(libwrc_resource_item_t **resource_item, libwrc_error_t **error);
int
libwrc_resource_item_get_identifier(libwrc_resource_item_t *resource_item, uint32_t *identifier, libwrc_error_t **error);
int
libwrc_resource_item_get_utf8_name_size(libwrc_resource_item_t *resource_item, size_t *utf8_string_size, libwrc_error_t **error);
int
libwrc_resource_item_get_utf8_name(libwrc_resource_item_t *resource_item, uint8_t *utf8_string, size_t utf8_string_size, libwrc_error_t **error);
int
libwrc_resource_item_get_utf16_name_size(libwrc_resource_item_t *resource_item, size_t *utf16_string_size, libwrc_error_t **error);
int
libwrc_resource_item_get_utf16_name(libwrc_resource_item_t *resource_item, uint16_t *utf16_string, size_t utf16_string_size, libwrc_error_t **error);
ssize_t
libwrc_resource_item_read_buffer(libwrc_resource_item_t *resource_item, uint8_t *buffer, size_t size, libwrc_error_t **error);
off64_t
libwrc_resource_item_seek_offset(libwrc_resource_item_t *resource_item, off64_t offset, int whence, libwrc_error_t **error);
int
libwrc_resource_item_get_offset(libwrc_resource_item_t *resource_item, off64_t *offset, libwrc_error_t **error);
int
libwrc_resource_item_get_size(libwrc_resource_item_t *resource_item, uint32_t *size, libwrc_error_t **error);
int
libwrc_resource_item_get_number_of_sub_items(libwrc_resource_item_t *resource_item, int *number_of_sub_items, libwrc_error_t **error);
int
libwrc_resource_item_get_sub_item_by_index(libwrc_resource_item_t *resource_item, int sub_item_index, libwrc_resource_item_t **resource_sub_item, libwrc_error_t **error);

Manifest resource functions
int
libwrc_manifest_resource_initialize(libwrc_manifest_resource_t **manifest_resource, libwrc_error_t **error);
int
libwrc_manifest_resource_free(libwrc_manifest_resource_t **manifest_resource, libwrc_error_t **error);
int
libwrc_manifest_resource_read(libwrc_manifest_resource_t *manifest_resource, const uint8_t *data, size_t data_size, libwrc_error_t **error);
int
libwrc_manifest_resource_get_utf8_string_size(libwrc_manifest_resource_t *manifest_resource, size_t *utf8_string_size, libwrc_error_t **error);
int
libwrc_manifest_resource_get_utf8_string(libwrc_manifest_resource_t *manifest_resource, uint8_t *utf8_string, size_t utf8_string_size, libwrc_error_t **error);
int
libwrc_manifest_resource_get_utf16_string_size(libwrc_manifest_resource_t *manifest_resource, size_t *utf16_string_size, libwrc_error_t **error);
int
libwrc_manifest_resource_get_utf16_string(libwrc_manifest_resource_t *manifest_resource, uint16_t *utf16_string, size_t utf16_string_size, libwrc_error_t **error);

Message table (MESSAGETABLE) resource functions
int
libwrc_message_table_resource_initialize(libwrc_message_table_resource_t **message_table_resource, libwrc_error_t **error);
int
libwrc_message_table_resource_free(libwrc_message_table_resource_t **message_table_resource, libwrc_error_t **error);
int
libwrc_message_table_resource_read(libwrc_message_table_resource_t *message_table_resource, const uint8_t *data, size_t data_size, int ascii_codepage, libwrc_error_t **error);
int
libwrc_message_table_resource_get_number_of_messages(libwrc_message_table_resource_t *message_table_resource, int *number_of_messages, libwrc_error_t **error);
int
libwrc_message_table_resource_get_identifier(libwrc_message_table_resource_t *message_table_resource, int message_index, uint32_t *message_identifier, libwrc_error_t **error);
int
libwrc_message_table_resource_get_index_by_identifier(libwrc_message_table_resource_t *message_table_resource, uint32_t message_identifier, int *message_index, libwrc_error_t **error);
int
libwrc_message_table_resource_get_utf8_string_size(libwrc_message_table_resource_t *message_table_resource, int message_index, size_t *utf8_string_size, libwrc_error_t **error);
int
libwrc_message_table_resource_get_utf8_string(libwrc_message_table_resource_t *message_table_resource, int message_index, uint8_t *utf8_string, size_t utf8_string_size, libwrc_error_t **error);
int
libwrc_message_table_resource_get_utf16_string_size(libwrc_message_table_resource_t *message_table_resource, int message_index, size_t *utf16_string_size, libwrc_error_t **error);
int
libwrc_message_table_resource_get_utf16_string(libwrc_message_table_resource_t *message_table_resource, int message_index, uint16_t *utf16_string, size_t utf16_string_size, libwrc_error_t **error);

MUI resource functions
int
libwrc_mui_resource_initialize(libwrc_mui_resource_t **mui_resource, libwrc_error_t **error);
int
libwrc_mui_resource_free(libwrc_mui_resource_t **mui_resource, libwrc_error_t **error);
int
libwrc_mui_resource_read(libwrc_mui_resource_t *mui_resource, const uint8_t *data, size_t data_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_file_type(libwrc_mui_resource_t *mui_resource, uint32_t *file_type, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf8_main_name_size(libwrc_mui_resource_t *mui_resource, size_t *utf8_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf8_main_name(libwrc_mui_resource_t *mui_resource, uint8_t *utf8_string, size_t utf8_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf16_main_name_size(libwrc_mui_resource_t *mui_resource, size_t *utf16_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf16_main_name(libwrc_mui_resource_t *mui_resource, uint16_t *utf16_string, size_t utf16_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf8_mui_name_size(libwrc_mui_resource_t *mui_resource, size_t *utf8_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf8_mui_name(libwrc_mui_resource_t *mui_resource, uint8_t *utf8_string, size_t utf8_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf16_mui_name_size(libwrc_mui_resource_t *mui_resource, size_t *utf16_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf16_mui_name(libwrc_mui_resource_t *mui_resource, uint16_t *utf16_string, size_t utf16_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf8_language_size(libwrc_mui_resource_t *mui_resource, size_t *utf8_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf8_language(libwrc_mui_resource_t *mui_resource, uint8_t *utf8_string, size_t utf8_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf16_language_size(libwrc_mui_resource_t *mui_resource, size_t *utf16_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf16_language(libwrc_mui_resource_t *mui_resource, uint16_t *utf16_string, size_t utf16_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf8_fallback_language_size(libwrc_mui_resource_t *mui_resource, size_t *utf8_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf8_fallback_language(libwrc_mui_resource_t *mui_resource, uint8_t *utf8_string, size_t utf8_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf16_fallback_language_size(libwrc_mui_resource_t *mui_resource, size_t *utf16_string_size, libwrc_error_t **error);
int
libwrc_mui_resource_get_utf16_fallback_language(libwrc_mui_resource_t *mui_resource, uint16_t *utf16_string, size_t utf16_string_size, libwrc_error_t **error);

String table (STRINGTABLE) resource functions
int
libwrc_string_table_resource_initialize(libwrc_string_table_resource_t **string_table_resource, libwrc_error_t **error);
int
libwrc_string_table_resource_free(libwrc_string_table_resource_t **string_table_resource, libwrc_error_t **error);
int
libwrc_string_table_resource_read(libwrc_string_table_resource_t *string_table_resource, const uint8_t *data, size_t data_size, uint32_t base_identifier, libwrc_error_t **error);
int
libwrc_string_table_resource_get_number_of_strings(libwrc_string_table_resource_t *string_table_resource, int *number_of_strings, libwrc_error_t **error);
int
libwrc_string_table_resource_get_identifier(libwrc_string_table_resource_t *string_table_resource, int string_index, uint32_t *string_identifier, libwrc_error_t **error);
int
libwrc_string_table_resource_get_index_by_identifier(libwrc_string_table_resource_t *string_table_resource, uint32_t string_identifier, int *string_index, libwrc_error_t **error);
int
libwrc_string_table_resource_get_utf8_string_size(libwrc_string_table_resource_t *string_table_resource, int string_index, size_t *utf8_string_size, libwrc_error_t **error);
int
libwrc_string_table_resource_get_utf8_string(libwrc_string_table_resource_t *string_table_resource, int string_index, uint8_t *utf8_string, size_t utf8_string_size, libwrc_error_t **error);
int
libwrc_string_table_resource_get_utf16_string_size(libwrc_string_table_resource_t *string_table_resource, int string_index, size_t *utf16_string_size, libwrc_error_t **error);
int
libwrc_string_table_resource_get_utf16_string(libwrc_string_table_resource_t *string_table_resource, int string_index, uint16_t *utf16_string, size_t utf16_string_size, libwrc_error_t **error);

Version information (VERSIONINFO) resource functions
int
libwrc_version_information_resource_initialize(libwrc_version_information_resource_t **version_information_resource, libwrc_error_t **error);
int
libwrc_version_information_resource_free(libwrc_version_information_resource_t **version_information_resource, libwrc_error_t **error);
int
libwrc_version_information_resource_read(libwrc_version_information_resource_t *version_information_resource, const uint8_t *data, size_t data_size, libwrc_error_t **error);
int
libwrc_version_information_resource_get_file_version(libwrc_version_information_resource_t *version_information_resource, uint64_t *file_version, libwrc_error_t **error);
int
libwrc_version_information_resource_get_product_version(libwrc_version_information_resource_t *version_information_resource, uint64_t *product_version, libwrc_error_t **error);

DESCRIPTION
The libwrc_get_version() 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 "libwrc.h".

ENVIRONMENT
None

FILES
None

NOTES
libwrc can be compiled with wide character support (wchar_t).

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

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

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

AUTHOR
These man pages are generated from "libwrc.h".

COPYRIGHT
Copyright (C) 2011-2023, 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 libwrc.h include file