Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentvarith.h
Go to the documentation of this file.
00001 /* 00002 * tvarith.h 00003 * - static inline functions for doing arithmetic on timevals 00004 */ 00005 /* 00006 * This file is 00007 * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk> 00008 * 00009 * It is part of adns, which is 00010 * Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk> 00011 * Copyright (C) 1999-2000 Tony Finch <dot@dotat.at> 00012 * 00013 * This program is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU General Public License as published by 00015 * the Free Software Foundation; either version 2, or (at your option) 00016 * any later version. 00017 * 00018 * This program is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this program; if not, write to the Free Software Foundation, 00025 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00026 */ 00027 00028 #ifndef ADNS_TVARITH_H_INCLUDED 00029 #define ADNS_TVARITH_H_INCLUDED 00030 00031 static inline void timevaladd(struct timeval *tv_io, long ms) { 00032 struct timeval tmp; 00033 assert(ms>=0); 00034 tmp= *tv_io; 00035 tmp.tv_usec += (ms%1000)*1000; 00036 tmp.tv_sec += ms/1000; 00037 if (tmp.tv_usec >= 1000000) { tmp.tv_sec++; tmp.tv_usec -= 1000000; } 00038 *tv_io= tmp; 00039 } 00040 00041 #endif Generated on Sun May 27 2012 04:33:26 for ReactOS by
1.7.6.1
|