#include <hiker/bundlemgr.h>
#include <hiker/prv/bundlemgr_prv.h>
#include <hiker/fail.h>
#include <hiker/ipc.h>
#include <string.h>
#include <stdlib.h>
#include <sqlite3.h>
#include <unistd.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <dlfcn.h>
#include <signal.h>
#include <errno.h>
#include <sys/wait.h>
#include "pm_traces.h"
#include "pm_globals.h"
#include "pm_ipc.h"
#include "pm_sql.h"
Functions | |
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. | |
GClosure * | alp_bundle_acquire_entrypoint (const char *url, AlpBundleRef relativeRef) |
Get a function pointer to a shared library 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,...) |
|
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); |
|
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.
|