1 /*****************************************************************************
2 * mtime.h: high resolution time management functions
3 * This header provides portable high precision time management functions,
4 * which should be the only ones used in other segments of the program, since
5 * functions like gettimeofday() and ftime() are not always supported.
6 * Most functions are declared as inline or as macros since they are only
7 * interfaces to system calls and have to be called frequently.
8 * 'm' stands for 'micro', since maximum resolution is the microsecond.
9 * Functions prototyped are implemented in interface/mtime.c.
10 *****************************************************************************
11 * Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN
12 * $Id: mtime.h,v 1.8 2001/11/28 15:08:04 massiot Exp $
14 * Authors: Vincent Seguin <seguin@via.ecp.fr>
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
29 *****************************************************************************/
31 /*****************************************************************************
34 * this header includes inline functions
35 *****************************************************************************/
37 /*****************************************************************************
38 * LAST_MDATE: date which will never happen
39 *****************************************************************************
40 * This date can be used as a 'never' date, to mark missing events in a function
41 * supposed to return a date, such as nothing to display in a function
42 * returning the date of the first image to be displayed. It can be used in
43 * comparaison with other values: all existing dates will be earlier.
44 *****************************************************************************/
45 #define LAST_MDATE ((mtime_t)((u64)(-1)/2))
47 /*****************************************************************************
48 * MSTRTIME_MAX_SIZE: maximum possible size of mstrtime
49 *****************************************************************************
50 * This values is the maximal possible size of the string returned by the
51 * mstrtime() function, including '-' and the final '\0'. It should be used to
52 * allocate the buffer.
53 *****************************************************************************/
54 #define MSTRTIME_MAX_SIZE 22
56 /*****************************************************************************
58 *****************************************************************************/
59 char * mstrtime ( char *psz_buffer, mtime_t date );
60 mtime_t mdate ( void );
61 void mwait ( mtime_t date );
62 void msleep ( mtime_t delay );