/* * This file is a part of Winix * and is not publicly distributed * * Copyright (c) 2010, Tomasz Sowa * All rights reserved. * */ #include "../core/data.h" #include "../core/misc.h" #include "../core/request.h" #include "templates.h" #include "misc.h" namespace TemplatesFunctions { void print_date_nice(Ezc::Info & i, const tm * ptm) { tm tm_temp(*ptm); time_t t = mktime(&tm_temp); // mktime do something in tm_temp time_t now = time(0); time_t one_day = 60 * 60 * 24; if( t + one_day > now ) i.out << DateToStr(ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec); else i.out << DateToStr(ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday); } // those functions from here are used in the second thread too void Read(Patterns & patterns, size_t pat, Locale & locale, LocaleFilter & locale_filter, const char * file, bool delete_white) { size_t i; size_t len = patterns.size(); for(i=0 ; i(i)); } } } void ClearPatterns(Patterns & patterns, size_t len) { size_t loc, pat; patterns.resize(Locale::lang_unknown); for(loc=0 ; loc < static_cast(Locale::lang_unknown) ; ++loc) { patterns[loc].resize(len); for(pat=0 ; pat