Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

unzip-6.0/acorn/riscos.c  view on Meta::CPAN

338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
#ifdef gmtime
#  undef gmtime
#endif
 
/* Acorn's implementation of localtime() and gmtime()
 * doesn't consider the timezone offset, so we have to
 * add it before calling the library functions
 */
 
struct tm *riscos_localtime(const time_t *timer)
{
 time_t localt=*timer;
 
 localt+=SWI_Read_Timezone()/100;
 
 return localtime(&localt);
}
 
struct tm *riscos_gmtime(const time_t *timer)
{
 time_t localt=*timer;
 
 localt+=SWI_Read_Timezone()/100;
 
 return gmtime(&localt);
}

unzip-6.0/acorn/riscos.h  view on Meta::CPAN

123
124
125
126
127
128
129
130
131
132
133
134
135
136
void closedir(DIR *d);
int unlink(char *f);
int rmdir(char *d);
int chmod(char *file, int mode);
void setfiletype(char *fname,int ftype);
void getRISCOSexts(char *envstr);
int checkext(char *suff);
void swapext(char *name, char *exptr);
void remove_prefix(void);
void set_prefix(void);
struct tm *riscos_localtime(const time_t *timer);
struct tm *riscos_gmtime(const time_t *timer);
 
#endif /* !__riscos_h */

unzip-6.0/macos/source/mactime.c  view on Meta::CPAN

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
 
/*****************************************************************************/
/*  Prototypes                                                               */
/*****************************************************************************/
/* internal prototypes */
static void clear_tm(struct tm * tm);
static long GMTDelta(void);
static Boolean DaylightSaving(void);
static time_t GetTimeMac(void);
static time_t Mactime(time_t *timer);
static void   normalize(int *i,int *j,int norm);
static struct tm *time2tm(const time_t *timer);
static time_t tm2time(struct tm *tp);
 
/* Because serial port and SLIP conflict with ReadXPram calls,
   we cache the call here so we don't hang on calling ReadLocation()  */
static void myReadLocation(MachineLocation * loc);
 
 
/* prototypes for STD lib replacement functions */
struct tm *my_gmtime(const time_t *t);
struct tm *my_localtime(const time_t *t);

unzip-6.0/macos/source/mactime.c  view on Meta::CPAN

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
*  These functions gmtime(), mktime(), localtime() and time()
 *  expects and returns unix times.
 *
 * At midnight Jan. 1, 1970 GMT, the local time was
 *    midnight Jan. 1, 1970 + GMTDelta().
 *
 *
 *****************************************************************************/
 
 
struct tm *my_gmtime(const time_t *timer)
{
    return time2tm(timer);
}
 
 
 
 
struct tm *my_localtime(const time_t *timer)
{
    time_t maclocal;
 
    maclocal = *timer;
    maclocal += GMTDelta();
 
    return time2tm(&maclocal);
}
 
 
 
 
time_t my_mktime(struct tm *tp)
{

unzip-6.0/macos/source/mactime.c  view on Meta::CPAN

367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
  while(*i >= norm)
    {
    *i -= norm;
    (*j)++;
    }
}
 
 
 
/*  Returns the GMT times  */
static time_t Mactime(time_t *timer)
{
    time_t t = GetTimeMac();
 
    if (timer != NULL)
        *timer = t;
 
    return t;
}
 
 
 
 
static struct tm *time2tm(const time_t *timer)
{
    DateTimeRec dtr;
    MachineLocation loc;
    time_t macLocal = *timer;
 
    static struct tm statictime;
    static const short monthday[12] =
        {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
 
    UNIX_TO_MACOS(macLocal);
    SecondsToDate(macLocal, &dtr);
 
    statictime.tm_sec  = dtr.second;         /* second, from 0 to 59 */
    statictime.tm_min  = dtr.minute;         /* minute, from 0 to 59 */

unzip-6.0/wince/wince.cpp  view on Meta::CPAN

530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
   0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365
};
 
// Month to Leap Year Day conversion array.
int M2LYD[] = {
   0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366
};
 
//******************************************************************************
//-- Called from list.c
struct tm * __cdecl localtime(const time_t *timer) {
 
   // Return value for localtime().  Source currently never references
   // more than one "tm" at a time, so the single return structure is ok.
   static struct tm g_tm;
   ZeroMemory(&g_tm, sizeof(g_tm));
 
   // Get our time zone information.
   TIME_ZONE_INFORMATION tzi;
   SafeGetTimeZoneInformation(&tzi);
 
   // Create a time_t that has been corrected for our time zone.
   time_t localTime = *timer - (tzi.Bias * 60L);
 
   // Decide if value is in Daylight Savings Time.
   if (g_tm.tm_isdst = (int)IsDST(&tzi, localTime)) {
      localTime -= tzi.DaylightBias * 60L; // usually 60 minutes
   } else {
      localTime -= tzi.StandardBias * 60L; // usually  0 minutes
   }
 
   // time_t   is a 32-bit value for the seconds since January 1, 1970
   // FILETIME is a 64-bit value for the number of 100-nanosecond intervals



( run in 0.325 second using v1.01-cache-2.11-cpan-26ccb49234f )