WNL.H
上传用户:weike0160
上传日期:2007-05-31
资源大小:5k
文件大小:4k
源码类别:

压缩解压

开发平台:

C/C++

  1.   
  2.   /*天干,地支,属象,农历月份名,农历日期名,阳历每月的天数*/
  3.   unsigned char TianGanName[][3]={"甲","乙","丙",",丁","戊","已","庚","辛","壬","癸"};
  4.   unsigned char DiZhiName[][3]={"子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"};
  5.   unsigned char ShuXingName[][3]={"鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"};
  6.   unsigned char nl_MonthName[][7]={"  ",
  7.                                   "正月","二月","三月","四月","五月","六月","七月","八月","九月",
  8.                                   "十月","十一月","十二月"};
  9.   unsigned char nl_DayName[][5]={"  ",
  10.                               "初一","初二","初三","初四","初五","初六","初七","初八","初九","初十",
  11.                               "十一","十二","十三","十四","十五","十六","十七","十八","十九","二十",
  12.                               "廿一","廿二","廿三","廿四","廿五","廿六","廿七","廿八","廿九","三十"};
  13.   int yl_MonthDays[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
  14.   /******************************************************
  15.   1900 to 1909年的农历数据
  16.   日期数据定义方法如下
  17.   前12个字节代表1-12月为大月或是小月,1为大月30天,0为小月29天,
  18.   第13位为闰月的情况,1为大月30天,0为小月29天,第14位为闰月的月
  19.   份,如果不是闰月为0,否则给出月份,10、11、12分别用A、B、C来表
  20.   示,即使用16进制。最后4位为当年家农历新年-即农历1月1日所在公历
  21.   的日期,如0131代表1月31日。
  22.   *******************************************************/
  23.   unsigned char daList[][18] ={
  24.   "010010110110180131","010010101110000219","101001010111000208","010100100110150129","110100100110000216",
  25.   "110110010101000204","011010101010140125","010101101010000213","100110101101000202","010010101110120122",
  26.   "010010101110000210","101001001101160130","101001001101000218","110100100101000206","110101010100150126",
  27.   "101101010101000214","010101101010000204","100101101101020123","100101011011000211","010010011011170201",
  28.   "010010011011000220","101001001011000208","101100100101150128","011010100101000216","011011010100000205",
  29.   "101011011010140124","001010110110000213","100101010111000202","010010010111120123","010010010111000210",
  30.   "011001001011060130","110101001010000217","111010100101000206","011011010100150126","010110101101000214",
  31.   "001010110110000204","100100110111030124","100100101110000211","110010010110170131","110010010101000219",
  32.   "110101001010000208","110110100101060127","101101010101000215","010101101010000205","101010101101140125",
  33.   "001001011101000213","100100101101000202","110010010101120122","101010010101000210","101101001010170129",
  34.   "011011001010000217","101101010101000206","010101011010150127","010011011010000214","101001011011000203",
  35.   "010100101011130124","010100101011000212","101010010101080131","111010010101000218","011010101010000208",
  36.   "101011010101060128","101010110101000215","010010110110000205","101001010111040125","101001010111000213",
  37.   "010100100110000202","111010010011030121","110110010101000209","010110101010170130","010101101010000217",
  38.   "100101101101000206","010010101110150127","010010101101000215","101001001101000203","110100100110140123",
  39.   "110100100101000211","110101010010180131","101101010100000218","101101011010000207","100101101101060128",
  40.   "100101011011000216","010010011011000205","101001001011140125","101001001011000213","1011001001011A0202",
  41.   "011010100101000220","011011010100000209","101011011010060129","101010110110000217","100100110111000206",
  42.   "010010010111150127","010010010111000215","011001001011000204","011010100101030123","111010100101000210",
  43.   "011010110010180131","010110101100000219","101010110110000207","100100110110150128","100100101110000216",
  44.   "110010010110000205","110101001010140124","110101001010000212","110110100101000201","010110101010120122",
  45.   "010101101010000209","101010101101170129","001001011101000218","100100101101000207","110010010101150126",
  46.   "101010010101000214","101101001010000214",
  47.         };
  48.                 
  49.   typedef struct _tagMyDate 
  50.   {
  51.    int iYear;
  52.    int iMonth;
  53.    int iDay;
  54.    int iMonthDayNum; /*本月天数,只有农历本字段才有用*/
  55.    int iMonthIsRun;  /*如果所给的日期为润月,则该值为1,否则为0,只有农历本字段才有用*/
  56.   }MYDATE;
  57.                 
  58. void GetOfNongLiDate(MYDATE *nlDate,MYDATE ylDate);
  59. void printfDay(int iStartWeekDay,MYDATE structYlDate,
  60.                MYDATE structNlDate);
  61. int  GetWeek(MYDATE structYlDate);
  62. void printfWeekName(); 
  63. int  GetSepDayNum(MYDATE structYlDate0 ,
  64.                   MYDATE structYlDate1 );              
  65. void GetMonthInfo(MYDATE *structMonthInfo,MYDATE preMonthInfo);