~ubuntu-branches/ubuntu/precise/libfs/precise-security

« back to all changes in this revision

Viewing changes to src/FSNextEv.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Stone
  • Date: 2005-07-23 00:15:32 UTC
  • Revision ID: james.westby@ubuntu.com-20050723001532-1n80puvkrct21vfl
Tags: upstream-3.0.0
ImportĀ upstreamĀ versionĀ 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Xorg: FSNextEv.c,v 1.4 2001/02/09 02:03:25 xorgcvs Exp $ */
 
2
 
 
3
/* @(#)FSNextEv.c       4.1     91/05/02
 
4
 * Copyright 1990 Network Computing Devices;
 
5
 * Portions Copyright 1987 by Digital Equipment Corporation
 
6
 *
 
7
 * Permission to use, copy, modify, distribute, and sell this software 
 
8
 * and its documentation for any purpose is hereby granted without fee, 
 
9
 * provided that the above copyright notice appear in all copies and 
 
10
 * that both that copyright notice and this permission notice appear 
 
11
 * in supporting documentation, and that the names of Network Computing 
 
12
 * Devices or Digital not be used in advertising or publicity pertaining 
 
13
 * to distribution of the software without specific, written prior 
 
14
 * permission. Network Computing Devices or Digital make no representations 
 
15
 * about the suitability of this software for any purpose.  It is provided 
 
16
 * "as is" without express or implied warranty.
 
17
 *
 
18
 * NETWORK COMPUTING DEVICES AND  DIGITAL DISCLAIM ALL WARRANTIES WITH
 
19
 * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF 
 
20
 * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES
 
21
 * OR DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES 
 
22
 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
 
23
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 
 
24
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 
 
25
 * SOFTWARE.
 
26
 */
 
27
 
 
28
/*
 
29
 
 
30
Copyright 1987, 1994, 1998  The Open Group
 
31
 
 
32
Permission to use, copy, modify, distribute, and sell this software and its
 
33
documentation for any purpose is hereby granted without fee, provided that
 
34
the above copyright notice appear in all copies and that both that
 
35
copyright notice and this permission notice appear in supporting
 
36
documentation.
 
37
 
 
38
The above copyright notice and this permission notice shall be included in
 
39
all copies or substantial portions of the Software.
 
40
 
 
41
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
42
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
43
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 
44
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 
45
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
46
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
47
 
 
48
Except as contained in this notice, the name of The Open Group shall not be
 
49
used in advertising or otherwise to promote the sale, use or other dealings
 
50
in this Software without prior written authorization from The Open Group.
 
51
 
 
52
*/
 
53
 
 
54
#ifdef HAVE_CONFIG_H
 
55
#include <config.h>
 
56
#endif
 
57
#include        "FSlibint.h"
 
58
 
 
59
extern _FSQEvent *_FSqfree;
 
60
 
 
61
int FSNextEvent(svr, event)
 
62
    FSServer     *svr;
 
63
    FSEvent    *event;
 
64
{
 
65
    _FSQEvent  *qelt;
 
66
 
 
67
    if (svr->head == NULL)
 
68
        _FSReadEvents(svr);
 
69
    qelt = svr->head;
 
70
    *event = qelt->event;
 
71
 
 
72
    if ((svr->head = qelt->next) == NULL)
 
73
        svr->tail = NULL;
 
74
    qelt->next = _FSqfree;
 
75
    _FSqfree = qelt;
 
76
    svr->qlen--;
 
77
 
 
78
    return 1;
 
79
}