File: list.h

package info (click to toggle)
bibutils 4.8-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,512 kB
  • ctags: 1,340
  • sloc: ansic: 72,394; csh: 216; makefile: 117
file content (37 lines) | stat: -rw-r--r-- 868 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
/*
 * list.h
 *
 * Copyright (c) Chris Putnam 2004-2009
 *
 * Source code released under the GPL
 *
 */

#ifndef LISTS_H
#define LISTS_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "newstr.h"

typedef struct list {
	int n, max;
	int sorted;
	newstr *str;
} list;

extern void    list_init( list *a );
extern int     list_add( list *a, char *value );
extern void    list_sort( list *a );
extern int     list_find( list *a, char *searchstr );
extern int     list_findnocase( list *a, char *searchstr );
extern int     list_find_or_add( list *a, char *searchstr );
extern void    list_free( list *a );
extern int     list_fill( list *a, char *filename );
extern newstr* list_getstr( list *a, int n );
extern char*   list_getstr_char( list *a, int n );
extern list*   list_dup( list *a );
extern void    list_copy( list *to, list *from );

#endif