00001 /* 00002 * $Id: scpm_types.h,v 1.2 2005/07/22 15:12:37 gleissner Exp $ 00003 * 00004 * Type definitions for the SCPM interface. 00005 * 00006 * Copyright 2001 SuSE GbmH 00007 * 2002-2004 SuSE Linux AG 00008 * 00009 * Author: Joachim Gleissner <jg@suse.de> 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 */ 00025 #ifndef SCPM_TYPES_H 00026 #define SCPM_TYPES_H 00027 00028 #include <string> 00029 #include <vector> 00030 00031 typedef enum save_mode_t { 00032 normal, 00033 save_all, 00034 patch_all 00035 } ; 00036 00037 typedef struct resource_group_t { 00038 std::string name; 00039 std::string description; 00040 bool user_defined; 00041 bool user_modified; 00042 bool active; 00043 } ; 00044 00045 typedef struct resource_entry_t { 00046 std::string name; 00047 std::string type; 00048 bool active; 00049 bool user_defined; 00050 } ; 00051 00052 typedef struct resource_info_t { 00053 std::string resource_name; 00054 std::string resource_type; 00055 bool is_new; 00056 bool is_deleted; 00057 bool save; 00058 save_mode_t save_mode; 00059 std::vector<resource_group_t> groups; 00060 } ; 00061 00062 typedef struct switch_info_t { 00063 bool profile_modified; 00064 std::string profile_name; 00065 std::vector<resource_info_t> modified_resources; 00066 } ; 00067 00068 typedef struct scpm_status_t { 00069 bool initialized; 00070 bool enabled; 00071 bool db_loaded; 00072 bool db_uptodate; 00073 bool locked; 00074 bool needs_reinit; 00075 bool needs_recover; 00076 std::string active_profile; 00077 std::string scpm_version; 00078 std::string db_version; 00079 std::string db_format; 00080 std::string db_format_version; 00081 } ; 00082 00083 typedef struct backup_info_t { 00084 std::string name; 00085 std::string type; 00086 std::string profile; 00087 } ; 00088 00089 typedef enum rebuild_mode_t { 00090 REBUILD_MODE_QUICK, 00091 REBUILD_MODE_RESOURCES_ONLY, 00092 REBUILD_MODE_DATA_ONLY, 00093 REBUILD_MODE_FULL 00094 }; 00095 00096 extern char *scpm_error; 00097 extern int scpm_journal_abort_steps; 00098 00099 const int scpm_flag_force = 1; 00100 const int scpm_flag_skip = 2; 00101 const int scpm_flag_quiet = 4; 00102 const int scpm_flag_verbose = 8; 00103 const int scpm_flag_hash = 16; 00104 const int scpm_flag_debug = 32; 00105 const int scpm_flag_boot = 64; 00106 const int scpm_flag_exit_on_warning = 128; 00107 const int scpm_flag_skip_load = 256; 00108 const int scpm_flag_force_db = 512; 00109 const int scpm_flag_read_only = 1024; 00110 const int scpm_flag_wait_commit = 2048; 00111 00112 #endif