Standard_C_Date_Time_Library

所属分类:书籍源码
开发工具:C/C++
文件大小:2162KB
下载次数:5
上传日期:2009-07-17 02:44:02
上 传 者llcllc
说明:  (C) Standard C Date/Time Library

文件列表:
Standard_C_Date_Time_Library\Cd (0, 2009-07-17)
Standard_C_Date_Time_Library\Cd\Dll (0, 2009-07-17)
Standard_C_Date_Time_Library\Cd\Dll\ARAB2ROM.C (3756, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\DAMO_EQ.C (1438, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DAT2DAYN.C (3652, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATE_EQ.C (1045, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATE_GE.C (1337, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATE_GT.C (1339, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATE_LE.C (1335, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATE_LT.C (1325, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATE_NE.C (1344, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATE2INT.C (3028, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATE2JD0.C (2655, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATE2LNG.C (1109, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DATEINFO.H (1868, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DAY_EQ.C (1192, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DAYN2DAT.C (4025, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DAYSBTWN.C (1272, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DAYSINMO.C (1080, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DAYSMOYR.C (2000, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DAYSSINC.C (1368, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DAYSUNTL.C (1370, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DOSDT2DT.C (1366, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DOSTM2TM.C (1365, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DOWABBR.C (1992, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\DOWINDEX.C (1730, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DOWINDXJ.C (1502, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DOWNAME.C (1856, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\DT2DOSDT.C (1571, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DTNDAYAF.C (1864, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DTNDAYBE.C (1844, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\DTTM2JD.C (1409, 1997-07-28)
Standard_C_Date_Time_Library\Cd\Dll\FMDTADMY.C (3356, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\FMDTAMDY.C (3365, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\FMDTAYMD.C (3354, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\FMDTMDMY.C (2523, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\FMDTNDMY.C (3970, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\FMDTNMDY.C (3968, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\FMDTNYMD.C (3972, 1997-10-25)
Standard_C_Date_Time_Library\Cd\Dll\FMTTM12.C (1544, 1997-10-25)
... ...

Contents 1. Implemented Functions 2. Source Files 3. Other Included Files 4. Function Names for Visual Basic and Delphi 5. Wrapper Functions for Visual Basic and Delphi 6. Calling SCDTL Functions from C and C++ 1. Implemented Functions in SCDTL.DLL * arabic_to_roman day_and_month_equal date_to_day_number date_to_int date_to_JD0 date_to_long date_equal date_greater_or_equal date_greater date_less_or_equal date_less date_not_equal day_equal day_number_to_date days_between_dates days_in_month days_in_month_for_year days_since_date days_until_date DOS_date_to_date DOS_time_to_time * day_of_week_abbreviation day_of_week_index day_of_week_index_JD0 * day_of_week_name date_to_DOS_date date_N_days_after_date date_N_days_before_date date_and_time_to_JD * format_date_alpha_DMY * format_date_alpha_MDY * format_date_alpha_YMD * format_date_military * format_date_numeric_DMY * format_date_numeric_MDY * format_date_numeric_YMD * format_time_12 * format_time_24 fraction_to_time ** get_system_date ** get_system_time get_system_time hours_equal hours_decimal_to_time int_to_date int_to_time is_day_of_week JD0_to_date JD0_to_gregorian JD0_to_julian JD_date_part JD_time_part julian_leap_year long_to_date long_to_time long_mod make_date make_time minutes_equal month_equal * month_name_military * month_name month_type seconds_equal ** set_system_date ** set_system_time time_to_int time_to_long time_equal time_greater_or_equal time_greater time_less_or_equal time_less time_not_equal time_12_to_24 time_24_to_12 time_to_DOS_time time_to_fraction time_to_hours_decimal valid_date_gregorian valid_date_julian valid_time_24 year_equal year_type year_to_jan_0_JD0 * A wrapper function was created for use with Visual Basic and Delphi (see Wrapper Functions for Visual Basic and Delphi below). ** Modified to use Win32 API GetSystemDate and GetSystemTime instead of DOS interrupt. 2. Source Files Modified source files setsdate.c use Win32 API functions instead of DOS interrupt setstime.c use Win32 API functions instead of DOS interrupt getsdate.c use Win32 API functions instead of DOS interrupt getstime.c use Win32 API functions instead of DOS interrupt arab2rom.c create wrapper function to return length of string so function is callable from Visual Basic and Delphi (* see Wrapper functions) dowabbr.c create wrapper function (see arab2rom.c) downame.c create wrapper function (see arab2rom.c) fmdtamdy.c create wrapper function (see arab2rom.c) fmdtaymd.c create wrapper function (see arab2rom.c) fmdtndmy.c create wrapper function (see arab2rom.c) fmdtmdmy.c create wrapper function (see arab2rom.c) fmdtnmdy.c create wrapper function (see arab2rom.c) fmdtnymd.c create wrapper function (see arab2rom.c) fmdtadmy.c create wrapper function (see arab2rom.c) fmttm24.c create wrapper function (see arab2rom.c) fmttm12.c create wrapper function (see arab2rom.c) monthmil.c create wrapper function (see arab2rom.c) monthnam.c create wrapper function (see arab2rom.c) scdtl_1.h Added #include to get definitions for WINAPI scdtl_2.h Added WINAPI to function headers for stdcall calling convention scdtl_3.h Added WINAPI to function headers for stdcall calling convention scdtl_5.h Added WINAPI to function headers for stdcall calling convention scdtl_7.h Added WINAPI to function headers for stdcall calling convention 3. Other Included Files scdtl.mdp Microsoft Visual C++ project file scdtl.lib C link library scdtl.dll Win32 Release DLL (statically linked to C runtime library) scdtld.dll Win32 Debug DLL (statically linked to C runtime library) scdtl.bas Microsoft Visual Basic module containing function declarations for SCDTL.DLL scdtl.pas Delphi module containing function declarations for SCDTL.DLL 4. Function Names for Visual Basic and Delphi The names of the functions have been changed in the BASIC module to be more like Visual Basic names. For example: Declare Function ArabicToRoman Lib "SCDTL" & _ Alias "arabic_to_roman_2" (ByVal n As Long, ByVal s As String) As Long The C function 'arabic_to_roman' is referenced as 'ArabicToRoman' in Visual Basic. See SCTDL for the Visual Basic function declarations. The function calls were tested with Visual Basic 5. The same naming convention was used for Delphi. See SCDTL.PAS for the Delphi function declarations. The function calls were tested with Delphi Version 2.0. 5. Wrapper Functions for Visual Basic and Delphi Certain functions did not make themselves easily callable from Visual Basic and Delphi. Rather than change the original function, a wrapper function was created. An example is month_name (referenced as MonthName from VB and Delphi). The C prototype for month_name is: char *month_name (int month_index); A wrapper was created so that a string was a parameter instead of a return value: int month_name_2 (int month_index, char *name); The return value is the length of the returned string. The Visual Basic and Delph declarations reference the month_name_2 function: Declare Function MonthName_2 Lib "SCDTL" & _ Alias "month_name_2" & _ (ByVal month_index As Long, ByVal month_name As String) As Long and have the following wrapper function return the month name string: Public Function MonthName(month_index As Long) As String Dim s As String s = String(10, vbNullChar) ' max of 10 chars including null terminator l = MonthName_2(month_index, s) s = Left(s, l) MonthName = s End Function The user of the function simply needs to call this function as described in the text: Dim monthName As String monthName = MonthName( MONTH_JANUARY ) 6. Calling SCDTL Functions from C and C++ The stdcall calling convention was used for the SCDTL DLL functions. The function prototypes have been modified to use the WINAPI calling convention. For example, the text describes the function month_name in the header file scdtl_2.h: extern char *month_name (int month_index); This has been changed to: extern char * WINAPI month_name (int month_index); to set the calling convention for the function. To use SCDTL.DLL simply include the appropriate header files (scdtl_1.h, etc.) in your source files and link to SCDTL.LIB. Microsoft Visual C++ 4.0 was used to create the DLL and LIB files. The SCDTL DLL was statically linked with the multithreaded runtime library.

近期下载者

相关文件


收藏者