File: list.h

package info (click to toggle)
libacpi 0.2-7
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,120 kB
  • sloc: ansic: 870; makefile: 83; sh: 19
file content (42 lines) | stat: -rw-r--r-- 818 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * (C)opyright 2007 Nico Golde <nico@ngolde.de>
 * See LICENSE file for license details
 */

/**
 * \file list.h
 * \brief linked list
 */

/**
 * \struct node_t
 * \brief node for linked list
 */
typedef struct node{
	char *name;         /**< node name */
	struct node *next;  /**< pointer to the next node */
} node_t;

/**
 * \struct list_t
 * \brief linked list
 */
typedef struct{
	int length;         /**< list length */
	node_t *top;        /**< pointer to top node */
	node_t *last;       /**< pointer to last node */
} list_t;

/**
 * Lists contents (for libacpi directories) of a directory
 * and return them in a linked list
 * @param dir directory to list
 * @return linked list
 */
list_t *dir_list(char *dir);

/**
 * Delete linked list
 * @param lst list to delete
 */
void delete_list(list_t *lst);