bootstrap
[captive.git] / src / libcaptive / halcaptive / intrlck.c
1 /* $Id$
2  * reactos inter lock increments emulation of libcaptive
3  * Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; exactly version 2 of June 1991 is required
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19
20 #include "config.h"
21
22 #include "reactos/ddk/exfuncs.h"        /* self */
23
24
25 /**
26  * InterlockedIncrement:
27  * @Addend: #LONG variable to be +1ed.
28  *
29  * Adds 1 to a #LONG variable and returns.
30  * Currently libcaptive doesn't use multithreading
31  * and thus this function is just a simple increment now.
32  *
33  * Returns: a negative number if the @result < %0,
34  * zero if the @result == %0
35  * a positive number if the @result > %0.
36  * The returned number need not be equal to the result!!!!
37  */
38 LONG /* FASTCALL */ InterlockedIncrement(PLONG Addend)
39 {
40         /* TODO:thread; really? */
41         return ++*Addend;
42 }
43
44
45 /**
46  * InterlockedDecrement:
47  * @Addend: #LONG variable to be -1ed.
48  *
49  * Subtracts 1 from a #LONG variable and returns.
50  * Currently libcaptive doesn't use multithreading
51  * and thus this function is just a simple decrement now.
52  *
53  * Returns: a negative number if the @result < %0,
54  * zero if the @result == %0
55  * a positive number if the @result > %0.
56  * The returned number need not be equal to the result!!!!
57  */
58 LONG /* FASTCALL */ InterlockedDecrement(PLONG Subend)
59 {
60         /* TODO:thread; really? */
61         return --*Subend;
62 }