You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.9 KiB
C

2 years ago
/************************************************************************
*
* Copyright (C) 2003-2004
* Shenzhen SCADA Control Technology Co., Ltd.
* All rights reserved.
*
*
2 years ago
*
* : 2004/01/10
2 years ago
*
* Windoes $(DDKPATH)/inc/ntdef.h$(DDKPATH)/inc/ddk/ntddk.h
2 years ago
*
* $Id: list_entry.h,v 1.1.1.1 2006/07/05 07:31:43 jehu Exp $
*
***********************************************************************/
#ifndef __LIST_ENTRY_H__SKLJFALKJZLJVADFHOPSHVPZIOXJHCVOIPADFDFNXVCQWEDAH
#define __LIST_ENTRY_H__SKLJFALKJZLJVADFHOPSHVPZIOXJHCVOIPADFDFNXVCQWEDAH
/*!
* , .
2 years ago
*/
typedef struct tag_list_entry_t {
struct tag_list_entry_t * flink; /*!< 指向链表元素的前驱元素 */
2 years ago
struct tag_list_entry_t * blink; /*!< 指向链表元素的后继元素 */
2 years ago
} list_entry_t;
typedef list_entry_t * plist_entry_t;
typedef list_entry_t ** pplist_entry_t;
/*
*
2 years ago
*
* +---------------------------+-----------------------------------------------------+
* | Initialize_list_head | list_entry_t |
2 years ago
* +---------------------------+-----------------------------------------------------+
* | is_list_empty | |
2 years ago
* +---------------------------+-----------------------------------------------------+
* | remove_head_list | --|
2 years ago
* +---------------------------+-----------------------------------------------------+
* | remove_tail_list | --|
2 years ago
* +---------------------------+-----------------------------------------------------+
* | remove_entry_list | -- |
2 years ago
* +---------------------------+-----------------------------------------------------+
* | insert_tail_list | |
2 years ago
* +---------------------------+-----------------------------------------------------+
* | insert_head_list | |
2 years ago
* +---------------------------+-----------------------------------------------------+
* | CONTAINING_RECORD | |
2 years ago
* +---------------------------+-----------------------------------------------------+
*
*/
/*
*
2 years ago
*/
#ifdef CONTAINING_RECORD
#undef CONTAINING_RECORD
#endif
#define CONTAINING_RECORD(_addr, _type, _field) ((_type *)((char *)(_addr) - (char *)(&((_type *)0)->_field)))
/*
*
2 years ago
*
* \param plist_head
2 years ago
*/
void Initialize_list_head ( list_entry_t * plist_head );
/*
*
2 years ago
*
* \retval 0
* \retval 0
2 years ago
*/
int is_list_empty ( list_entry_t * plist_head );
/*
* --
2 years ago
*/
list_entry_t * remove_head_list ( list_entry_t * plist_head );
/*
* --
2 years ago
*/
list_entry_t * remove_tail_list ( list_entry_t * plist_head );
/*
* --
2 years ago
*/
void remove_entry_list ( list_entry_t * pEntry);
/*
*
2 years ago
*/
void insert_tail_list ( list_entry_t * plist_head, list_entry_t * pEntry );
/*
*
2 years ago
*/
void insert_head_list ( list_entry_t * plist_head, list_entry_t * pEntry);
#endif /* __LIST_ENTRY_H__SKLJFALKJZLJVADFHOPSHVPZIOXJHCVOIPADFDFNXVCQWEDAH */