[RavenclawDev 330] [2002] Agents/DateTime4: 1) ignore build dirs
tk@edam.speech.cs.cmu.edu
tk at edam.speech.cs.cmu.edu
Fri Aug 17 19:03:41 EDT 2007
An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070817/071e35a2/attachment.html
-------------- next part --------------
Property changes on: Agents/DateTime4
___________________________________________________________________
Name: svn:ignore
+ Release
Debug
*.user
Modified: Agents/DateTime4/DateTime4.vcproj
===================================================================
--- Agents/DateTime4/DateTime4.vcproj 2007-08-17 14:22:32 UTC (rev 2001)
+++ Agents/DateTime4/DateTime4.vcproj 2007-08-17 23:03:41 UTC (rev 2002)
@@ -1,138 +1,200 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="7.10"
+ Version="8.00"
Name="DateTime4"
- SccProjectName=""$/CommonAgents/DateTime4", YLCBAAAA"
- SccAuxPath=""
- SccLocalPath="."
- SccProvider="MSSCCI:Microsoft Visual SourceSafe"
- Keyword="MFCProj">
+ ProjectGUID="{C496CC03-49A2-4B53-A405-942C0664239E}"
+ RootNamespace="DateTime4"
+ Keyword="MFCProj"
+ >
<Platforms>
<Platform
- Name="Win32"/>
+ Name="Win32"
+ />
</Platforms>
+ <ToolFiles>
+ </ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="2"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
<Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/DateTime4.tlb"
+ />
+ <Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\Libraries\Galaxy\include,..\..\Libraries\Galaxy\contrib\MITRE\utilities\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- StringPooling="TRUE"
+ StringPooling="true"
RuntimeLibrary="2"
- EnableFunctionLevelLinking="TRUE"
- UsePrecompiledHeader="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/DateTime4.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
<Tool
- Name="VCCustomBuildTool"/>
+ Name="VCManagedResourceCompilerTool"
+ />
<Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_AFXDLL;NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="wsock32.lib ..\..\Libraries\Galaxy\lib\x86-nt\libgalaxy.lib"
OutputFile=".\Release/DateTime4.exe"
LinkIncremental="1"
- SuppressStartupBanner="TRUE"
+ SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/DateTime4.pdb"
- SubSystem="1"/>
+ SubSystem="1"
+ />
<Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Release/DateTime4.tlb"/>
+ Name="VCALinkTool"
+ />
<Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy $(TARGETPATH) ..\..\bin\x86-nt\$(TARGETNAME).exe"/>
+ Name="VCManifestTool"
+ />
<Tool
- Name="VCPreBuildEventTool"/>
+ Name="VCXDCMakeTool"
+ />
<Tool
- Name="VCPreLinkEventTool"/>
+ Name="VCBscMakeTool"
+ />
<Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_AFXDLL;NDEBUG"
- Culture="1033"/>
+ Name="VCFxCopTool"
+ />
<Tool
- Name="VCWebServiceProxyGeneratorTool"/>
+ Name="VCAppVerifierTool"
+ />
<Tool
- Name="VCXMLDataGeneratorTool"/>
+ Name="VCWebDeploymentTool"
+ />
<Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ Name="VCPostBuildEventTool"
+ CommandLine="copy $(TARGETPATH) ..\..\bin\x86-nt\$(TARGETNAME).exe"
+ />
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="2"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
<Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/DateTime4.tlb"
+ />
+ <Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\Libraries\Galaxy\include,..\..\Libraries\Galaxy\contrib\MITRE\utilities\include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="2"
- UsePrecompiledHeader="2"
+ UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/DateTime4.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
- SuppressStartupBanner="TRUE"
+ SuppressStartupBanner="true"
DebugInformationFormat="4"
- CompileAs="0"/>
+ CompileAs="0"
+ />
<Tool
- Name="VCCustomBuildTool"/>
+ Name="VCManagedResourceCompilerTool"
+ />
<Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_AFXDLL;_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="ws2_32.lib ../../Libraries/galaxy/lib/x86-nt/libGalaxy_debug.lib"
OutputFile=".\Debug/DateTime4.exe"
LinkIncremental="2"
- SuppressStartupBanner="TRUE"
- GenerateDebugInformation="TRUE"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/DateTime4.pdb"
- SubSystem="1"/>
+ SubSystem="1"
+ />
<Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Debug/DateTime4.tlb"/>
+ Name="VCALinkTool"
+ />
<Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy $(TARGETPATH) ..\..\bin\x86-nt\$(TARGETNAME)-DEBUG.exe"/>
+ Name="VCManifestTool"
+ />
<Tool
- Name="VCPreBuildEventTool"/>
+ Name="VCXDCMakeTool"
+ />
<Tool
- Name="VCPreLinkEventTool"/>
+ Name="VCBscMakeTool"
+ />
<Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_AFXDLL;_DEBUG"
- Culture="1033"/>
+ Name="VCFxCopTool"
+ />
<Tool
- Name="VCWebServiceProxyGeneratorTool"/>
+ Name="VCAppVerifierTool"
+ />
<Tool
- Name="VCXMLDataGeneratorTool"/>
+ Name="VCWebDeploymentTool"
+ />
<Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ Name="VCPostBuildEventTool"
+ CommandLine="copy $(TARGETPATH) ..\..\bin\x86-nt\$(TARGETNAME)-DEBUG.exe"
+ />
</Configuration>
</Configurations>
<References>
@@ -140,48 +202,62 @@
<Files>
<Filter
Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
<File
- RelativePath=".\dates.c">
+ RelativePath=".\dates.c"
+ >
</File>
<File
- RelativePath=".\gal_dt.c">
+ RelativePath=".\gal_dt.c"
+ >
</File>
<File
- RelativePath=".\numparse_l.c">
+ RelativePath=".\numparse_l.c"
+ >
</File>
<File
- RelativePath=".\numparse_y.c">
+ RelativePath=".\numparse_y.c"
+ >
</File>
<File
- RelativePath=".\parse_date_time.c">
+ RelativePath=".\parse_date_time.c"
+ >
</File>
<File
- RelativePath=".\parse_int.c">
+ RelativePath=".\parse_int.c"
+ >
</File>
<File
- RelativePath=".\parse_net.c">
+ RelativePath=".\parse_net.c"
+ >
</File>
<File
- RelativePath=".\parse_time_range.c">
+ RelativePath=".\parse_time_range.c"
+ >
</File>
</Filter>
<Filter
Name="Header Files"
- Filter="h;hpp;hxx;hm;inl">
+ Filter="h;hpp;hxx;hm;inl"
+ >
<File
- RelativePath=".\datetime_server.h">
+ RelativePath=".\datetime_server.h"
+ >
</File>
<File
- RelativePath=".\numparse_y.h">
+ RelativePath=".\numparse_y.h"
+ >
</File>
<File
- RelativePath=".\parse_date_time.h">
+ RelativePath=".\parse_date_time.h"
+ >
</File>
</Filter>
<Filter
Name="Resource Files"
- Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
</Filter>
</Files>
<Globals>
Modified: Agents/DateTime4/gal_dt.c
===================================================================
--- Agents/DateTime4/gal_dt.c 2007-08-17 14:22:32 UTC (rev 2001)
+++ Agents/DateTime4/gal_dt.c 2007-08-17 23:03:41 UTC (rev 2002)
@@ -40,7 +40,7 @@
if (!GalUtil_OACheckUsage(argc, argv, OAS, &i))
exit(1);
- if (DEBUG) { debug = fopen("dttime.debug","w"); fprintf(debug,"logging dt\n"); fclose(debug); }
+ if (DEBUG) { fopen_s(&debug, "dttime.debug","w"); fprintf(debug,"logging dt\n"); fclose(debug); }
return (void *) s;
}
@@ -48,7 +48,7 @@
Gal_Frame fr_ParseTimeRange (Gal_Frame f, void *server_data)
{
int s,e,tn,d,tp,ds;
- char temp[1024];
+ char temp[MAX_PARSE_DATE_TIME_STRING];
Gal_Frame subtreef;
if ((subtreef = Gal_GetFrame(f, ":subtree"))) {
@@ -58,7 +58,7 @@
Gal_PPFrame(f);
- debug = fopen("dttime.debug","a");
+ fopen_s(&debug, "dttime.debug","a");
Gal_PPFrameToFile(f, debug);
fprintf(debug,"\n");
fclose(debug);
@@ -99,7 +99,7 @@
Gal_PPFrame(f);
- debug = fopen("dttime.debug","a");
+ fopen_s(&debug, "dttime.debug","a");
Gal_PPFrameToFile(f, debug);
fprintf(debug,"\n");
fclose(debug);
@@ -110,15 +110,15 @@
Gal_Frame SetRefDate (Gal_Frame f, void *server_data)
{
int refdate;
- char x[1024];
+ char x[MAX_PARSE_DATE_TIME_STRING];
printf("\n\nSETTING REFERENCE DATE\n\n");
if (Gal_GetObject(f, ":refdate")) {
refdate = Gal_GetInt(f,":refdate");
frame_set_ref_date(refdate);
- sprintf(x,"Set ref date: %d\n",refdate);
- GalUtil_Print(-1,x);
+ sprintf_s(x, MAX_PARSE_DATE_TIME_STRING, "Set ref date: %d\n",refdate);
+ GalUtil_Print(-1,x);
}
return f;
@@ -167,7 +167,7 @@
int i;
int numnets = Gal_GetInt(f, ":numnets"); /* pcc what does this return if key dne */
int s, e, tn, d, tp, ds;
- char temp[1024];
+ char temp[MAX_PARSE_DATE_TIME_STRING];
Gal_Frame netf;
Gal_Object *list;
@@ -265,14 +265,13 @@
Gal_Frame ParseInt(Gal_Frame f, void *server_data)
{
char buffer[4096];
- char *token;
int intValue;
- strcpy(buffer, Gal_GetString(f, ":number_string"));
- strupr(buffer);
+ strcpy_s(buffer, 4096, Gal_GetString(f, ":number_string"));
+ _strupr_s(buffer, 4096);
parse_number(buffer, &intValue);
- sprintf(buffer, "%d", intValue);
+ sprintf_s(buffer, 4096, "%d", intValue);
Gal_SetProp(f, ":number_int", Gal_StringObject(buffer));
return f;
@@ -302,10 +301,10 @@
int month = Gal_GetInt(f, ":month");
int year = Gal_GetInt(f, ":year");
long int compacted;
- char lpszcompacted[1024];
+ char lpszcompacted[MAX_PARSE_DATE_TIME_STRING];
- { char x[1024];
- sprintf(x,"day: %d month: %d year: %d\n",day,month,year);
+ { char x[MAX_PARSE_DATE_TIME_STRING];
+ sprintf_s(x, MAX_PARSE_DATE_TIME_STRING, "day: %d month: %d year: %d\n",day,month,year);
GalUtil_Print(-1,x);
}
@@ -322,12 +321,12 @@
compacted += 19000000;
}
- sprintf(lpszcompacted, "%d", compacted);
+ sprintf_s(lpszcompacted, MAX_PARSE_DATE_TIME_STRING, "%d", compacted);
Gal_SetProp(f, ":compacted", Gal_StringObject(lpszcompacted));
- { char x[1024];
- sprintf(x,"compacted: %ld\n",compacted);
+ { char x[MAX_PARSE_DATE_TIME_STRING];
+ sprintf_s(x, MAX_PARSE_DATE_TIME_STRING, "compacted: %ld\n",compacted);
GalUtil_Print(-1,x);
}
Modified: Agents/DateTime4/parse_date_time.c
===================================================================
--- Agents/DateTime4/parse_date_time.c 2007-08-17 14:22:32 UTC (rev 2001)
+++ Agents/DateTime4/parse_date_time.c 2007-08-17 23:03:41 UTC (rev 2002)
@@ -86,10 +86,10 @@
ref_date_available = 0;
}
-static char dtbuf[1024];
+static char dtbuf[MAX_PARSE_DATE_TIME_STRING];
static char *format_date(DateTime *dt) {
dtbuf[0]='\0';
- sprintf(dtbuf,"year:%d month:%d day:%d dow:%d\n",
+ sprintf_s(dtbuf, MAX_PARSE_DATE_TIME_STRING, "year:%d month:%d day:%d dow:%d\n",
dt->year,dt->month,dt->day,dt->dow);
return &dtbuf[0];
}
@@ -279,7 +279,7 @@
static int today_relative;
static int holiday;
static int t_start, t_end, t_now, t_duration, dayskip;
-static char t_timeperiod_spec[1024];
+static char t_timeperiod_spec[MAX_PARSE_DATE_TIME_STRING];
static int day_ordinal;
static int month_explicit;
static int year_explicit;
@@ -463,8 +463,8 @@
int ddiff;
time_t tNow;
- struct tm *ptmNow;
- char temp[1024];
+ struct tm ptmNow;
+ char temp[MAX_PARSE_DATE_TIME_STRING];
next_week = 0;
next_month = 0;
@@ -477,14 +477,14 @@
this_week = 0;
tNow = time(NULL);
- ptmNow = localtime(&tNow);
+ localtime_s(&ptmNow, &tNow);
- today.year = ptmNow->tm_year + 1900;
- today.month = ptmNow->tm_mon + 1;
- today.day = ptmNow->tm_mday;
- today.dow = ptmNow->tm_wday;
- today.start_time = ptmNow->tm_hour * 100 + ptmNow->tm_min;
- today.end_time = ptmNow->tm_hour * 100 + ptmNow->tm_min;
+ today.year = ptmNow.tm_year + 1900;
+ today.month = ptmNow.tm_mon + 1;
+ today.day = ptmNow.tm_mday;
+ today.dow = ptmNow.tm_wday;
+ today.start_time = ptmNow.tm_hour * 100 + ptmNow.tm_min;
+ today.end_time = ptmNow.tm_hour * 100 + ptmNow.tm_min;
if ( ! ref_date_available) {
GalUtil_Print(-1, "Ref date not available; setting to today\n");
@@ -531,7 +531,7 @@
if(t_end != -1)
dt.end_time = t_end;
dt.dayskip = dayskip;
- strcpy(dt.period_spec, t_timeperiod_spec);
+ strcpy_s(dt.period_spec, MAX_PARSE_DATE_TIME_STRING, t_timeperiod_spec);
}
@@ -595,7 +595,7 @@
(dt2.year != dt.year)) {
// if there is a difference, declare this an ambiguous date
dt.ambiguous = 1;
- sprintf(dt.date_choice, "%d,%d",
+ sprintf_s(dt.date_choice, MAX_DATE_CHOICE_STRING, "%d,%d",
compact_date(dt2.year, dt2.month, dt2.day),
compact_date(dt.year, dt.month, dt.day));
}
@@ -645,13 +645,13 @@
firstdate.year = ref_date.year;
firstdate.month = ref_date.month;
firstdate.day = ref_date.day;
- sprintf(dt.date_choice, "%d,",
+ sprintf_s(dt.date_choice, MAX_DATE_CHOICE_STRING, "%d,",
compact_date(firstdate.year, firstdate.month, firstdate.day));
if( dif < 0 ) dif += 7;
if( (date_relative < 0) && ! day_after ) dif -= 7;
else dif += day_after;
date_inc(&firstdate, dif);
- sprintf(dt.date_choice, "%s%d", dt.date_choice,
+ sprintf_s(dt.date_choice, MAX_DATE_CHOICE_STRING, "%s%d", dt.date_choice,
compact_date(firstdate.year, firstdate.month, firstdate.day));
}
}
@@ -660,10 +660,10 @@
firstdate.year = ref_date.year;
firstdate.month = ref_date.month;
firstdate.day = ref_date.day;
- sprintf(dt.date_choice, "%d,",
+ sprintf_s(dt.date_choice, MAX_DATE_CHOICE_STRING, "%d,",
compact_date(firstdate.year, firstdate.month, firstdate.day));
date_inc(&firstdate, 7);
- sprintf(dt.date_choice, "%s%d", dt.date_choice,
+ sprintf_s(dt.date_choice, MAX_DATE_CHOICE_STRING, "%s%d", dt.date_choice,
compact_date(firstdate.year, firstdate.month, firstdate.day));
}
else {
@@ -688,10 +688,10 @@
if (compact_date(firstdate.year, firstdate.month, firstdate.day) >
compact_date(today.year, today.month, today.day)) {
dt.ambiguous = 1;
- sprintf(dt.date_choice, "%d,",
+ sprintf_s(dt.date_choice, MAX_DATE_CHOICE_STRING, "%d,",
compact_date(firstdate.year, firstdate.month, firstdate.day));
date_inc(&firstdate, 7);
- sprintf(dt.date_choice, "%s%d", dt.date_choice,
+ sprintf_s(dt.date_choice, MAX_DATE_CHOICE_STRING, "%s%d", dt.date_choice,
compact_date(firstdate.year, firstdate.month, firstdate.day));
} else {
// no ambiguity because previous date falls before today
@@ -871,18 +871,18 @@
dt.end_time -= 2400;
} else dt.end_time = 2359;
}
- sprintf(temp, "%d", dt.start_time);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", dt.start_time);
Gal_SetProp(datef, cSTART_TIME, Gal_StringObject(temp));
- sprintf(temp, "%d", dt.end_time);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", dt.end_time);
Gal_SetProp(datef, cEND_TIME, Gal_StringObject(temp));
- sprintf(temp, "%d", dt.dayskip);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", dt.dayskip);
Gal_SetProp(datef, cDAY_SKIP, Gal_StringObject(temp));
Gal_SetProp(datef, cTIMEPERIOD_SPEC, Gal_StringObject(dt.period_spec));
Gal_SetProp(datef, cVALID_TIME, Gal_StringObject(cTRUE));
}
if((dt.duration != -1) && (dt.duration != 0)) {
- sprintf(temp, "%d", dt.duration);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", dt.duration);
Gal_SetProp(datef, cDURATION, Gal_StringObject(temp));
}
@@ -895,13 +895,13 @@
}
else
{
- sprintf(temp, "%d", dt.month);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", dt.month);
Gal_SetProp(datef, cMONTH, Gal_StringObject(temp));
- sprintf(temp, "%d", dt.day);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", dt.day);
Gal_SetProp(datef, cDAY, Gal_StringObject(temp));
- sprintf(temp, "%d", dt.year);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", dt.year);
Gal_SetProp(datef, cYEAR, Gal_StringObject(temp));
- sprintf(temp, "%d", dt.dow);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", dt.dow);
Gal_SetProp(datef, cWEEKDAY, Gal_StringObject(temp));
Gal_SetProp(datef, cVALID_DATE, Gal_StringObject(szTemp));
Modified: Agents/DateTime4/parse_date_time.h
===================================================================
--- Agents/DateTime4/parse_date_time.h 2007-08-17 14:22:32 UTC (rev 2001)
+++ Agents/DateTime4/parse_date_time.h 2007-08-17 23:03:41 UTC (rev 2002)
@@ -3,6 +3,8 @@
#ifndef _PDT
#define _PDT
+#define MAX_PARSE_DATE_TIME_STRING 1024
+#define MAX_DATE_CHOICE_STRING 20
typedef struct date_time {
int month;
@@ -19,8 +21,8 @@
int need_date; /* user still needs to specify a date realtive to date */
int ambiguous;
- char date_choice[20];
- char period_spec[1024];
+ char date_choice[MAX_DATE_CHOICE_STRING];
+ char period_spec[MAX_PARSE_DATE_TIME_STRING];
} DateTime;
typedef struct holiday_list {
@@ -121,6 +123,8 @@
void clear_ref_date();
+int frame_set_ref_date (int refdate);
+
#endif // _PDT
Modified: Agents/DateTime4/parse_time_range.c
===================================================================
--- Agents/DateTime4/parse_time_range.c 2007-08-17 14:22:32 UTC (rev 2001)
+++ Agents/DateTime4/parse_time_range.c 2007-08-17 23:03:41 UTC (rev 2002)
@@ -152,11 +152,11 @@
period[0]= 0;
if( hm->period_mod[0] ) {
- strcpy(period, hm->period_mod);
- strcat(period, " ");
+ strcpy_s(period, 128, hm->period_mod);
+ strcat_s(period, 128, " ");
}
/* check for bare qualifiers... */
- strcat(period, (hm->period_base) ? hm->period_base : "day");
+ strcat_s(period, 128, (hm->period_base) ? hm->period_base : "day");
i= find_period(period);
if( i < 0 ) return(-1); /* missing from table... */
return (i);
@@ -320,8 +320,8 @@
Gal_Frame netf;
Gal_Frame timef;
int numnets = Gal_GetInt(tree, ":numnets"); /* pcc what does this return if key dne */
- char temp[1024];
- char period_spec[1024] = "";
+ char temp[MAX_PARSE_DATE_TIME_STRING];
+ char period_spec[MAX_PARSE_DATE_TIME_STRING] = "";
relative_min= 0;
before_after=0;
@@ -379,7 +379,7 @@
// (user said sthg like "now")
period_spec[0]= 0;
if (*time_now) {
- strcat(period_spec, "now ");
+ strcat_s(period_spec, MAX_PARSE_DATE_TIME_STRING, "now ");
}
// [2005-07-26] (dbohus): deleted this since it lead to multiplication of
// the timeperiod_spec - i don't know how this happened, hopefully this fixes all
@@ -404,8 +404,8 @@
// (dbohus): time is constructed from period, so construct the period_spec
// specifier
if( at_hm.period_mod[0] ) {
- strcpy(period_spec, at_hm.period_mod);
- strcat(period_spec, " ");
+ strcpy_s(period_spec, MAX_PARSE_DATE_TIME_STRING, at_hm.period_mod);
+ strcat_s(period_spec, MAX_PARSE_DATE_TIME_STRING, " ");
}
// [2006-08-21] (antoine): moved this outside of this if since the period_base
// should appear in the output frame whenever it is pegged by the user
@@ -426,7 +426,7 @@
}
/* check for bare qualifiers... */
- strcat(period_spec, (at_hm.period_base) ? at_hm.period_base : "day");
+ strcat_s(period_spec, MAX_PARSE_DATE_TIME_STRING, (at_hm.period_base) ? at_hm.period_base : "day");
}
/* for at_ times, absorb dangling before/after nets ("after ten" "before five") */
@@ -540,20 +540,20 @@
if ( (*start == -1) && (*end == -1) ) {
Gal_SetProp(timef, cVALID_TIME, Gal_StringObject(cFALSE));
} else {
- sprintf(temp, "%d", *start);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", *start);
Gal_SetProp(timef, cSTART_TIME, Gal_StringObject(temp));
- sprintf(temp, "%d", *end);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", *end);
Gal_SetProp(timef, cEND_TIME, Gal_StringObject(temp));
- sprintf(temp, "%d", *dayskip);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", *dayskip);
Gal_SetProp(timef, cDAY_SKIP, Gal_StringObject(temp));
Gal_SetProp(timef, cVALID_TIME, Gal_StringObject(cTRUE));
}
if ( (*duration != -1) && (*duration != 0) ) {
- sprintf(temp, "%d", *duration);
+ sprintf_s(temp, MAX_PARSE_DATE_TIME_STRING, "%d", *duration);
Gal_SetProp(timef, cDURATION, Gal_StringObject(temp));
}
Gal_SetProp(timef, cTIMEPERIOD_SPEC, Gal_StringObject(period_spec));
- strcpy(timeperiod_spec, period_spec);
+ strcpy_s(timeperiod_spec, MAX_PARSE_DATE_TIME_STRING, period_spec);
Gal_SetProp(tree, ":value", Gal_FrameObject(timef));
return (1); /* a time was found, and was parsable */
More information about the Ravenclaw-developers
mailing list