66 |
66 |
67 // This returns a pointer to the start of the current line in the buffer, |
67 // This returns a pointer to the start of the current line in the buffer, |
68 // and increments bufeol and filepos to point at the end of that line. |
68 // and increments bufeol and filepos to point at the end of that line. |
69 char *get_line(void); |
69 char *get_line(void); |
70 int linenum() const { return _linenum; } |
70 int linenum() const { return _linenum; } |
|
71 void set_linenum(int line) { _linenum = line; } |
71 |
72 |
72 // This converts a pointer into the buffer to a file offset. It only works |
73 // This converts a pointer into the buffer to a file offset. It only works |
73 // when the pointer is valid (i.e. just obtained from getline()). |
74 // when the pointer is valid (i.e. just obtained from getline()). |
74 int getoff(const char *s) { return _bufoff+(int)(s-_buf); } |
75 int getoff(const char *s) { return _bufoff+(int)(s-_buf); } |
75 }; |
76 }; |