Mercurial > hg > octave-kai > gnulib-hg
annotate lib/timespec.h @ 10690:01f3623813da
Split winsock.c into many smaller files.
* lib/close.c: Add _gl_close_fd_maybe_socket from winsock.c.
* lib/accept.c: New file, based on winsock.c.
* lib/bind.c: New file, based on winsock.c.
* lib/connect.c: New file, based on winsock.c.
* lib/getpeername.c: New file, based on winsock.c.
* lib/getsockname.c: New file, based on winsock.c.
* lib/getsockopt.c: New file, based on winsock.c.
* lib/ioctl.c: New file, based on winsock.c.
* lib/listen.c: New file, based on winsock.c.
* lib/recv.c: New file, based on winsock.c.
* lib/recvfrom.c: New file, based on winsock.c.
* lib/send.c: New file, based on winsock.c.
* lib/sendto.c: New file, based on winsock.c.
* lib/setsockopt.c: New file, based on winsock.c.
* lib/shutdown.c: New file, based on winsock.c.
* lib/socket.c: New file, based on winsock.c.
* lib/w32sock.h: New file, based on winsock.c.
* lib/winsock.c: Remove file.
* modules/accept: Likewise.
* modules/bind: Likewise.
* modules/connect: Likewise.
* modules/getpeername: Likewise.
* modules/getsockname: Likewise.
* modules/getsockopt: Likewise.
* modules/ioctl: Likewise.
* modules/listen: Likewise.
* modules/recv: Likewise.
* modules/recvfrom: Likewise.
* modules/send: Likewise.
* modules/sendto: Likewise.
* modules/setsockopt: Likewise.
* modules/shutdown: Likewise.
* modules/socket: Use socket.c instead of winsock.c.
* modules/sys_socket: Remove (unneeded?) dependency on winsock.c.
* doc/posix-functions/accept.texi: Doc fix.
* doc/posix-functions/bind.texi: Doc fix.
* doc/posix-functions/close.texi: Doc fix.
* doc/posix-functions/connect.texi: Doc fix.
* doc/posix-functions/getpeername.texi: Doc fix.
* doc/posix-functions/getsockname.texi: Doc fix.
* doc/posix-functions/getsockopt.texi: Doc fix.
* doc/posix-functions/ioctl.texi: Doc fix.
* doc/posix-functions/listen.texi: Doc fix.
* doc/posix-functions/recv.texi: Doc fix.
* doc/posix-functions/recvfrom.texi: Doc fix.
* doc/posix-functions/send.texi: Doc fix.
* doc/posix-functions/sendto.texi: Doc fix.
* doc/posix-functions/setsockopt.texi: Doc fix.
* doc/posix-functions/shutdown.texi: Doc fix.
* doc/posix-functions/socket.texi: Doc fix.
author | Simon Josefsson <simon@josefsson.org> |
---|---|
date | Tue, 21 Oct 2008 12:17:19 +0200 |
parents | bbbbbf4cd1c5 |
children | 35acba1c7bcd |
rev | line source |
---|---|
3766
6ed5059e1333
new macros/decls, from Paul Eggert
Jim Meyering <jim@meyering.net>
parents:
3765
diff
changeset
|
1 /* timespec -- System time interface |
6ed5059e1333
new macros/decls, from Paul Eggert
Jim Meyering <jim@meyering.net>
parents:
3765
diff
changeset
|
2 |
7897
b7a83a69ac23
* MODULES.html.sh (Support for systems lacking POSIX:2001): New
Paul Eggert <eggert@cs.ucla.edu>
parents:
6259
diff
changeset
|
3 Copyright (C) 2000, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. |
3765 | 4 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8146
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
3765 | 6 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8146
diff
changeset
|
7 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8146
diff
changeset
|
8 (at your option) any later version. |
3765 | 9 |
10 This program is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU General Public License | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8146
diff
changeset
|
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
3765 | 17 |
3766
6ed5059e1333
new macros/decls, from Paul Eggert
Jim Meyering <jim@meyering.net>
parents:
3765
diff
changeset
|
18 #if ! defined TIMESPEC_H |
6ed5059e1333
new macros/decls, from Paul Eggert
Jim Meyering <jim@meyering.net>
parents:
3765
diff
changeset
|
19 # define TIMESPEC_H |
3765 | 20 |
7897
b7a83a69ac23
* MODULES.html.sh (Support for systems lacking POSIX:2001): New
Paul Eggert <eggert@cs.ucla.edu>
parents:
6259
diff
changeset
|
21 # include <time.h> |
3765 | 22 |
6237
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
23 /* Return negative, zero, positive if A < B, A == B, A > B, respectively. |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
24 Assume the nanosecond components are in range, or close to it. */ |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
25 static inline int |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
26 timespec_cmp (struct timespec a, struct timespec b) |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
27 { |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
28 return (a.tv_sec < b.tv_sec ? -1 |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
29 : a.tv_sec > b.tv_sec ? 1 |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
30 : a.tv_nsec - b.tv_nsec); |
d81a8251a9b0
* MODULES.html.sh (File system functions): Add stat-time.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
31 } |
3766
6ed5059e1333
new macros/decls, from Paul Eggert
Jim Meyering <jim@meyering.net>
parents:
3765
diff
changeset
|
32 |
5662
42df9db003cc
* modules/gethrxtime: New file.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4989
diff
changeset
|
33 void gettime (struct timespec *); |
3766
6ed5059e1333
new macros/decls, from Paul Eggert
Jim Meyering <jim@meyering.net>
parents:
3765
diff
changeset
|
34 int settime (struct timespec const *); |
6ed5059e1333
new macros/decls, from Paul Eggert
Jim Meyering <jim@meyering.net>
parents:
3765
diff
changeset
|
35 |
3765 | 36 #endif |