Make backend_id const
2001-09-07 Bradford Hovinen <hovinen@ximian.com> * archiver-client.c (location_client_store_xml): Make backend_id const * util.c (parse_date): Set the time zone (parse_date): Initialize tm_isdst * archiver-client.c (location_client_store_xml): Call ConfigArchiver_Location_storageComplete when done (location_client_store_xml): Don't try to save the XML file if there was an error getting the storage filename * location.c (location_storage_complete): Implement (impl_ConfigArchiver_Location_storageComplete): Implement * config-log.c (config_log_get_backend_id_for_id): Make return value const 2001-09-04 Bradford Hovinen <hovinen@ximian.com> * location.c (location_get_storage_filename): Notify listeners that new rollback data is available * bonobo-config-archiver.c (new_rollback_cb): Implement (bonobo_config_archiver_new): Connect above to event source * location.c (location_store): (location_init): Construct an event source and add its interface * Makefile.am (INCLUDES): Remove -DDEFAULTS_DIR 2001-09-03 Bradford Hovinen <hovinen@ximian.com> * bonobo-config-archiver.c (bonobo_config_archiver_new): Accept complete moniker as an argument; do the parsing here * archiver-client.c (location_client_load_rollback_data): Adjust time from mktime according to time zone information * bonobo-moniker-archiver.c (is_leap_year): (mod_date_by_str): Implement (parse_name): Use correct math for computing offsets * bonobo-config-archiver.c (bonobo_config_archiver_new): Don't print an error message if the parent moniker is bad (bonobo_config_archiver_new): Remove debugging messages * archiver-client.c (location_client_load_rollback_data): Make date and backend_id const * bonobo-moniker-archiver.c (archiverdb_resolve): Determine date from moniker and pass to bonobo_config_archiver_new * bonobo-config-archiver.c (bonobo_config_archiver_new): Accept date structure as argument
This commit is contained in:
parent
7f4dbc6ff6
commit
6ab6caa498
12 changed files with 343 additions and 142 deletions
|
@ -29,6 +29,7 @@
|
|||
#include <gnome-xml/parser.h>
|
||||
|
||||
#include "archiver-client.h"
|
||||
#include "util.h"
|
||||
|
||||
static void merge_xml_docs (xmlDocPtr child_doc,
|
||||
xmlDocPtr parent_doc);
|
||||
|
@ -56,18 +57,22 @@ static gboolean compare_xml_nodes (xmlNodePtr node1, xmlNodePtr node2);
|
|||
|
||||
xmlDocPtr
|
||||
location_client_load_rollback_data (ConfigArchiver_Location location,
|
||||
struct tm *date,
|
||||
const struct tm *date,
|
||||
guint steps,
|
||||
gchar *backend_id,
|
||||
const gchar *backend_id,
|
||||
gboolean parent_chain,
|
||||
CORBA_Environment *opt_ev)
|
||||
{
|
||||
gchar *filename;
|
||||
time_t time_g;
|
||||
xmlDocPtr doc = NULL, parent_doc = NULL;
|
||||
ConfigArchiver_ContainmentType type = ConfigArchiver_CONTAIN_FULL;
|
||||
ConfigArchiver_Location parent = CORBA_OBJECT_NIL;
|
||||
CORBA_Environment my_ev;
|
||||
gchar *filename;
|
||||
struct tm *date_c;
|
||||
time_t time_g;
|
||||
|
||||
xmlDocPtr doc = NULL;
|
||||
xmlDocPtr parent_doc = NULL;
|
||||
ConfigArchiver_ContainmentType type = ConfigArchiver_CONTAIN_FULL;
|
||||
ConfigArchiver_Location parent = CORBA_OBJECT_NIL;
|
||||
|
||||
CORBA_Environment my_ev;
|
||||
|
||||
g_return_val_if_fail (location != CORBA_OBJECT_NIL, NULL);
|
||||
|
||||
|
@ -76,14 +81,21 @@ location_client_load_rollback_data (ConfigArchiver_Location location,
|
|||
CORBA_exception_init (opt_ev);
|
||||
}
|
||||
|
||||
if (date != NULL)
|
||||
time_g = mktime (date);
|
||||
else
|
||||
if (date != NULL) {
|
||||
date_c = dup_date (date);
|
||||
time_g = mktime (date_c) + date_c->tm_gmtoff;
|
||||
if (date_c->tm_isdst) time_g -= 3600;
|
||||
g_free (date_c);
|
||||
} else {
|
||||
time_g = 0;
|
||||
}
|
||||
|
||||
filename = ConfigArchiver_Location_getRollbackFilename
|
||||
(location, time_g, steps, backend_id, parent_chain, opt_ev);
|
||||
|
||||
if (!BONOBO_EX (opt_ev) && filename != NULL)
|
||||
DEBUG_MSG ("Loading rollback data: %s", filename);
|
||||
|
||||
if (!BONOBO_EX (opt_ev) && filename != NULL)
|
||||
doc = xmlParseFile (filename);
|
||||
else if (parent_chain)
|
||||
|
@ -127,16 +139,17 @@ location_client_load_rollback_data (ConfigArchiver_Location location,
|
|||
|
||||
void
|
||||
location_client_store_xml (ConfigArchiver_Location location,
|
||||
gchar *backend_id,
|
||||
const gchar *backend_id,
|
||||
xmlDocPtr xml_doc,
|
||||
ConfigArchiver_StoreType store_type,
|
||||
CORBA_Environment *opt_ev)
|
||||
{
|
||||
xmlDocPtr parent_doc, prev_doc = NULL;
|
||||
char *filename;
|
||||
ConfigArchiver_ContainmentType contain_type;
|
||||
ConfigArchiver_Location parent;
|
||||
CORBA_Environment my_ev;
|
||||
xmlDocPtr parent_doc;
|
||||
xmlDocPtr prev_doc = NULL;
|
||||
char *filename;
|
||||
ConfigArchiver_ContainmentType contain_type;
|
||||
ConfigArchiver_Location parent;
|
||||
CORBA_Environment my_ev;
|
||||
|
||||
g_return_if_fail (location != CORBA_OBJECT_NIL);
|
||||
g_return_if_fail (xml_doc != NULL);
|
||||
|
@ -191,9 +204,14 @@ location_client_store_xml (ConfigArchiver_Location location,
|
|||
if (parent != CORBA_OBJECT_NIL)
|
||||
bonobo_object_release_unref (parent, NULL);
|
||||
|
||||
filename = ConfigArchiver_Location_getStorageFilename (location, backend_id, store_type == ConfigArchiver_STORE_DEFAULT, opt_ev);
|
||||
xmlSaveFile (filename, xml_doc);
|
||||
CORBA_free (filename);
|
||||
filename = ConfigArchiver_Location_getStorageFilename
|
||||
(location, backend_id, store_type == ConfigArchiver_STORE_DEFAULT, opt_ev);
|
||||
|
||||
if (!BONOBO_EX (opt_ev) && filename != NULL) {
|
||||
xmlSaveFile (filename, xml_doc);
|
||||
ConfigArchiver_Location_storageComplete (location, filename, opt_ev);
|
||||
CORBA_free (filename);
|
||||
}
|
||||
|
||||
if (opt_ev == &my_ev)
|
||||
CORBA_exception_free (opt_ev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue