--- parser3/src/main/pa_stylesheet_connection.C 2004/02/13 14:06:02 1.1 +++ parser3/src/main/pa_stylesheet_connection.C 2024/11/04 03:53:25 1.15 @@ -1,49 +1,44 @@ /** @file Parser: Stylesheet connection implementation. - Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ -static const char * const IDENT_STYLESHEET_CONNECTION_C="$Date: 2004/02/13 14:06:02 $"; - #include "pa_config_includes.h" +#ifdef XML + #include "pa_stylesheet_connection.h" #include "pa_xml_exception.h" +volatile const char * IDENT_PA_STYLESHEET_CONNECTION_C="$Id: pa_stylesheet_connection.C,v 1.15 2024/11/04 03:53:25 moko Exp $" IDENT_PA_STYLESHEET_CONNECTION_H; + void Stylesheet_connection::load(time_t new_disk_time) { xsltStylesheet *nstylesheet; { - pa_xmlStartMonitoringDependencies(); + dependencies=pa_xmlStartMonitoringDependencies(); // just to reference TLS variable { - int saved=xmlDoValidityCheckingDefaultValue;// - xmlDoValidityCheckingDefaultValue=0;// + int saved=xmlDoValidityCheckingDefaultValue; + xmlDoValidityCheckingDefaultValue=0; nstylesheet=xsltParseStylesheetFile(BAD_CAST ffile_spec.cstr()); - xmlDoValidityCheckingDefaultValue = saved;// + xmlDoValidityCheckingDefaultValue = saved; } dependencies=pa_xmlGetDependencies(); } - if(xmlHaveGenericErrors()) { - GdomeException exc=0; - throw XmlException(new String(ffile_spec, String::L_TAINTED), exc); - } + if(xmlHaveGenericErrors()) + throw XmlException(new String(ffile_spec, String::L_TAINTED), pa_thread_request()); if(!nstylesheet) - throw Exception("file.missing", - new String(ffile_spec, String::L_TAINTED), - "stylesheet failed to load"); + throw Exception("file.missing", new String(ffile_spec, String::L_TAINTED), "stylesheet failed to load"); - xsltFreeStylesheet(fstylesheet); + xsltFreeStylesheet(fstylesheet); fstylesheet=nstylesheet; - prev_disk_time=new_disk_time; + prev_disk_time=new_disk_time; // note: 0 for the first fime, cache works only from second hit } -static void update_max_mtime(const String::Body stat_file_spec_cstr, bool /*value*/, time_t* max) { - size_t size; +static void update_max_mtime(HashStringValue::key_type stat_file_spec_cstr, bool /*value*/, time_t* max) { + uint64_t size; time_t atime, mtime, ctime; - file_stat(*new String(stat_file_spec_cstr, String::L_AS_IS), - size, - atime, mtime, ctime, - true/*exception on error*/); + file_stat(*new String(stat_file_spec_cstr, String::L_AS_IS), size, atime, mtime, ctime, true/*exception on error*/); if(mtime>*max) *max=mtime; @@ -53,6 +48,8 @@ time_t Stylesheet_connection::get_disk_t assert(dependencies); time_t result=0; - dependencies->for_each(update_max_mtime, &result); + dependencies->for_each(update_max_mtime, &result); return result; } + +#endif