void output(void) { if (lstrcmpiA(text_mode, "literal") == 0 && strlen(trim(text_literal)) == 0 || lstrcmpiA(text_mode, "file") == 0 && strlen(trim(text_file)) == 0 || lstrcmpiA(text_mode, "program") == 0 && strlen(trim(text_program)) == 0) { if (verbose) fprintf(stderr, "%s: WARNING: falling back to 'date'\n", progname); text_mode = "date"; } if (lstrcmpiA(text_mode, "literal") == 0) { do_text_literal(); } else if (lstrcmpiA(text_mode, "file") == 0) { do_text_file(); } else if (lstrcmpiA(text_mode, "program") == 0) { do_text_program(); } else // "date" { do_date(); } }
int main() #endif { struct tm * ltime ; time_t ntime ; char lbuff[256] ; int nspaces ; time(&ntime) ; ltime = localtime(&ntime) ; /* FIXME: This information should really be derived from the same source as the Kernel build */ sprintf(lbuff,"Helios Operating System Version 1.31/\"Sk\xF6ll\"") ; fputc(0x0D,stdout), fputc(0x0A,stdout) ; for (nspaces = ((80 - strlen(lbuff)) / 2); (nspaces > 0); nspaces--) fputc(0x20,stdout) ; fputc(0x1B,stdout), fputc(0x5B,stdout), fputc(0x37,stdout), fputc(0x6D,stdout) ; fprintf(stdout,lbuff) ; fputc(0x1B,stdout), fputc(0x5B,stdout), fputc(0x30,stdout), fputc(0x6D,stdout) ; fputc(0x0D,stdout), fputc(0x0A,stdout) ; sprintf( lbuff,"Copyright (C) 1987-1994, Perihelion Distributed Software") ; for (nspaces = ((80 - strlen(lbuff)) / 2); (nspaces > 0); nspaces--) fputc(0x20,stdout) ; fprintf(stdout,lbuff) ; fputc(0x0D,stdout), fputc(0x0A,stdout) ; sprintf( lbuff,"GPL'ed 2013, by the Helios-NG Team") ; for (nspaces = ((80 - strlen(lbuff)) / 2); (nspaces > 0); nspaces--) fputc(0x20,stdout) ; fprintf(stdout,lbuff) ; fputc(0x0D,stdout), fputc(0x0A,stdout) ; /* AxM: Fixed this part to be y2k compliant */ sprintf( lbuff, "Build date: %s %s %s %d", days[ ltime->tm_wday ], months[ ltime->tm_mon ], do_date( ltime->tm_mday ), 1900 + ltime->tm_year ) ; for (nspaces = ((80 - strlen(lbuff)) / 2); (nspaces > 0); nspaces--) fputc(0x20,stdout) ; fprintf(stdout,lbuff) ; fputc(0x0D,stdout), fputc(0x0A,stdout) ; fputc(0x0D,stdout), fputc(0x0A,stdout) ; return(0) ; }
void xml_fillinfo(struct _info *ent) { #ifdef __USE_FILE_OFFSET64 if (inodeflag) fprintf(outfile," inode=\"%lld\"",(long long)ent->inode); #else if (inodeflag) fprintf(outfile," inode=\"%ld\"",(long int)ent->inode); #endif if (devflag) fprintf(outfile, " dev=\"%d\"", (int)ent->dev); #ifdef __EMX__ if (pflag) fprintf(outfile, " mode=\"%04o\" prot=\"%s\"",ent->attr, prot(ent->attr)); #else if (pflag) fprintf(outfile, " mode=\"%04o\" prot=\"%s\"", ent->mode & (S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID|S_ISVTX), prot(ent->mode)); #endif if (uflag) fprintf(outfile, " user=\"%s\"", uidtoname(ent->uid)); if (gflag) fprintf(outfile, " group=\"%s\"", gidtoname(ent->gid)); if (sflag) fprintf(outfile, " size=\"%lld\"", (long long int)(ent->size)); if (Dflag) fprintf(outfile, " time=\"%s\"", do_date(cflag? ent->ctime : ent->mtime)); }
//----------------------------------------------------------------------------- int mv_man_test_rtc(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { MV_STATUS status; printf("*****Testing RTC now**********\n"); argv[1]="091610302010"; //2010/09/16 10:30 status=do_date(cmdtp,flag,2,argv); printf("******************************\n"); if(status==MV_OK) { printf("RTC Works!!\n"); g_testReport|= (0x01<<MAN_FUNC_ID_RTC); } else printf("RTC Failed!!\n"); return 1; }
char *fillinfo(char *buf, struct _info *ent) { int n; buf[n=0] = 0; #ifdef __USE_FILE_OFFSET64 if (inodeflag) n += sprintf(buf," %7lld",(long long)ent->inode); #else if (inodeflag) n += sprintf(buf," %7ld",(long int)ent->inode); #endif if (devflag) n += sprintf(buf+n, " %3d", (int)ent->dev); #ifdef __EMX__ if (pflag) n += sprintf(buf+n, " %s",prot(ent->attr)); #else if (pflag) n += sprintf(buf+n, " %s", prot(ent->mode)); #endif if (uflag) n += sprintf(buf+n, " %-8.32s", uidtoname(ent->uid)); if (gflag) n += sprintf(buf+n, " %-8.32s", gidtoname(ent->gid)); if (sflag) n += psize(buf+n,ent->size); if (Dflag) n += sprintf(buf+n, " %s", do_date(cflag? ent->ctime : ent->mtime)); return buf; }
void rfc822_date (char *date) { do_date (date,"%a, %d %b %Y %H:%M:%S "); }
void internal_date (char *date) { do_date (date,"%2d-%b-%Y %H:%M:%S "); }
void internal_date (char *date) { do_date (date,NIL,"%02d-%s-%d %02d:%02d:%02d %+03d%02d",NIL); }
void rfc822_date (char *date) { do_date (date,"%s, ","%d %s %d %02d:%02d:%02d %+03d%02d", no822tztext ? NIL : T); }
void rfc822_fixed_date (char *date) { do_date (date,NIL,"%02d %s %4d %02d:%02d:%02d %+03d%02d",NIL); }
void rfc822_date (char *date) { do_date (date,"%s, ","%d %s %d %02d:%02d:%02d %+03d%02d"); }