46 |
|
|
47 |
struct _content |
struct _content |
48 |
{ |
{ |
49 |
char* text; /* the text from buf */ |
char* text; /* the text from buf */ |
50 |
int lineNumber; /* line number */ |
int line_number; /* line number */ |
51 |
struct _content *next; /* ptr to next struct */ |
struct _content *next; /* ptr to next struct */ |
52 |
|
struct _content *prev; /* ptr to previous struct */ |
53 |
}; |
}; |
54 |
|
|
55 |
|
|
57 |
typedef first *firstPtr; |
typedef first *firstPtr; |
58 |
|
|
59 |
/** |
/** |
60 |
* first: |
* _first, first, firstPtr: |
61 |
* |
* |
62 |
* a special struct for the first element of all, |
* a special struct for the first element of all, |
63 |
+ it contains the lines and a pointer to the first |
+ it contains the lines and a pointer to the first |
67 |
|
|
68 |
struct _first |
struct _first |
69 |
{ |
{ |
70 |
int count; /* how much lines */ |
int count; /* how much lines */ |
71 |
struct _content *head; /* the first one */ |
struct _content *head; /* the first one */ |
72 |
}; |
}; |
73 |
|
|
74 |
/* returns the content of the file */ |
/* returns the content of the file */ |
75 |
contentPtr |
contentPtr |
76 |
readFile (char *filename); |
read_file (char *filename); |
77 |
|
|
78 |
/* writes changes to the file */ |
/* writes changes to the file */ |
79 |
void |
void |
80 |
writeFile (char *filename); |
write_file (char *filename); |