Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

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

 register char *p1=exptr+1;
 register char *p2=ext;
 int extchar=*exptr;

 while(*p1 && *p1!='.' && *p1!='/')
   *p2++=*p1++;
 *p2=0;
 p2=exptr-1;
 p1--;
 while(p2 >= name)
   *p1--=*p2--;
 p1=name;
 p2=ext;
 while(*p2)
   *p1++=*p2++;
 *p1=(extchar=='/'?'.':'/');
}

void remove_prefix(void)
{
 SWI_DDEUtils_Prefix(NULL);
}

void set_prefix(void)
{
 char *pref;
 int size=0;

 if (SWI_OS_FSControl_37("@",pref,&size)!=NULL)
   return;

 size=1-size;

 if (pref=malloc(size),pref!=NULL) {
 if (SWI_OS_FSControl_37("@",pref,&size)!=NULL) {
   free(pref);
   return;
 }

 if (SWI_DDEUtils_Prefix(pref)==NULL) {
   atexit(remove_prefix);
 }

 free(pref);
 }
}

#ifdef localtime
#  undef localtime
#endif

#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);
}



( run in 0.438 second using v1.01-cache-2.11-cpan-817d5f8af8b )