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

pm_globals.h

Go to the documentation of this file.
00001 /********************************************************************
00002 
00003 Copyright 2006, ACCESS Systems Americas, Inc. All rights reserved.
00004 
00005 The contents of this file are subject to the Mozilla Public License Version
00006 1.1 (the "License"); you may not use this file except in compliance with
00007 the License. You may obtain a copy of the License at
00008 http://www.mozilla.org/MPL/
00009 
00010 Software distributed under the License is distributed on an "AS IS" basis,
00011 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012 for the specific language governing rights and limitations under the
00013 License.
00014 
00015 The Original Code is the entire contents of this file.
00016 
00017 The Initial Developer of the Original Code is ACCESS Systems Americas, Inc.
00018 
00019 Portions created by ACCESS Systems Americas, Inc. are Copyright © 2006. All
00020 Rights Reserved.
00021 
00022 Contributor(s): none.
00023 
00024 ********************************************************************/
00025 #include <hiker/bundlemgr.h>
00026 #include <hiker/prv/bundlemgr_prv.h>
00027 #include <hiker/ipc.h>
00028 #include <string.h>
00029 #include <stdlib.h>
00030 #include <sqlite3.h>
00031 #include <hiker/syspaths.h>
00032 #include <hiker/global_settings.h>
00033 
00034 #define DEFAULT_BUNDLE_WORK_PATH "/tmp/bundlemgr/work/"
00035 #define BAR_LINK_PATH "links"
00036 #define BAR_MOUNT_PATH "mounts"
00037 #define BAR_LD_PATH "libs"
00038 #define DEFAULT_BUNDLE_RW_PATH ALP_SYSPATH_BUNDLE_DATA
00039 #define BAR_RW_PATH "bar/%s"
00040 #define BAR_DEFAULT_SEARCHPATH "/rsc/^l/:/"
00041 #define BAR_DEFAULT_TEXTDOMAIN_NAME "bar-^n"
00042 #define BAR_DEFAULT_TEXTDOMAIN_DIR "rsc"
00043 
00044 #define NOTIFY_NAME "bundlemgr_d" 
00045 #define BAR_LIBPATH "/libalp_%s.so"
00046 #define BAR_DEFAULT_SEARCH "alp_main"
00047 
00048 #define DEFAULT_IPC_CHANNEL "ALPBundleMgr"
00049 #define DEFAULT_DATABASE ALP_SYSPATH_SYSTEM_CACHE "bundlemgr/bundle_mgr.db"
00050 #define DEFAULT_LIVE_DATABASE "/tmp/bundlemgr/live_bundle_mgr.db"
00051 
00052 #define SQLITE_RETRY_MS 10000
00053 
00054 #define PM_CURRENT_DB_VERSION 16
00055 
00056 #define BUNDLE_SCHEME_BAR 1
00057 #define BUNDLE_SCHEME_GHOST 2
00058 #define BUNDLE_SCHEME_JAVA 3
00059 
00060 #define BUNDLE_SCHEME_NAME_BAR "bar"
00061 #define BUNDLE_SCHEME_NAME_GHOST "GHost"
00062 #define BUNDLE_SCHEME_NAME_JAVA "java"
00063 
00064 // From:
00065 //  http://www.iana.org/assignments/media-types/application/vnd.palm
00066 //  http://developers.sun.com/techtopics/mobility/midp/articles/deploy/
00067 #define MIME_TYPE_PRC   "application/vnd.palm"
00068 #define MIME_TYPE_PRC_2 "application/x-pilot"
00069 #define MIME_TYPE_BAR   "x-application/access-bar" //FIXME: Still need to decide on this
00070 #define MIME_TYPE_JAR   "application/java-archive"
00071 #define MIME_TYPE_JAD   "text/vnd.sun.j2me.app-descriptor"
00072 
00073 
00074 enum {
00075         STATUS_UNINIT = 0,
00076         STATUS_CLIENT = 1,
00077         STATUS_SERVER = 2
00078 };
00079 
00080 extern alp_status_t register_volsvc_hooks();
00081 
00082 extern int pm_status;
00083 
00084 extern sqlite3 * db;
00085 
00086 extern AlpChannel * pm_server_channel;
00087 extern AlpConnection * pm_client_connection;
00088 
00089 extern GHashTable * gConnectionTable;
00090 
00091 extern AlpGlobalSettingsContext * gGSContext;
00092 
00093 extern GList * pm_prv_searchpath(const char * path);
00094 
00095 extern gboolean gNotify;
00096 extern const char * gBundleRWPath;
00097 extern const char * gBundleWorkPath;
00098 
00099 extern gboolean gHoldNotifications;
00100 extern gboolean gHoldNotificationInstall;
00101 extern gboolean gHoldNotificationRegister;
00102 
00103 extern int mkdir_p(const char * path, int mode);
00104 extern int rmdir_contents(const char * path);
00105 extern gchar * hypotheticalpath(const char * path);
00106 
00107 extern void wipe_locales();
00108 
00109 extern int alp_prv_associated_data(const char * name);
00110 
00111 extern int alp_prv_folder_empty(const char * path, int status_on_missing);
00112 
00113 extern alp_status_t alp_prv_bundle_setup_schema();
00114 
00115 extern void alp_prv_package_clear_refs();
00116 
00117 extern int lock;
00118 
00119 extern alp_status_t my_sync_notify(const char * appID, const char * notifyType, void * details, int length, int queue, int flags, int timeout, int * handled);
00120 extern alp_status_t my_async_notify(const char * appID, const char * notifyType, void * details, int length, int queue, int flags);
00121 extern void destroy_notify_pool(void);
00122 
00123 extern 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);
00124 
00125 extern void alp_prv_bundle_clear_local_effects();
00126 
00127 extern void reset_hold();
00128 
00129 extern alp_status_t set_error(alp_status_t status);
00130 
00131 extern int safe_sql_fillin(char * str, const char * fillin);

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