#include <hiker/types.h>
#include <glib.h>
#include <glib-object.h>
Go to the source code of this file.
Data Structures | |
struct | _AlpBundle |
Data type used to refer to a particular bundle The AlpBundle type is a short integral type used to index available bundles. More... | |
struct | _AlpBundleProgressiveData |
struct | AlpBundleEntrypointClosure |
struct | _AlpNotifyEventBundleDelete |
struct | _AlpNotifyEventBundleMove |
struct | _AlpNotifyEventBundleCopy |
struct | _AlpNotifyEventBundleRegister |
struct | _AlpNotifyEventBundleUnregister |
struct | _AlpNotifyEventBundleResetEverything |
struct | _AlpNotifyEventBundleNameAdded |
struct | _AlpNotifyEventBundleNameRemoved |
struct | _AlpNotifyEventBundleNameChanged |
Data types | |
#define | ALP_BUNDLE_NULL ((struct _AlpBundle){0}) |
Constant which is a NULL AlpBundle value. | |
#define | ALP_BUNDLE_REF_NULL (NULL) |
#define | ALP_STATUS_BUNDLEMGR_FAILURE (ALP_CLASS_BUNDLEMGR | 0x00010000) |
Generic failure. | |
typedef _AlpBundle | AlpBundle |
Data type used to refer to a particular bundle The AlpBundle type is a short integral type used to index available bundles. | |
typedef _AlpBundleRef * | AlpBundleRef |
Data type used as handle to an open bundle The AlpBundleRef type is a pointer to an opaque type, used as a handle to open bundles. | |
Operations on Bundles | |
#define | ALP_BUNDLE_RW_SAVED "/saved/" |
One R/W sub-folder is automatically backed up to the desktop. | |
AlpBundle | alp_bundle_move_to_store (AlpBundle bundle, const char *store, int flags) |
Move a bundle to an active store This uses the bundle manager to move a registered bundle from one store to another. | |
AlpBundle | alp_bundle_copy_to_store (AlpBundle bundle, const char *store, int flags) |
Copy a bundle to an active store This uses the bundle manager to copy a registered bundle from one store to another. | |
alp_status_t | alp_bundle_delete (AlpBundle bundle, int everything) |
Delete a bundle. | |
GHashTable * | alp_bundle_metadata (AlpBundle) |
gchar * | alp_bundle_metadata_value (AlpBundle index, const char *key) |
Return a the value for a metadata key of a bundle Given a bundle index and a key name, return the value of that key as an allocated string, or NULL if there is no such key. | |
gchar * | alp_bundle_rw_pathname (AlpBundle index, const char *file_path, gboolean vivify) |
Returns the path to the R/W data folder for a bundle. | |
alp_status_t | alp_bundle_rw_delete (AlpBundle index, const char *folder_path, gboolean itself) |
Delete some or all files within a bundles R/W data folder As a convenience, you can easily delete all of the R/W data for a bundle, or a subset of that data, using this routine. | |
GHashTable * | alp_bundle_properties (AlpBundle index, const char *property, int which) |
GList * | alp_bundle_all_properties (AlpBundle index) |
gchar * | alp_bundle_property_value (AlpBundle index, const char *property, int which, const char *key) |
Given a bundle index and a key name, return the value of that key as an allocated string, or NULL if there is no such key. | |
AlpBundle | alp_bundle_locate_file (const char *filename) |
Identify open bundle containing a file Given a POSIX file path, this will attempt to identify an open bundle which matches that path. The supplied path can be the root of a folder, or any file or folder name within that folder (existing or not). | |
AlpBundle | alp_bundle_me () |
Return a bundle index of the bundle containing the running code Returns a bundle index to the bundle which contains the code which invoked this function. Note that this function explicitly detects what routine it is being called from. Don't expect it to operate from a utility subroutine -- consider using a macro. | |
AlpBundle | alp_bundle_application () |
Return a bundle index of the running application Returns a bundle index to the bundle which contains the launched ALP application. | |
Operations on BundleRefs | |
#define | ALP_BUNDLE_BAR_MANIFEST "/Manifest.xml" |
Use this define as the path to retrieve the manifest from a bar bundle. | |
AlpBundleRef | alp_bundle_open (AlpBundle idx) |
Open a bundle Given a bundle index, open the bundle, making its contents available for use, until it is closed. | |
alp_status_t | alp_bundle_close (AlpBundleRef ref) |
Close an open bundle Close a bundleref. No further access through the bundleref should be attempted. If all references to a bundle are closed, the bundle manager may disconnect or otherwise make the bundle unavailable for operations. Pathnames to ro bundle files may not function once it is closed. | |
AlpBundle | alp_bundle_ref_bundle (AlpBundleRef ref) |
Return a bundle index given a bundle ref Returns a bundle index for a supplied bundle ref. | |
AlpBundleRef | alp_bundle_ref_me () |
Return a bundle ref to the running code Returns a bundle ref to the bundle which contains the code which invoked this function. Note that this function explicitly detects what routine it is being called from. Don't expect it to operate from a utility subroutine -- consider using a macro. | |
AlpBundleRef | alp_bundle_ref_application () |
Return a bundle ref to the running application Returns a bundle ref to the bundle which the running application was launched from. | |
GIOChannel * | alp_bundle_ref_ro_channel (AlpBundleRef ref, const char *path) |
Open a GIOChannel to retrieve a read-only file from a bundle. | |
gchar * | alp_bundle_ref_ro_pathname (AlpBundleRef ref, const char *path) |
Retrieve a pathname for read-only file in a bundle. | |
alp_status_t | alp_bundle_ref_ro_data (AlpBundleRef ref, const char *path, gchar **data, size_t *length) |
Retrieve a read-only file in a bundle as an allocated data block. | |
GList * | alp_bundle_ref_ro_directory (AlpBundleRef ref, const char *path, gboolean recurse) |
Retrieve list of resources within a bundle. | |
gchar * | alp_bundle_ref_ro_tempfile (AlpBundleRef ref, const char *path, gboolean keep, const char *ext) |
Create a temporary file with the contents of a read-only file in a bundle. | |
alp_status_t | alp_bundle_tempfile_release (gchar *tempfile) |
Releases any storage associated with a tempfile returned from alp_bundle_ref_ro_tempfile(). | |
Acquisition operations | |
These are all implemented as composites of other routines, really just conveniences. The URLs allowed by these routines may have a scheme and bundle name and/or a path and/or a search entry for entrypoint selection. That is, you can say:
bar:bundle.name/resource/path /resource/path bar:bundle.name bar:bundle.name/library?function An additional path syntax is available from the acquire routines to use bundle properties:
bar:bundle.name/^p/application/icon
This has the affect of retrieving the value of the | |
#define | ALP_BUNDLE_ENTRYPOINT_CLOSURE_VERSION 1 |
#define | ALP_BUNDLE_ENTRYPOINT_CLOSURE_REF(closure) (((AlpBundleEntrypointClosure*)(closure))->ref) |
Retrieve the AlpBundleRef held by the closure, if any. | |
#define | ALP_BUNDLE_ENTRYPOINT_CLOSURE_DLHANDLE(closure) (((AlpBundleEntrypointClosure*)(closure))->dlhandle) |
Retrieve the dlopen() handle held by the closure, if any. | |
#define | ALP_BUNDLE_ENTRYPOINT_CLOSURE_CALLBACK(closure) (((AlpBundleEntrypointClosure*)(closure))->callback) |
Retrieve the dlsym() function pointer held by the closure, if any. | |
#define | ALP_BUNDLE_ENTRYPOINT_CLOSURE_PATH(closure) (((AlpBundleEntrypointClosure*)(closure))->path) |
Retrieve the R/O library path used by setting up the closure, if any. | |
#define | ALP_BUNDLE_ENTRYPOINT_CLOSURE_SYM(closure) (((AlpBundleEntrypointClosure*)(closure))->sym) |
Retrieve the symbol name used by dlsym(), if any. | |
#define | ALP_BUNDLE_ENTRYPOINT_CLOSURE_RESULT_SIGNAL(closure) (((AlpBundleEntrypointClosure*)(closure))->result_signal) |
After closure invocation, this will be zero on a successful invocation, less than zero for some internal errors, positive if an executable was invoked and terminated with a signal. | |
GClosure * | alp_bundle_acquire_entrypoint (const char *url, AlpBundleRef relativeRef) |
Get a function pointer to a shared library via a URL. | |
gchar * | alp_bundle_acquire_ro_pathname (const char *url, AlpBundleRef *openRef, AlpBundleRef relativeRef) |
Get a pathname to a R/O file within a bundle via a URL. | |
GIOChannel * | alp_bundle_acquire_ro_channel (const char *url, AlpBundleRef relativeRef) |
Get an GIOChannel for a R/O file within a bundle via a URL. | |
alp_status_t | alp_bundle_acquire_ro_data (const char *url, gchar **data, size_t *length, AlpBundleRef relativeRef) |
Get a block of data from the contents of a R/O file within a bundle via a URL. | |
gchar * | alp_bundle_acquire_ro_tempfile (const char *url, AlpBundleRef *openRef, gboolean keep, const char *ext, AlpBundleRef relativeRef) |
Get a temporary file for the contents of a R/O file within a bundle via a URL. | |
int | alp_bundle_entrypoint_closure_execve (GClosure *closure, char *const argv[], char *const envp[]) |
Invoke a GClosure with command-line parameters from an array, return result. | |
int | alp_bundle_entrypoint_closure_execl (GClosure *closure, const char *arg,...) |
Notifications | |
#define | ALP_NOTIFY_EVENT_BUNDLE_DELETE "/alp/bundlemgr/delete_bundle" |
#define | ALP_NOTIFY_EVENT_BUNDLE_MOVE "/alp/bundlemgr/move_bundle" |
#define | ALP_NOTIFY_EVENT_BUNDLE_COPY "/alp/bundlemgr/copy_bundle" |
#define | ALP_NOTIFY_EVENT_BUNDLE_REGISTER "/alp/bundlemgr/register_bundle" |
#define | ALP_NOTIFY_EVENT_BUNDLE_UNREGISTER "/alp/bundlemgr/unregister_bundle" |
#define | ALP_NOTIFY_EVENT_BUNDLE_RESET_EVERYTHING "/alp/bundlemgr/reset_everything" |
#define | ALP_NOTIFY_EVENT_BUNDLE_NAME_ADDED "/alp/bundlemgr/name_added" |
#define | ALP_NOTIFY_EVENT_BUNDLE_NAME_REMOVED "/alp/bundlemgr/name_removed" |
#define | ALP_NOTIFY_EVENT_BUNDLE_NAME_CHANGED "/alp/bundlemgr/name_changed" |
typedef _AlpNotifyEventBundleDelete | AlpNotifyEventBundleDelete |
typedef _AlpNotifyEventBundleMove | AlpNotifyEventBundleMove |
typedef _AlpNotifyEventBundleCopy | AlpNotifyEventBundleCopy |
typedef _AlpNotifyEventBundleRegister | AlpNotifyEventBundleRegister |
typedef _AlpNotifyEventBundleUnregister | AlpNotifyEventBundleUnregister |
typedef _AlpNotifyEventBundleResetEverything | AlpNotifyEventBundleResetEverything |
typedef _AlpNotifyEventBundleNameAdded | AlpNotifyEventBundleNameAdded |
typedef _AlpNotifyEventBundleNameRemoved | AlpNotifyEventBundleNameRemoved |
typedef _AlpNotifyEventBundleNameChanged | AlpNotifyEventBundleNameChanged |
Manifest Metadata | |
These constants define the names of common manifest metadata property lists. | |
#define | ALP_BUNDLE_PROPERTY_APPLICATION "application" |
The "application" manifest metadata indicates that the bundle contains an app. | |
Bundle Types | |
These constants define the schemes for various bundle types. | |
#define | ALP_BUNDLE_TYPE_BAR "bar" |
The native ALP bundle type, "bar". | |
Miscellaneous and localization assistance | |
#define | ALP_BUNDLE_FLAG_DELETE_EVERYTHING 1 |
Flag to pass to some bundle manager routines to indicate all associated data should be removed. | |
#define | ALP_BUNDLE_FLAG_OVERWRITE_DUPLICATE 128 |
Flag to pass to some bundle manager routines to cause an image install to overwrite a bundle of the same name, if it exists. | |
#define | alp_bundle_acquire_glade_xml(url, root) |
#define | alp_bundle_ref_cgettext(ref, text, category) dcgettext(alp_bundle_ref_gettextdomain((ref)), (text), (category)) \ |
#define | alp_bundle_ref_gettext(ref, text) dgettext(alp_bundle_ref_gettextdomain((ref)), (text)) \ |
#define | alp_bundle_gettext(text) dgettext(alp_bundle_ref_gettextdomain(alp_bundle_ref_me()), (text)) |
const char * | alp_bundle_ref_gettextdomain (AlpBundleRef ref) |
const char * | alp_bundle_ref_name (AlpBundleRef ref) |
gchar * | alp_bundle_name (AlpBundle index) |
gchar * | alp_bundle_saved_settings (AlpBundle index, const char *key) |
gchar * | alp_bundle_unsaved_settings (AlpBundle index, const char *key) |
alp_status_t | alp_bundle_error (void) |
Operations on Images | |
typedef _AlpBundleProgressiveData | AlpBundleProgressiveData |
Tracks data for callback regarding progression of install or archive of bundle images An object of type AlpBundleProgressiveData is used to indicate to the alp_bundle_image_install() and alp_bundle_image_archive() routines that they should periodically invoke a callback function to let their caller know that the image creation/transfer process is proceeding. | |
enum | { ALP_BUNDLE_PROGRESSIVE_DATA_VERSION = 1 } |
int | alp_bundle_image_verify (const char *provide_filename, const char *provide_mimetype, GIOChannel *image, gboolean full_check, GHashTable **metadata, GHashTable **properties, AlpBundleProgressiveData *progress) |
Verify that a bundle image is somewhat undamaged, and get its metainfo. | |
AlpBundle | alp_bundle_image_install (const char *provide_filename, const char *provide_mimetype, GIOChannel *image, const char *destination_store, int flags, GHashTable **metadata, GHashTable **properties, AlpBundleProgressiveData *progress) |
Install a bundle into the system from an I/O channel Given a data source specified by a GIOChannel, this routine will read a bundle from that source, and install it into a store in the system. This is the fundamental routine used to install new programs. | |
alp_status_t | alp_bundle_image_archive (AlpBundle index, char **desired_filename, char **desired_mimetype, GIOChannel *image, AlpBundleProgressiveData *progress) |
Archive a bundle to an I/O channel Given a bundle, and a data sink specified by a GIOChannel, this routine will flatten a bundle into an image, and write it to that channel. This is the fundamental routine used to prepare bundles for sending outside the device. (e-mail, beaming, files, etc.). | |
Initialization | |
alp_status_t | alp_bundle_init (void) |
Initialize the bundle manager client library. Needed if you are not running as an ALP application The bundle manager needs to be initialized before you can do anything with it. ALP applications normally run in an environment where the bundle manager is already initialized. | |
alp_status_t | alp_bundle_fini (void) |
Shutdown (finalize) the bundle manager client library. | |
Finding bundles | |
AlpBundle | alp_bundle_by_name (const char *name) |
Get bundle index for a given name. | |
GArray * | alp_bundle_search (const char *name, gboolean named, const char *scheme, const char *store, const char *property) |
Search for bundles that match a set of criteria, including name, store, properties, type. | |
GList * | alp_bundle_list_schemes (void) |
All of these return a GList of allocated strings.Return a list of all valid bundle types the system supports. | |
GList * | alp_bundle_list_stores (void) |
Return a list of all stores current available in the system. | |
GList * | alp_bundle_list_names (void) |
Return a list of all bundle names in the system. | |
GList * | alp_bundle_list_properties (void) |
Return a list of all properties which are present in any bundle in the system. | |
Operations on Stores | |
GHashTable * | alp_bundle_store (const char *store) |
Retrieve information about a store. | |
gchar * | alp_bundle_store_value (const char *store, const char *key) |
Retrieve a particular information value about a store. | |
Scheme routines | |
GHashTable * | alp_bundle_scheme_values (const char *scheme) |
Return all data describing a scheme Given a scheme name, returns a hashtable containing keys and values describing the scheme. | |
gchar * | alp_bundle_scheme_value (const char *scheme, const char *key) |
Return a the value for a scheme description key Given a scheme name and a key name, return the value of that key as an allocated string, or NULL if there is no such key. | |
gchar * | alp_bundle_scheme_identify (const char *filename, const char *mimetype) |
Given a filename and/or mimetype, determine what bundle scheme is appropriate. |
|
Value: ({ \ AlpBundleRef _ref; \ AlpBundleRef _me = alp_bundle_ref_me(); \ gchar * _pathname = alp_bundle_acquire_ro_pathname((url), &_ref, _me); \ GladeXML * _result = glade_xml_new_with_domain(_pathname, (root), alp_bundle_ref_gettextdomain(_ref)); \ g_free(_pathname); \ alp_bundle_close(_ref); \ _result; \ })
|
|
Use this define as the path to retrieve the manifest from a bar bundle.
|
|
Retrieve the dlsym() function pointer held by the closure, if any.
|
|
Retrieve the dlopen() handle held by the closure, if any.
|
|
Retrieve the R/O library path used by setting up the closure, if any.
|
|
Retrieve the AlpBundleRef held by the closure, if any.
|
|
After closure invocation, this will be zero on a successful invocation, less than zero for some internal errors, positive if an executable was invoked and terminated with a signal.
|
|
Retrieve the symbol name used by dlsym(), if any.
|
|
|
|
Flag to pass to some bundle manager routines to indicate all associated data should be removed.
|
|
Flag to pass to some bundle manager routines to cause an image install to overwrite a bundle of the same name, if it exists.
|
|
Utility macro to retrieve a gettext localization from the current bundle You might want to say:
#define _(x) alp_bundle_gettext(x)
|
|
Constant which is a NULL AlpBundle value.
|
|
The "application" manifest metadata indicates that the bundle contains an app.
|
|
Utility macro to retrieve a gettext localization
|
|
Utility macro to retrieve a gettext localization
|
|
|
|
One R/W sub-folder is automatically backed up to the desktop. If you want data to be backed up, please use the ALP_BUNDLE_RW_SAVED path: path = alp_bundle_rw_pathname(pkg, ALP_BUNDLE_RW_SAVED "mydata"); |
|
The native ALP bundle type, "bar".
|
|
Name of notification sent when a bundle has is in the process of being copied. If a handler of this notification set bit 0 of the handled flag, the copy will be cancelled. |
|
Name of notification sent when a bundle has is in the process of being deleted. If a handler of this notification set bit 0 of the handled flag, the deletion will be cancelled. |
|
Name of notification sent when a bundle has is in the process of being moved. If a handler of this notification set bit 0 of the handled flag, the move will be cancelled. |
|
Name of notification sent when new bundle name has appeared. |
|
Name of notification sent when a bundle name has changed to refer to a different bundle. |
|
Name of notification sent when a bundle name has been removed. |
|
Name of notification sent when a bundle has been registered. |
|
Name of notification sent when all bundle manager state has been lost |
|
Name of notification sent when a bundle has is in the process of being unregistered. |
|
Generic failure.
|
|
Data type used to refer to a particular bundle The AlpBundle type is a short integral type used to index available bundles. An AlpBundle value will be good until (reset?). (If a bundle is deleted, the AlpBundle value will not be immediately reused). Any routine called with an invalid AlpBundle value will fail. Using an invalid AlpBundle value will not cause any alp_bundle routine to crash. Do not attempt to manipulate AlpBundle values numerically: always use values returned from alp_bundle_by_name() or alp_bundle_search(). An AlpBundle may be "NULL", meaning that it is a not a valid bundle index. This condition can be tested with alp_bundle_is_NULL().
|
|
Tracks data for callback regarding progression of install or archive of bundle images An object of type AlpBundleProgressiveData is used to indicate to the alp_bundle_image_install() and alp_bundle_image_archive() routines that they should periodically invoke a callback function to let their caller know that the image creation/transfer process is proceeding. The structure contains some fields that should be filled in by the caller, and other fields which will be filled in by either of the image routines. Note that the fields filled in are only good for the duration of the image routine execution, and should only be retrieved from within the callback function. After the image routine returns, the fields will be zeroed. To use this structure, create an object of the right size, and set version to ALP_BUNDLE_PROGRESSIVE_DATA_VERSION. |
|
Data type used as handle to an open bundle The AlpBundleRef type is a pointer to an opaque type, used as a handle to open bundles.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Get a function pointer to a shared library via a URL.
bar:com.access.apps.calculator bar:com.access.apps.calculator/libalp_calculator.so A symbol name can be supplied with '?' syntax:
bar:bundle.name/lib_mylib.so?OtherEntry
The default symbol name is An alternate functionality is available: if the path names an executable instead of a shared library, the returned closure will invoke the executable as a child process. URL may be NULL, if a relativeRef is supplied. If this is the case, all defaults will be used.
AlpBundleRef myRef = alp_bundle_open(myBundleName); GClosure * myRoutine = alp_bundle_acquire_entrypoint("/somelib?routine", myRef); alp_bundle_close(myRef); g_closure_invoke(myRoutine, ...); g_close_unref(myRoutine); |
|
Get an GIOChannel for a R/O file within a bundle via a URL. This routine returns the pathname to a bundle resource. This only operates for some bundle types, particularly ALP native bundles (bar). Other types may not support direct file access, preventing this routine from being used. In that case, please consider using other routines, such as acquire_ro_data or acquire_ro_tempfile.
AlpBundleRef myRef = alp_bundle_open(myBundleName); AlpBundleRef outRef; GIOChannel * channel = alp_bundle_acquire_ro_channel("/somefile", myRef); alp_bundle_close(myRef); // process channel g_io_channel_unref(channel); |
|
Get a block of data from the contents of a R/O file within a bundle via a URL.
AlpBundleRef myRef = alp_bundle_open(myBundleName); AlpBundleRef outRef; gchar * data; alp_status_t result = alp_bundle_acquire_ro_data("/sometextfile", &data, NULL, myRef); // process data g_free(data); |
|
Get a pathname to a R/O file within a bundle via a URL.
AlpBundleRef myRef = alp_bundle_open(myBundleName); AlpBundleRef outRef; gchar * pathname = alp_bundle_acquire_ro_pathname("/somefile", &outRef, myRef); alp_bundle_close(myRef); FILE * f = fopen(pathname, "r"); // process f flcose(f); alp_bundle_close(outRef); |
|
Get a temporary file for the contents of a R/O file within a bundle via a URL.
AlpBundleRef myRef = alp_bundle_open(myBundleName); AlpBundleRef outRef; gchar * filename = alp_bundle_acquire_ro_tempfile("/somefile", &outRef, FALSE, NULL, myRef); alp_bundle_close(myRef); FILE * f = fopen(filename, "r"); // process f flcose(f); alp_bundle_close(outRef); |
|
|
|
Return a bundle index of the running application Returns a bundle index to the bundle which contains the launched ALP application.
|
|
Get bundle index for a given name.
|
|
Close an open bundle Close a bundleref. No further access through the bundleref should be attempted. If all references to a bundle are closed, the bundle manager may disconnect or otherwise make the bundle unavailable for operations. Pathnames to ro bundle files may not function once it is closed.
|
|
Copy a bundle to an active store This uses the bundle manager to copy a registered bundle from one store to another. The new copy will be registered along with the old one -- only one will have its name registered, and which one will depend on the particular stores.
|
|
Delete a bundle.
|
|
Invoke a GClosure with command-line parameters from function parameters, return result This routine is a convenience function to invoke a GClosure with a set of parameters resembling the C 'main' entry sequence:
int (closure)(int argc, char *argv[], char *envp[]) This routine takes an arbitrary number of C parameters, packs them up and invokes the given closure. The result of the closure invocation is returned as an integer.
|
|
Invoke a GClosure with command-line parameters from an array, return result. This routine is a convenience function to invoke a GClosure with a set of parameters resembling the C 'main' entry sequence:
int (closure)(int argc, char *argv[], char *envp[]) This routine takes argv and evnvp array pointers, packs up their contents and invokes the given closure. The result of the closure invocation is returned as an integer.
|
|
Returns status of last failing alp_bundle routine. Some Bundle Manager routines cannot return a detailed status value. Any Bundle Manager routine which fails (and returns and error value) will set an error status value which can be retrieved via this function. Successfull operations do not clear this status -- it is only modified by failing functions. This function should not be used except immediately after a failing Bundle Manager routine.
|
|
Shutdown (finalize) the bundle manager client library. If you explicitly initialized the bundle manager with alp_bundle_init(), you should use alp_bundle_fini(). This routine will decrement a refcount, and then shut down the bundle manager. |
|
Archive a bundle to an I/O channel Given a bundle, and a data sink specified by a GIOChannel, this routine will flatten a bundle into an image, and write it to that channel. This is the fundamental routine used to prepare bundles for sending outside the device. (e-mail, beaming, files, etc.).
|
|
Install a bundle into the system from an I/O channel Given a data source specified by a GIOChannel, this routine will read a bundle from that source, and install it into a store in the system. This is the fundamental routine used to install new programs.
|
|
Verify that a bundle image is somewhat undamaged, and get its metainfo. This routine will verify that an uninstalled/unregistered image of a bundle (i.e., the contents of a .jar, .bar, or .prc file) fulfills some basic consistency checks, and will retrieve the static metainformation from that bundle. This routine operates on a GIOChannel, so the bundle image can be read from a file, or from some other data-source, potentially a streaming source.
|
|
Initialize the bundle manager client library. Needed if you are not running as an ALP application The bundle manager needs to be initialized before you can do anything with it. ALP applications normally run in an environment where the bundle manager is already initialized. Use this routine if you want to support running in environments without an initialized bundle manager. If the bundle manager is already initialized (in any mode), this will increment a refcount. Thus, it's safe to use from arbitrary code. |
|
Return a list of all bundle names in the system.
|
|
Return a list of all properties which are present in any bundle in the system.
|
|
All of these return a GList of allocated strings.Return a list of all valid bundle types the system supports.
|
|
Return a list of all stores current available in the system.
|
|
Identify open bundle containing a file Given a POSIX file path, this will attempt to identify an open bundle which matches that path. The supplied path can be the root of a folder, or any file or folder name within that folder (existing or not).
|
|
Return a bundle index of the bundle containing the running code Returns a bundle index to the bundle which contains the code which invoked this function. Note that this function explicitly detects what routine it is being called from. Don't expect it to operate from a utility subroutine -- consider using a macro. This routine identifies the caller, and determines if that caller is in library loaded from a bundle. If the immediate caller is not in a bundle, NULL will be returned.
|
|
|
|
Return a the value for a metadata key of a bundle Given a bundle index and a key name, return the value of that key as an allocated string, or NULL if there is no such key.
|
|
Move a bundle to an active store This uses the bundle manager to move a registered bundle from one store to another.
|
|
Given a bundle index, this will retrieve the bundle's name
|
|
Open a bundle Given a bundle index, open the bundle, making its contents available for use, until it is closed. Note that opening a bundle will automatically make sure that any bundles it requires are also opened -- if any requirements are not met that are not optional, the open will fail. |
|
|
|
Given a bundle index and a key name, return the value of that key as an allocated string, or NULL if there is no such key.
|
|
Return a bundle ref to the running application Returns a bundle ref to the bundle which the running application was launched from.
|
|
Return a bundle index given a bundle ref Returns a bundle index for a supplied bundle ref.
|
|
Given a bundle ref, this will retrieve its domain for gettext Some bundle types (ALP native bundles -- "bar") support gettext for localization. For these types of bundles, you can retrieve a text domain.
|
|
Return a bundle ref to the running code Returns a bundle ref to the bundle which contains the code which invoked this function. Note that this function explicitly detects what routine it is being called from. Don't expect it to operate from a utility subroutine -- consider using a macro. This routine identifies the caller, and determines if that caller is in library loaded from a bundle. If the immediate caller is not in a bundle, NULL will be returned.
|
|
Given a bundle ref, this will retrieve the bundle's name
|
|
Open a GIOChannel to retrieve a read-only file from a bundle. Given a pathname referring to a file existing within a bundle, this routine will open it for reading, and seeking if possible, and return a GIOChannel to the caller. If the pathname starts with a slash, then it is taken as a fixed path within the bundle. If it does not start with a slash, it will be looked up according to the bundle's search path.
|
|
Retrieve a read-only file in a bundle as an allocated data block. Given a pathname referring to a file existing within a bundle, this routine will load the file contents into a newly allocated data block. If the pathname starts with a slash, then it is taken as a fixed path within the bundle. If it does not start with a slash, it will be looked up according to the bundle's search path.
|
|
Retrieve list of resources within a bundle. Given a pathname referring to a folder within a bundle, this routine will return a list of all items in that folder inside the bundle.
|
|
Retrieve a pathname for read-only file in a bundle. Given a pathname referring to a file existing within a bundle, this routine will convert it to an absolute path, suitable for use with normal C and POSIX calls. If the pathname starts with a slash, then it is taken as a fixed path within the bundle. If it does not start with a slash, it will be looked up according to the bundle's search path.
|
|
Create a temporary file with the contents of a read-only file in a bundle. Given a pathname referring to a file existing within a bundle, this routine will return the name of a temporary file suitable for retrieving the contents. If the pathname starts with a slash, then it is taken as a fixed path within the bundle. If it does not start with a slash, it will be looked up according to the bundle's search path.
|
|
Delete some or all files within a bundles R/W data folder As a convenience, you can easily delete all of the R/W data for a bundle, or a subset of that data, using this routine. If the supplied file_path is empty (""), then all data will be removed, otherwise only data in a folder matching the supplied path.
|
|
Returns the path to the R/W data folder for a bundle. This routine will automatically make any folders necessary. I.e., a call to alp_bundle_rw_pathname(pkg, "a/b/c", TRUE); will gaurantee that the "a", and "a/b" folders exist, so that the "a/b/c" file can be created if it does not already exist.
|
|
Given a bundle index, retrieve the matching saved global settings key Saved settings are global settings specific to a bundle which survive even when the associated bundle is deleted. The settings are related to bundle name, so any bundles of the same name share the same saved global settings.
|
|
Given a filename and/or mimetype, determine what bundle scheme is appropriate. If there's enough information to make a guess about the type of bundle represented by a filename and/or mimetype, this routine will return the matching scheme name. The scheme name returned may not be correct, and this does not gaurantee that attempting to install such a named bundle with that scheme will succeed -- this is strictly a front-line convenience routine.
|
|
Return a the value for a scheme description key Given a scheme name and a key name, return the value of that key as an allocated string, or NULL if there is no such key.
|
|
Return all data describing a scheme Given a scheme name, returns a hashtable containing keys and values describing the scheme. As an example, the "bar" scheme has "extension" and "mimetype" keys. The value for the "extension" key is ".bar".
|
|
Search for bundles that match a set of criteria, including name, store, properties, type. This function returns zero, one, or more AlpBundle indexes for bundle which match a set of criteria. This is the fundamental routine for finding AlpBundle identifiers if you can't use alp_bundle_by_name(). If you want to retrieve all valid bundle indexes, use this routine with a set of NULL parameters.
|
|
Retrieve information about a store.
|
|
Retrieve a particular information value about a store.
|
|
Releases any storage associated with a tempfile returned from alp_bundle_ref_ro_tempfile(). This routine should be used when you are done with a tempfile. It'll take care of releasing any storage (file, memory, heap, etc.) associated with a tempfile.
|
|
Given a bundle index, retrieve the matching unsaved global settings key Unsaved settings are global settings specific to a bundle which are deleted when the associated bundle is deleted. The settings are related to bundle name, so any bundles of the same name share the same unsaved global settings.
|