SCPM interface 1.0

scpm_types.h

Go to the documentation of this file.
00001 /*
00002  * $Id: scpm_types.h,v 1.3 2006/09/21 12:36:16 hschaa 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 #include <unistd.h>
00031 
00032 typedef enum save_mode_t {
00033   normal,
00034   save_all,
00035   patch_all
00036 } ;
00037 
00038 typedef struct resource_group_t {
00039   std::string name;
00040   std::string description;
00041   bool user_defined;
00042   bool user_modified;
00043   bool active;
00044 } ;
00045 
00046 typedef struct resource_entry_t {
00047   std::string name;
00048   std::string type;
00049   bool active;
00050   bool user_defined;
00051 } ;
00052 
00053 typedef struct resource_info_t {
00054   std::string resource_name;
00055   std::string resource_type;
00056   bool   is_new;
00057   bool   is_deleted;
00058   bool   save;
00059   save_mode_t save_mode;
00060   std::vector<resource_group_t> groups;
00061 } ;
00062 
00063 typedef struct switch_info_t {
00064   bool profile_modified;
00065   std::string profile_name;
00066   std::vector<resource_info_t> modified_resources;
00067 } ;
00068 
00069 typedef struct scpm_status_t {
00070   bool initialized;
00071   bool enabled;
00072   bool db_loaded;
00073   bool db_uptodate;
00074   bool locked;
00075   bool needs_reinit;
00076   bool needs_recover;
00077   std::string active_profile;
00078   std::string scpm_version;
00079   std::string db_version;
00080   std::string db_format;
00081   std::string db_format_version;
00082 } ;
00083 
00084 typedef struct backup_info_t {
00085   std::string name;
00086   std::string type;
00087   std::string profile;
00088         std::vector< std::pair<time_t, std::string> > versions;
00089 } ;
00090 
00091 typedef enum rebuild_mode_t {
00092   REBUILD_MODE_QUICK,
00093   REBUILD_MODE_RESOURCES_ONLY,
00094   REBUILD_MODE_DATA_ONLY,
00095   REBUILD_MODE_FULL
00096 };
00097 
00098 extern char *scpm_error;
00099 extern int scpm_journal_abort_steps;
00100 
00101 const int scpm_flag_force           = 1;
00102 const int scpm_flag_skip            = 2;
00103 const int scpm_flag_quiet           = 4;
00104 const int scpm_flag_verbose         = 8;
00105 const int scpm_flag_hash            = 16;
00106 const int scpm_flag_debug           = 32;
00107 const int scpm_flag_boot            = 64;
00108 const int scpm_flag_exit_on_warning = 128;
00109 const int scpm_flag_skip_load       = 256;
00110 const int scpm_flag_force_db        = 512;
00111 const int scpm_flag_read_only       = 1024;
00112 const int scpm_flag_wait_commit     = 2048;
00113 
00114 #endif

SCPM interface description - 2002,2003 SuSE Linux AG