Provides functions for getting the primary and secondary architectures of the system. More...
Functions | |
__BEGIN_DECLS const char * | get_architecture () |
Returns the name of the caller's architecture. | |
status_t | get_architectures (BStringList &_architectures) |
Returns the names of the system's primary and secondary architectures. | |
size_t | get_architectures (const char **architectures, size_t count) |
Returns the names of the system's primary and secondary architectures. | |
const char * | get_primary_architecture () |
Returns the name of the system's primary architecture. | |
__END_DECLS status_t | get_secondary_architectures (BStringList &_architectures) |
Returns the names of the system's secondary architectures. | |
size_t | get_secondary_architectures (const char **architectures, size_t count) |
Returns the names of the system's secondary architectures. | |
const char * | guess_architecture_for_path (const char *path) |
Returns the name of the architecture associated with the given path. | |
Provides functions for getting the primary and secondary architectures of the system.
const char * get_architecture | ( | ) |
Returns the name of the caller's architecture.
This is the packaging architecture the caller's code has been built for, which may not be the system's primary architecture.
status_t get_architectures | ( | BStringList & | _architectures | ) |
Returns the names of the system's primary and secondary architectures.
This is a C++ interface similar to get_architectures(const char**,size_t). Instead of returning the architecture names in a pre-allocated array, it expects a BStringList. Note that this version can fail when running out of memory.
_architectures | Reference to a BStringList that will be set to the list of names of primary and secondary architectures. On error the list will be emptied. |
B_OK | Everything went fine. |
B_NO_MEMORY | A memory allocation failed. |
size_t get_architectures | ( | const char ** | architectures, |
size_t | count | ||
) |
Returns the names of the system's primary and secondary architectures.
This is a convenience function that returns both the primary architecture as returned by get_primary_architecture() and the secondary architectures as returned by get_secondary_architectures() in the provided array.
architectures | A pre-allocated array of size count where the names of the architectures will be stored. Can be NULL if count is 0. |
count | The size of the architectures array. |
const char * get_primary_architecture | ( | ) |
Returns the name of the system's primary architecture.
This is the packaging architecture the main system has been built for.
status_t get_secondary_architectures | ( | BStringList & | _architectures | ) |
Returns the names of the system's secondary architectures.
This is a C++ interface similar to get_secondary_architectures(const char**,size_t). Instead of returning the architecture names in a pre-allocated array, it expects a BStringList. Note that this version can fail when running out of memory.
_architectures | Reference to a BStringList that will be set to the list of names of secondary architectures. On error the list will be emptied. |
B_OK | Everything went fine. |
B_NO_MEMORY | A memory allocation failed. |
size_t get_secondary_architectures | ( | const char ** | architectures, |
size_t | count | ||
) |
Returns the names of the system's secondary architectures.
These are the packaging architectures the system does provide additional support for (i.e. not including the primary architecture). Only actually installed support is considered. E.g. on a pure x86 gcc 2 system (primary architecture "x86_gcc2") without any support installed for gcc 4 executables, the function will not return any secondary architectures, even if it would be possible to install the support for gcc 4.
architectures | A pre-allocated array of size count where the names of the secondary architectures will be stored. Can be NULL , if count is 0. |
count | The size of the architectures array. |
const char * guess_architecture_for_path | ( | const char * | path | ) |
Returns the name of the architecture associated with the given path.
If the given path refers to an executable, library, or add-on, the function determines for which architecture it has been built and returns that. Otherwise it analyzes the path itself, checking whether it points to/into a directory where files for a secondary architectures reside. If that proved inconclusive the name of the primary architecture is returned.
path | The path to be analyzed. It doesn't necessarily have to point to an existing file or directory. |