libvsapm(3)

πŸ’– libvsapm β€” the Apple Partition Map bestie manual πŸ’–

okay so this is the page for libvsapm(3), from the Library Functions Manual β€” it's the library that lets you access the Apple Partition Map (APM) volume system format. yes, that APM. the classic Mac one. iconic behavior honestly.


✨ NAME ✨

libvsapm.h β€” Library to access the Apple Partition Map (APM) volume system format

basically: you wanna poke at APM volumes? this is the header you include. periodt.


🌸 SYNOPSIS 🌸

#include <libvsapm.h>

πŸŽ€ Support functions πŸŽ€

these are the little helper girlies πŸ’…

const char *
libvsapm_get_version(void);

int
libvsapm_get_access_flags_read(void);

int
libvsapm_get_access_flags_read_write(void);

int
libvsapm_get_access_flags_write(void);

int
libvsapm_get_codepage(int *codepage, libvsapm_error_t **error);

int
libvsapm_set_codepage(int codepage, libvsapm_error_t **error);

int
libvsapm_check_volume_signature(const char *filename,
    libvsapm_error_t **error);

Available when compiled with wide character string support:

int
libvsapm_check_volume_signature_wide(const wchar_t *filename,
    libvsapm_error_t **error);

Available when compiled with libbfio support:

int
libvsapm_check_volume_signature_file_io_handle(libbfio_handle_t *file_io_handle,
    libvsapm_error_t **error);

πŸ’¬ Notify functions πŸ’¬

so you can actually hear what's going on ✨

void
libvsapm_notify_set_verbose(int verbose);

int
libvsapm_notify_set_stream(FILE *stream, libvsapm_error_t **error);

int
libvsapm_notify_stream_open(const char *filename,
    libvsapm_error_t **error);

int
libvsapm_notify_stream_close(libvsapm_error_t **error);

😭 Error functions 😭

for when things are Not Going Great (and for reading the receipts)

void
libvsapm_error_free(libvsapm_error_t **error);

int
libvsapm_error_fprint(libvsapm_error_t *error, FILE *stream);

int
libvsapm_error_sprint(libvsapm_error_t *error, char *string,
    size_t size);

int
libvsapm_error_backtrace_fprint(libvsapm_error_t *error, FILE *stream);

int
libvsapm_error_backtrace_sprint(libvsapm_error_t *error, char *string,
    size_t size);

πŸ‘‘ Volume functions πŸ‘‘

the main character energy of this whole library ngl

int
libvsapm_volume_initialize(libvsapm_volume_t **volume,
    libvsapm_error_t **error);

int
libvsapm_volume_free(libvsapm_volume_t **volume,
    libvsapm_error_t **error);

int
libvsapm_volume_signal_abort(libvsapm_volume_t *volume,
    libvsapm_error_t **error);

int
libvsapm_volume_open(libvsapm_volume_t *volume, const char *filename,
    int access_flags, libvsapm_error_t **error);

int
libvsapm_volume_close(libvsapm_volume_t *volume,
    libvsapm_error_t **error);

int
libvsapm_volume_get_bytes_per_sector(libvsapm_volume_t *volume,
    uint32_t *bytes_per_sector, libvsapm_error_t **error);

int
libvsapm_volume_set_bytes_per_sector(libvsapm_volume_t *volume,
    uint32_t bytes_per_sector, libvsapm_error_t **error);

int
libvsapm_volume_get_number_of_partitions(libvsapm_volume_t *volume,
    int *number_of_partitions, libvsapm_error_t **error);

int
libvsapm_volume_get_partition_by_index(libvsapm_volume_t *volume,
    int partition_index, libvsapm_partition_t **partition,
    libvsapm_error_t **error);

Available when compiled with wide character string support:

int
libvsapm_volume_open_wide(libvsapm_volume_t *volume,
    const wchar_t *filename, int access_flags,
    libvsapm_error_t **error);

Available when compiled with libbfio support:

int
libvsapm_volume_open_file_io_handle(libvsapm_volume_t *volume,
    libbfio_handle_t *file_io_handle, int access_flags,
    libvsapm_error_t **error);

πŸ¦‹ Partition functions πŸ¦‹

the parts inside the volume. the little guys. the sub-plot. 🫢

int
libvsapm_partition_free(libvsapm_partition_t **partition,
    libvsapm_error_t **error);

int
libvsapm_partition_get_name_string(libvsapm_partition_t *partition,
    char *string, size_t string_size, libvsapm_error_t **error);

int
libvsapm_partition_get_type_string(libvsapm_partition_t *partition,
    char *string, size_t string_size, libvsapm_error_t **error);

int
libvsapm_partition_get_status_flags(libvsapm_partition_t *partition,
    uint32_t *status_flags, libvsapm_error_t **error);

int
libvsapm_partition_get_volume_offset(libvsapm_partition_t *partition,
    off64_t *volume_offset, libvsapm_error_t **error);

ssize_t
libvsapm_partition_read_buffer(libvsapm_partition_t *partition,
    void *buffer, size_t buffer_size, libvsapm_error_t **error);

ssize_t
libvsapm_partition_read_buffer_at_offset(libvsapm_partition_t *partition,
    void *buffer, size_t buffer_size, off64_t offset,
    libvsapm_error_t **error);

off64_t
libvsapm_partition_seek_offset(libvsapm_partition_t *partition,
    off64_t offset, int whence, libvsapm_error_t **error);

int
libvsapm_partition_get_offset(libvsapm_partition_t *partition,
    off64_t *offset, libvsapm_error_t **error);

int
libvsapm_partition_get_size(libvsapm_partition_t *partition,
    size64_t *size, libvsapm_error_t **error);

🌈 DESCRIPTION 🌈

so, the one function actually spelled out here is libvsapm_get_version() β€” it's the one you call to grab the library version. that's the whole vibe of this section, bestie. that's it. πŸ’œ


⭐ RETURN VALUES ⭐

most of these functions hand you back NULL or -1 when something goes wrong β€” depends on the return type, so it's giving "it depends". for the actual return values, go look at libvsapm.h. no cap. πŸ”₯


πŸ’€ ENVIRONMENT πŸ’€

None

(yeah. nothing. empty. ghost town. πŸ™ˆ)


πŸ“ FILES πŸ“

None

(also nothing. the void is voiding.)


🧚 NOTES 🧚

  • libvsapm can be compiled with wide character support (wchar_t).
  • to compile libvsapm with wide character support use:
./configure --enable-wide-character-type=yes
  • or define:
_UNICODE
  • or:
UNICODE
  • during compilation.
  • LIBVSAPM_WIDE_CHARACTER_TYPE in libvsapm/features.h can be used to determine if libvsapm was compiled with wide character support.
so if you're out here wondering "did my build get the wide char treatment?", that macro in libvsapm/features.h is your vibe check. πŸ¦‹

😭 BUGS 😭

please report bugs of any kind on the project issue tracker:

https://github.com/libyal/libvsapm/issues

not me begging you to actually file the issue instead of just suffering in silence. tell the maintainers. they want to know. πŸ’…

πŸ’œ AUTHOR πŸ’œ

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


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.

okay so real talk: free software, but literally no warranty, not even the implied "it'll probably work for its stated purpose" one. read the source for the actual copying conditions. πŸ”₯

πŸ‘‘ SEE ALSO πŸ‘‘

  • the libvsapm.h include file

and that's the whole page, bestie!! βœ¨πŸ’–πŸŒΈ written for the libvsapm project, dated February 11, 2023, in the classic libvsapm(3) section of the Library Functions Manual. go forth and read those partitions. slay. πŸ’…πŸ¦‹