~ubuntu-branches/ubuntu/raring/ipxe/raring

« back to all changes in this revision

Viewing changes to src/include/time.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-11-14 15:47:31 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20121114154731-jhuy5d1h2jw75qe9
Tags: 1.0.0+git-4.d6b0b76-0ubuntu1
* New upstream snapshot:
  - d/p/iscsi*.patch: Dropped - included in snapshot.
  - Refreshed all other patches.
* d/p/enable-https.patch: Enable HTTPS support (LP: #1025239).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef _TIME_H
2
2
#define _TIME_H
3
3
 
4
 
typedef unsigned long time_t;
5
 
 
 
4
/** @file
 
5
 *
 
6
 * Date and time
 
7
 */
 
8
 
 
9
#include <sys/time.h>
 
10
#include <ipxe/time.h>
 
11
 
 
12
/** Broken-down time */
6
13
struct tm {
7
 
        int tm_sec;     /* seconds */
8
 
        int tm_min;     /* minutes */
9
 
        int tm_hour;    /* hours */
10
 
        int tm_mday;    /* day of the month */
11
 
        int tm_mon;     /* month */
12
 
        int tm_year;    /* year */
13
 
        int tm_wday;    /* day of the week */
14
 
        int tm_yday;    /* day in the year */
15
 
        int tm_isdst;   /* daylight saving time */
 
14
        /** Seconds [0,60] */
 
15
        int tm_sec;
 
16
        /** Minutes [0,59] */
 
17
        int tm_min;
 
18
        /** Hour [0,23] */
 
19
        int tm_hour;
 
20
        /** Day of month [1,31] */
 
21
        int tm_mday;
 
22
        /** Month of year [0,11] */
 
23
        int tm_mon;
 
24
        /** Years since 1900 */
 
25
        int tm_year;
 
26
        /** Day of week [0,6] (Sunday=0) */
 
27
        int tm_wday;
 
28
        /** Day of year [0,365] */
 
29
        int tm_yday;
 
30
        /** Daylight savings flag */
 
31
        int tm_isdst;
16
32
};
17
33
 
18
 
extern time_t time ( time_t *t );
 
34
/**
 
35
 * Get current time in seconds since the Epoch
 
36
 *
 
37
 * @v t                 Time to fill in, or NULL
 
38
 * @ret time            Current time
 
39
 */
 
40
static inline time_t time ( time_t *t ) {
 
41
        time_t now;
 
42
 
 
43
        now = time_now();
 
44
        if ( t )
 
45
                *t = now;
 
46
        return now;
 
47
}
19
48
 
20
49
extern time_t mktime ( struct tm *tm );
21
50