Skip to content
Snippets Groups Projects
Select Git revision
2 results Searching

aes-encrypt-internal.c

Blame
  • cache-node.c 5.24 KiB
    /*
     * $Id: cache-node.c,v 0.22 2001/11/05 23:52:11 ceder Exp $
     * Copyright (C) 1991, 1993-1994, 1996, 1998-1999  Lysator Academic Computer Association.
     *
     * This file is part of the LysKOM server.
     * 
     * LysKOM is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by 
     * the Free Software Foundation; either version 1, or (at your option) 
     * any later version.
     * 
     * LysKOM is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     * for more details.
     * 
     * You should have received a copy of the GNU General Public License
     * along with LysKOM; see the file COPYING.  If not, write to
     * Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
     * or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
     * MA 02139, USA.
     *
     * Please mail bug reports to bug-lyskom@lysator.liu.se. 
     */
    /*
     * cache-node.c
     *
     * Used in diskomd.
     */
    
    
    #ifdef HAVE_CONFIG_H
    #  include <config.h>
    #endif
    
    #include <sys/types.h>
    #include <stdio.h>
    #ifdef HAVE_STDDEF_H
    #  include <stddef.h>
    #endif
    
    #include "cache-node.h"
    #include "exp.h"
    #include "server/smalloc.h"
    #include "lyskomd.h"
    
    EXPORT const Cache_node EMPTY_CACHE_NODE =
        {{ 0, 0 }, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0};
    
    EXPORT const Cache_node_block EMPTY_CACHE_NODE_BLOCK =
        { 0, NULL, NULL};
    
    EXPORT const Cache_node_mcb EMPTY_CACHE_NODE_MCB =
        { 0, NULL, 0, 0, NULL, NULL, 0, NULL };
    
    
    EXPORT  void
    unlink_lru(Cache_node *node,
    	   Cache_node **lru,
    	   Cache_node **mru)
    {
        Cache_node *link;
        
        link = node->next;
    
        if ( node->next != NULL )
    	node->next->prev = node->prev;
        else if (*lru == node)
    	*lru = node->prev;