Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

images.c File Reference

#include <hiker/bundlemgr.h>
#include <hiker/prv/bundlemgr_prv.h>
#include <hiker/ipc.h>
#include <string.h>
#include <stdlib.h>
#include <sqlite3.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/sendfile.h>
#include <alp/pdk/gras.h>
#include "pm_traces.h"
#include "pm_globals.h"
#include "pm_ipc.h"
#include "pm_sql.h"
#include "pm_bar.h"
#include "pm_msg.h"
#include "pm_perms.h"
#include "ghost_support.h"
#include "java_support.h"
#include "cramfs_interface.h"

Defines

#define SIZE   65536

Functions

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_p, GHashTable **properties_p, 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 my_alp_ipc_message_pack_GHashTable_str_str (AlpMessage *response, GHashTable *h)
alp_status_t my_alp_ipc_message_pack_GHashTable_str_list_GHashTable_str_str (AlpMessage *response, GHashTable *h)
void handle_client_alp_prv_bundle_image_install_tmpname (AlpConnection *connection, AlpMessage *message, gpointer cbData)
AlpBundle alp_prv_ghost_image_install (const char *provide_filename, const char *provide_mimetype, int fd, const char *destination_store, int flags, GHashTable **metadata_p, GHashTable **properties_p, AlpBundleProgressiveData *progress, AlpConnection *connection)
AlpBundle alp_prv_java_image_install (const char *provide_filename, const char *provide_mimetype, int fd, const char *destination_store, int flags, GHashTable **metadata_p, GHashTable **properties_p, AlpBundleProgressiveData *progress, AlpConnection *connection)
AlpBundle alp_prv_bundle_image_install_fd (const char *provide_filename, const char *provide_mimetype, int fd, const char *destination_store, int flags, GHashTable **metadata_p, GHashTable **properties_p, AlpBundleProgressiveData *progress, AlpConnection *connection)
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.).


Define Documentation

#define SIZE   65536
 


Function Documentation

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.).

Parameters:
[in] index A valid AlpBundle index
[out] desired_filename If not NULL, this will be filled in with the filename that the bundle thinks it should have.
[out] desired_mimetype If not NULL, this will be filled in with the mimetype that the bundle thinks it should have.
[in] image A GIOChannel * referring to a channel which the bundle data should be written to. This channel should at least support WRITE operations, and more efficient operation may be possible if it supports SEEK, or READ, (SEEK being more important than READ). If NULL, this routine will attempt to fill in the desired_filename and desired_mimetype parameters, if supplied, but will not actually archive the bundle.
[in] progress If not NULL, this should be an AlpBundleProgressiveData object.
Returns:
Non-zero value if is was not possible to archive the bundle

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.

Parameters:
[in] provide_filename If not NULL, this should be the filename that was supplied with the data source. It's possible that the name is neither relevant nor needed, but it can be supplied.
[in] provide_mimetype If not NULL, this should be the mimetype that was supplied with the data source. It's possible that the mimetype is neither relevant nor needed, but it can be supplied.
[in] image A GIOChannel * referring to a channel which the bundle data should be read from. This channel should at least support READ operations, and more efficient operation may be possible if it supports SEEK. WRITE will never be used.
[in] destination_store If not NULL, this should be the name of a store which the bundle should be placed on. If NULL, the system will pick a default, normally the internal store.
[in] flags 0, or ALP_BUNDLE_FLAG_OVERWRITE_DUPLICATES, if you want to allow erasure of an identically named bundle
[out] metadata If not NULL, then this pointer will be filled with a copy of the bundle metadata.
[out] properties If not NULL, then this pointer will be filled with a copy of the bundle properties
[in] progress If not NULL, this should be an AlpBundleProgressiveData object.
Returns:
An AlpBundle index if installation was successful, otherwise a NULL index.

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.

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.

Parameters:
[in] provide_filename If not NULL, this should be the filename that was supplied with the data source. It's possible that the name is neither relevant nor needed, but it can be supplied.
[in] provide_mimetype If not NULL, this should be the mimetype that was supplied with the data source. It's possible that the mimetype is neither relevant nor needed, but it can be supplied.
[in] image A GIOChannel * referring to a channel which the bundle data should be read from. This channel should at least support READ operations, and more efficient operation may be possible if it supports SEEK. WRITE will never be used.
[in] full_check Set this gbool to FALSE if you want to skip expensive tests (such as complete file-system integrity checks). It is not recommended to do this if you don't know the bundle previously passed full verification.
[out] metadata If not NULL, then this pointer will be filled with a copy of the bundle metadata.
[out] properties If not NULL, then this pointer will be filled with a copy of the bundle properties
[in] progress If not NULL, this should be an AlpBundleProgressiveData object, filled in as described

AlpBundle alp_prv_bundle_image_install_fd const char *  provide_filename,
const char *  provide_mimetype,
int  fd,
const char *  destination_store,
int  flags,
GHashTable **  metadata_p,
GHashTable **  properties_p,
AlpBundleProgressiveData progress,
AlpConnection connection
 

AlpBundle alp_prv_ghost_image_install const char *  provide_filename,
const char *  provide_mimetype,
int  fd,
const char *  destination_store,
int  flags,
GHashTable **  metadata_p,
GHashTable **  properties_p,
AlpBundleProgressiveData progress,
AlpConnection connection
 

AlpBundle alp_prv_java_image_install const char *  provide_filename,
const char *  provide_mimetype,
int  fd,
const char *  destination_store,
int  flags,
GHashTable **  metadata_p,
GHashTable **  properties_p,
AlpBundleProgressiveData progress,
AlpConnection connection
 

void handle_client_alp_prv_bundle_image_install_tmpname AlpConnection connection,
AlpMessage message,
gpointer  cbData
 

alp_status_t my_alp_ipc_message_pack_GHashTable_str_list_GHashTable_str_str AlpMessage response,
GHashTable *  h
 

alp_status_t my_alp_ipc_message_pack_GHashTable_str_str AlpMessage response,
GHashTable *  h
 


Generated on Sat Dec 16 20:29:48 2006 for hiker-0.9 by  doxygen 1.4.4