SCPM interface  1.0
scpm_types.h
Go to the documentation of this file.
1 /*
2  * $Id: scpm_types.h,v 1.3 2006/09/21 12:36:16 hschaa Exp $
3  *
4  * Type definitions for the SCPM interface.
5  *
6  * Copyright 2001 SuSE GbmH
7  * 2002-2004 SuSE Linux AG
8  *
9  * Author: Joachim Gleissner <jg@suse.de>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  */
25 #ifndef SCPM_TYPES_H
26 #define SCPM_TYPES_H
27 
28 #include <string>
29 #include <vector>
30 #include <unistd.h>
31 
32 typedef enum save_mode_t {
33  normal,
34  save_all,
35  patch_all
36 } ;
37 
38 typedef struct resource_group_t {
39  std::string name;
40  std::string description;
43  bool active;
44 } ;
45 
46 typedef struct resource_entry_t {
47  std::string name;
48  std::string type;
49  bool active;
51 } ;
52 
53 typedef struct resource_info_t {
54  std::string resource_name;
55  std::string resource_type;
56  bool is_new;
57  bool is_deleted;
58  bool save;
60  std::vector<resource_group_t> groups;
61 } ;
62 
63 typedef struct switch_info_t {
65  std::string profile_name;
66  std::vector<resource_info_t> modified_resources;
67 } ;
68 
69 typedef struct scpm_status_t {
71  bool enabled;
72  bool db_loaded;
74  bool locked;
75  bool needs_reinit;
76  bool needs_recover;
77  std::string active_profile;
78  std::string scpm_version;
79  std::string db_version;
80  std::string db_format;
81  std::string db_format_version;
82 } ;
83 
84 typedef struct backup_info_t {
85  std::string name;
86  std::string type;
87  std::string profile;
88  std::vector< std::pair<time_t, std::string> > versions;
89 } ;
90 
91 typedef enum rebuild_mode_t {
96 };
97 
98 extern char *scpm_error;
99 extern int scpm_journal_abort_steps;
100 
101 const int scpm_flag_force = 1;
102 const int scpm_flag_skip = 2;
103 const int scpm_flag_quiet = 4;
104 const int scpm_flag_verbose = 8;
105 const int scpm_flag_hash = 16;
106 const int scpm_flag_debug = 32;
107 const int scpm_flag_boot = 64;
109 const int scpm_flag_skip_load = 256;
110 const int scpm_flag_force_db = 512;
111 const int scpm_flag_read_only = 1024;
112 const int scpm_flag_wait_commit = 2048;
113 
114 #endif
std::string name
String containg the resource name.
Definition: scpm_types.h:85
bool user_defined
Is true for user defined resource groups.
Definition: scpm_types.h:41
std::string profile_name
Contains the profile name.
Definition: scpm_types.h:65
std::string active_profile
active profile
Definition: scpm_types.h:77
variable type for profile switch information
Definition: scpm_types.h:63
std::string name
String containing the resource name.
Definition: scpm_types.h:47
save_mode_t save_mode
defines save mode for the resource
Definition: scpm_types.h:59
bool db_loaded
SCDB loaded
Definition: scpm_types.h:72
const int scpm_flag_hash
print progress bar when useful (using hash marks)
Definition: scpm_types.h:105
std::string scpm_version
version of the SCPM subsystem
Definition: scpm_types.h:78
const int scpm_flag_skip_load
skip loading of database
Definition: scpm_types.h:109
std::string db_format
SCDB format
Definition: scpm_types.h:80
bool active
Is true in case the group is active.
Definition: scpm_types.h:43
bool user_modified
Is true for user modified.
Definition: scpm_types.h:42
const int scpm_flag_verbose
tell what&#39;s going on
Definition: scpm_types.h:104
const int scpm_flag_debug
log debug messages
Definition: scpm_types.h:106
std::string resource_name
string contain resource name
Definition: scpm_types.h:54
const int scpm_flag_force
force flag (deletes/overwrites silently data)
Definition: scpm_types.h:101
const int scpm_flag_exit_on_warning
abort even on warnings
Definition: scpm_types.h:108
bool enabled
SCPM enabled
Definition: scpm_types.h:71
std::string description
String describing the resource group.
Definition: scpm_types.h:40
const int scpm_flag_quiet
no user output
Definition: scpm_types.h:103
variable type for resource information
Definition: scpm_types.h:53
bool is_deleted
resource new flag
Definition: scpm_types.h:57
Variable type to represent a resource entry of a resource group.
Definition: scpm_types.h:46
std::string name
String containing the resource group name.
Definition: scpm_types.h:39
bool initialized
SCPM initialized
Definition: scpm_types.h:70
transport container for SCPM status information
Definition: scpm_types.h:69
char * scpm_error
Contains last error.
std::string db_format_version
SCDB format version
Definition: scpm_types.h:81
Variable type to represent a resource group.
Definition: scpm_types.h:38
bool db_uptodate
SCDB up to date
Definition: scpm_types.h:73
Rebuilds only data part of scdb (not yet supported)
Definition: scpm_types.h:94
bool is_new
resource new flag
Definition: scpm_types.h:56
std::vector< resource_info_t > modified_resources
Vector containing resource descriptions of modified resources.
Definition: scpm_types.h:66
save_mode_t
Enum varaible type.
Definition: scpm_types.h:32
std::string type
String containg the resource type.
Definition: scpm_types.h:86
bool user_defined
Bool indicating whether the resource is user defined.
Definition: scpm_types.h:50
std::vector< resource_group_t > groups
holds the names of the resource groups the resource belongs to
Definition: scpm_types.h:60
Removes obsolete resources and adds new ones.
Definition: scpm_types.h:92
const int scpm_flag_skip
skip flag (silently drops changes in profiles)
Definition: scpm_types.h:102
bool profile_modified
profile modified flag
Definition: scpm_types.h:64
Rebuilds only resources part of scdb.
Definition: scpm_types.h:93
bool active
Bool indicating whether the resource is active.
Definition: scpm_types.h:49
std::string resource_type
string contain resource type
Definition: scpm_types.h:55
Helpers struct for backup funtions.
Definition: scpm_types.h:84
const int scpm_flag_force_db
force loading of database even when versions do not match
Definition: scpm_types.h:110
rebuild_mode_t
Rebuild mode enum.
Definition: scpm_types.h:91
Totally rebuilds scdb (not yet supported)
Definition: scpm_types.h:95
bool save
resource to save flag
Definition: scpm_types.h:58
const int scpm_flag_boot
boot mode (does not call resource actions)
Definition: scpm_types.h:107
std::string db_version
SCDB version
Definition: scpm_types.h:79
std::string type
String containing the resource type.
Definition: scpm_types.h:48

SCPM interface description - 2002,2003 SuSE Linux AG