Back to index

php5  5.3.10
Defines | Functions
print.c File Reference
#include "php.h"
#include "main/snprintf.h"
#include "file.h"
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>

Go to the source code of this file.


#define SZOF(a)   (sizeof(a) / sizeof(a[0]))


protected void file_magwarn (struct magic_set *ms, const char *f,...)
protected const char * file_fmttime (uint32_t v, int local)

Define Documentation

#define SZOF (   a)    (sizeof(a) / sizeof(a[0]))

Definition at line 49 of file print.c.

Function Documentation

protected const char* file_fmttime ( uint32_t  v,
int  local 

Definition at line 69 of file print.c.

       char *pp;
       time_t t = (time_t)v;
       struct tm *tm;

       if (local) {
              pp = ctime(&t);
       } else {
              private int daylight = 0;
              private time_t now = (time_t)0;

              if (now == (time_t)0) {
                     struct tm *tm1;
                     tm1 = localtime(&now);
                     if (tm1 == NULL)
                            return "*Invalid time*";
                     daylight = tm1->tm_isdst;
#endif /* HAVE_TM_ISDST */
#endif /* HAVE_DAYLIGHT */
              if (daylight)
                     t += 3600;
              tm = gmtime(&t);
              if (tm == NULL)
                     return "*Invalid time*";
              pp = asctime(tm);

       pp[strcspn(pp, "\n")] = '\0';
       return pp;

Here is the caller graph for this function:

protected void file_magwarn ( struct magic_set ms,
const char *  f,

Definition at line 53 of file print.c.

       va_list va;
       char *expanded_format;

       va_start(va, f);
       vasprintf(&expanded_format, f, va);
       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Warning: %s", expanded_format);


Here is the caller graph for this function: