{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
EndProjectSection\r
EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_timezone", "src\mod\applications\mod_timezone\mod_timezone.2008.vcproj", "{5CA0F863-CB0F-4250-A863-A5355BDAE224}"\r
+ ProjectSection(ProjectDependencies) = postProject\r
+ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
+ EndProjectSection\r
+EndProject\r
Global\r
GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
Debug|Win32 = Debug|Win32\r
{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.ActiveCfg = Release|Win32\r
{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.Build.0 = Release|Win32\r
{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.ActiveCfg = Release|Win32\r
+ {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|Win32.Build.0 = Debug|Win32\r
+ {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|x64.ActiveCfg = Debug|Win32\r
+ {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|Win32.ActiveCfg = Release|Win32\r
+ {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|Win32.Build.0 = Release|Win32\r
+ {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|x64.ActiveCfg = Release|Win32\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
{65A6273D-FCAB-4C55-B09E-65100141A5D4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
{E3246D17-E29B-4AB5-962A-C69B0C5837BB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
+ {5CA0F863-CB0F-4250-A863-A5355BDAE224} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
{07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}\r
{A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}\r
{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}\r
#endif /* defined __GNUC__ */
#endif /* !defined lint */
#endif /* !defined GNUC_or_lint */
+#ifdef WIN32
+#define GNUC_or_lint
+#endif
#ifndef INITIALIZE
#ifdef GNUC_or_lint
character.
*/
-static const char *getzname(strp)
-register const char * strp;
+static const char *getzname(register const char *strp)
{
- register char c;
+ register char c;
while ((c = *strp) != '\0' && !is_digit(c) && c != ',' && c != '-' &&
c != '+')
Otherwise, return a pointer to the first character not part of the number.
*/
-static const char *getnum(strp, nump, min, max)
- register const char * strp;
- int * const nump;
- const int min;
- const int max;
+static const char *getnum(register const char *strp, int * const nump, const int min, const int max)
{
register char c;
register int num;
of seconds.
*/
-static const char *getsecs(strp, secsp)
- register const char * strp;
- long * const secsp;
+static const char *getsecs(register const char *strp, long * const secsp)
{
int num;
Otherwise, return a pointer to the first character not part of the time.
*/
-static const char *getoffset(strp, offsetp)
- register const char * strp;
- long * const offsetp;
+static const char *getoffset(register const char *strp, long * const offsetp)
{
register int neg = 0;
Otherwise, return a pointer to the first character not part of the rule.
*/
-static const char *getrule(strp, rulep)
- const char * strp;
- register struct rule * const rulep;
+static const char *getrule(const char *strp, register struct rule * const rulep)
{
if (*strp == 'J') {
/*
calculate the Epoch-relative time that rule takes effect.
*/
-static time_t transtime(janfirst, year, rulep, offset)
- const time_t janfirst;
- const int year;
- register const struct rule * const rulep;
- const long offset;
+static time_t transtime(const time_t janfirst, const int year, register const struct rule * const rulep, const long offset)
{
register int leapyear;
register time_t value;
appropriate.
*/
-static int tzparse(name, sp, lastditch)
- const char * name;
- register struct state * const sp;
- const int lastditch;
+static int tzparse(const char *name, register struct state * const sp, const int lastditch)
{
const char * stdname;
const char * dstname;
*/
for (i = 0; i < sp->timecnt; ++i) {
j = sp->types[i];
- sp->types[i] = sp->ttis[j].tt_isdst;
+ sp->types[i] = (unsigned char)sp->ttis[j].tt_isdst;
if (sp->ttis[j].tt_ttisgmt) {
/* No adjustment to transition time */
} else {
/* **************************************************************************
************************************************************************** */
+#if (_MSC_VER >= 1400) // VC8+\r
+#define switch_assert(expr) assert(expr);__analysis_assume( expr )\r
+#else\r
+#define switch_assert(expr) assert(expr)\r
+#endif\r
-static void timesub(timep, offset, sp, tmp)
- const time_t * const timep;
- const long offset;
- register const struct state * const sp;
- register struct tm * const tmp;
+static void timesub(const time_t * const timep, const long offset, register const struct state * const sp, register struct tm * const tmp)
{
register const struct lsinfo * lp;
register long days;
register int hit;
register int i;
- assert(timep != NULL);
- assert(sp != NULL);
- assert(tmp != NULL);
+ switch_assert(timep != NULL);
+ switch_assert(sp != NULL);
+ switch_assert(tmp != NULL);
corr = 0;
hit = 0;
break;
}
}
- days = *timep / SECSPERDAY;
+ days = (long)(*timep / SECSPERDAY);
rem = *timep % SECSPERDAY;
tmp->tm_mday = (int) (days + 1);
tmp->tm_isdst = 0;
+#ifndef WIN32
tmp->tm_gmtoff = offset;
+#endif
}
/* **************************************************************************
************************************************************************** */
-void tztime( timep, tzstring, tmp )
- const time_t * const timep;
- const char *tzstring;
- struct tm * const tmp;
+void tztime(const time_t * const timep, const char *tzstring, struct tm * const tmp )
{
struct state *tzptr,
*sp;
{
timesub( &t, ttisp->tt_gmtoff, sp, tmp);
tmp->tm_isdst = ttisp->tt_isdst;
+#ifndef WIN32
tmp->tm_zone = &sp->chars[ttisp->tt_abbrind];
+#endif
}
free(tzptr);
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9.00"\r
+ Name="mod_timezone"\r
+ ProjectGUID="{5CA0F863-CB0F-4250-A863-A5355BDAE224}"\r
+ RootNamespace="mod_timezone"\r
+ Keyword="Win32Proj"\r
+ TargetFrameworkVersion="131072"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"\r
+ UsePrecompiledHeader="0"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"\r
+ UsePrecompiledHeader="0"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <File\r
+ RelativePath=".\localtime_find.c"\r
+ >\r
+ <FileConfiguration\r
+ Name="Debug|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ DisableSpecificWarnings="6385"\r
+ />\r
+ </FileConfiguration>\r
+ <FileConfiguration\r
+ Name="Release|Win32"\r
+ >\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ DisableSpecificWarnings="6385"\r
+ />\r
+ </FileConfiguration>\r
+ </File>\r
+ <File\r
+ RelativePath=".\mod_timezone.c"\r
+ >\r
+ </File>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
and use switch_* functions for the output.
*/
-static void tm2switchtime( tm, xt )
- struct tm *tm;
-switch_time_exp_t *xt;
+static void tm2switchtime(struct tm * tm, switch_time_exp_t *xt )
{
if (!xt || !tm) {
xt->tm_wday = tm->tm_wday;
xt->tm_yday = tm->tm_yday;
xt->tm_isdst = tm->tm_isdst;
+#ifndef WIN32
xt->tm_gmtoff = tm->tm_gmtoff;
+#endif
return;
}
static switch_timezones_list_t TIMEZONES_LIST = { 0 };
static switch_event_node_t *NODE = NULL;
-const char *switch_lookup_timezone( const char *tzname )
+const char *switch_lookup_timezone( const char *tz_name )
{
char *value = NULL;
- if ( tzname && (value = switch_core_hash_find(TIMEZONES_LIST.hash, tzname))==NULL ) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timezone '%s' not found!\n", tzname);
+ if ( tz_name && (value = switch_core_hash_find(TIMEZONES_LIST.hash, tz_name))==NULL ) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timezone '%s' not found!\n", tz_name);
}
return value;
time_t timep;
char *format = NULL;
- const char *tzname;
+ const char *tz_name;
const char *tzdef;
switch_size_t retsize;
if (!switch_strlen_zero(cmd)) {
format = strchr(cmd, ' ');
- tzname = cmd;
+ tz_name = cmd;
if (format) {
*format++ = '\0';
}
- tzdef = switch_lookup_timezone( tzname );
+ tzdef = switch_lookup_timezone( tz_name );
} else {
/* We set the default timezone to GMT. */
- tzname="GMT";
+ tz_name="GMT";
tzdef="GMT";
}