OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [time/] [asctime_r.c] - Blame information for rev 258

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/*
2
 * asctime_r.c
3
 */
4
 
5
#include <stdio.h>
6
#include <time.h>
7
 
8
char *
9
_DEFUN (asctime_r, (tim_p, result),
10
        _CONST struct tm *tim_p _AND
11
        char *result)
12
{
13
  static _CONST char day_name[7][3] = {
14
        "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
15
  };
16
  static _CONST char mon_name[12][3] = {
17
        "Jan", "Feb", "Mar", "Apr", "May", "Jun",
18
        "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
19
  };
20
 
21
  sprintf (result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",
22
           day_name[tim_p->tm_wday],
23
           mon_name[tim_p->tm_mon],
24
           tim_p->tm_mday, tim_p->tm_hour, tim_p->tm_min,
25
           tim_p->tm_sec, 1900 + tim_p->tm_year);
26
  return result;
27
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.