Back to index

citadel  8.12
Functions
parsedate.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

time_t parsedate (const char *)

Function Documentation

time_t parsedate ( const char *  )

Definition at line 2496 of file parsedate.c.

{
    extern int              date_parse(void);
    time_t           Start;

    yyInput = p; /* well, its supposed to be const... */

    yyYear = 0;
    yyMonth = 0;
    yyDay = 0;
    yyTimezone = 0;
    yyDSTmode = DSTmaybe;
    yyHour = 0;
    yyMinutes = 0;
    yySeconds = 0;
    yyMeridian = MER24;
    yyRelSeconds = 0;
    yyRelMonth = 0;
    yyHaveDate = 0;
    yyHaveRel = 0;
    yyHaveTime = 0;

    if (date_parse() || yyHaveTime > 1 || yyHaveDate > 1)
       return -1;

    if (yyHaveDate || yyHaveTime) {
       Start = Convert(yyMonth, yyDay, yyYear, yyHour, yyMinutes, yySeconds,
                  yyMeridian, yyDSTmode);
       if (Start < 0)
           return -1;
    }
    else
       return -1;

    Start += yyRelSeconds;
    if (yyRelMonth)
       Start += RelativeMonth(Start, yyRelMonth);

    /* Have to do *something* with a legitimate -1 so it's distinguishable
     * from the error return value.  (Alternately could set errno on error.) */
    return Start == -1 ? 0 : Start;
}

Here is the call graph for this function:

Here is the caller graph for this function: