Back to index

php5  5.3.10
Defines | Functions | Variables
french.c File Reference
#include "sdncal.h"

Go to the source code of this file.

Defines

#define FRENCH_SDN_OFFSET   2375474
#define DAYS_PER_4_YEARS   1461
#define DAYS_PER_MONTH   30
#define FIRST_VALID   2375840
#define LAST_VALID   2380952

Functions

void SdnToFrench (long int sdn, int *pYear, int *pMonth, int *pDay)
long int FrenchToSdn (int year, int month, int day)

Variables

char * FrenchMonthName [14]

Define Documentation

#define DAYS_PER_4_YEARS   1461

Definition at line 90 of file french.c.

#define DAYS_PER_MONTH   30

Definition at line 91 of file french.c.

#define FIRST_VALID   2375840

Definition at line 92 of file french.c.

#define FRENCH_SDN_OFFSET   2375474

Definition at line 89 of file french.c.

#define LAST_VALID   2380952

Definition at line 93 of file french.c.


Function Documentation

long int FrenchToSdn ( int  year,
int  month,
int  day 
)

Definition at line 117 of file french.c.

{
       /* check for invalid dates */
       if (year < 1 || year > 14 ||
              month < 1 || month > 13 ||
              day < 1 || day > 30) {
              return (0);
       }
       return ((year * DAYS_PER_4_YEARS) / 4
                     + (month - 1) * DAYS_PER_MONTH
                     + day
                     + FRENCH_SDN_OFFSET);
}

Here is the caller graph for this function:

void SdnToFrench ( long int  sdn,
int pYear,
int pMonth,
int pDay 
)

Definition at line 95 of file french.c.

{
       long int temp;
       int dayOfYear;

       if (sdn < FIRST_VALID || sdn > LAST_VALID) {
              *pYear = 0;
              *pMonth = 0;
              *pDay = 0;
              return;
       }
       temp = (sdn - FRENCH_SDN_OFFSET) * 4 - 1;
       *pYear = temp / DAYS_PER_4_YEARS;
       dayOfYear = (temp % DAYS_PER_4_YEARS) / 4;
       *pMonth = dayOfYear / DAYS_PER_MONTH + 1;
       *pDay = dayOfYear % DAYS_PER_MONTH + 1;
}

Here is the caller graph for this function:


Variable Documentation

char* FrenchMonthName[14]
Initial value:
{
       "",
       "Vendemiaire",
       "Brumaire",
       "Frimaire",
       "Nivose",
       "Pluviose",
       "Ventose",
       "Germinal",
       "Floreal",
       "Prairial",
       "Messidor",
       "Thermidor",
       "Fructidor",
       "Extra"
}

Definition at line 134 of file french.c.