Time-Format_XS

 view release on metacpan or  search on metacpan

format.c  view on Meta::CPAN

/*
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  The GPG signature in this file may be checked with 'gpg --verify format.c'. */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <locale.h>
#include <ctype.h>
#include <config.h>

#ifdef I_LANGINFO
#include <langinfo.h>
#endif

#define unless(cond)  if (!(cond))

static char _VERSION[] = "1.03";

/* format.c, version 1.03

This is part of the Time::Format_XS module.  See the .pm file for documentation.

This code is copyright (c) 2003-2009 by Eric J. Roode -- all rights reserved.

See the Changes file for change history.

*/

#define DEBUG 0
#if DEBUG
#define BUG(args)  fprintf args
#else
#define BUG(args)
#endif

#define TF_INTERNAL "Time::Format_XS internal error: "
typedef struct state_struct
{
    int year, month, day, hour, min, sec, dow;
    int micro, milli;
    char am;
    int h12;
    size_t length;
    const char *start, *fmt;
    char *out, *outptr;
    int modifying;
    int upper, lower, ucnext, lcnext;
    int quoting;
    char tzone[60];
} st_struct, *state;


/* Month and weekday names, and their abbreviations.  Populated by setup_locale. */

#ifdef HAS_NL_LANGINFO
static char *Month_Name[13];
static char *Mon_Name[13];
static char *Weekday_Name[7];
static char *Day_Name[7];

nl_item NL_MONTH_IX[13] = {  MON_1,  MON_1,   MON_2,   MON_3,   MON_4,   MON_5,   MON_6,   MON_7,   MON_8,   MON_9,   MON_10,   MON_11,   MON_12};



( run in 0.850 second using v1.01-cache-2.11-cpan-df04353d9ac )