About position



next up previous contents index
Next: Change position Up: Functions Previous: Functions

About position

 

current_position

   int current_position()

Returns the current position in the current window. When you are at the beginning of the buffer current\_position returns 0.

end_of_file

  int end_of_file();

Returns the end of file position, thus the number of characters in the buffer. For an empty file end\_of\_file returns 0.

at_end_of_file

  int at_end_of_file();

Returns 1 if you are at the end of the current buffer, else returns 0. Its definition is equivalent to:

current_line

   int current_line();

Returns the current line number. Lines are terminated by a newline character. Here is an example of this function use:

beginning_of_line

  int beginning_of_line();

Returns the position of the beginning of the current line, therefore the current position at the beginning of the buffer or when the previous character is a newline.

end_of_line

  int end_of_line()

Returns the position of the end of the current line, therefore the current position if the current character is newline, else the position of the next newline if it exists, else the end of file position (See also mark\_position() §7.3.7 page gif).



Lionel Fournigault
Mon Mar 6 13:33:34 MET 1995