-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpoint_list.h
44 lines (33 loc) · 927 Bytes
/
point_list.h
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
43
/* Base graphics library for coursework
*
* Fixed Length Point List
*
* Header file only.
*/
#ifndef BG_POINT_LIST
#define BG_POINT_LIST
#include <stdlib.h> /* malloc */
#include <string.h> /* memcpy */
#include "point.h"
/* bg_point_list */
struct bg_point_list {
struct bg_point * head_p;
size_t length; /* the number of elements */
};
/* 打印列表 */
void bg_point_list_print(
struct bg_point_list * plist);
/* bg_point_list_append()
* Allocate a new list and it is {sizeof(struct bg_point)} bytes bigger than olds,
* then copy the content from olds to news. The old list would be freed.
*/
void
bg_point_list_append(
struct bg_point_list * point_list_p,
struct bg_point * new_point_p);
void
bg_point_list_clear(
struct bg_point_list * point_list_p);
void bg_point_list_removeback(
struct bg_point_list * point_list_p);
#endif /* BG_POINT_LIST */