Next Previous Contents

11. Informational Functions

11.1 bobp

Synopsis

bobp

Usage

Integer bobp ();

Description

The bolp function is used to determine if the current position is at the beginning of the buffer or not. If so, it returns a non-zero value. However, if it is not, it returns zero. This simple example,

        define is_buffer_empty ()
        {
          return bobp () and eobp ();
        }
returns non-zero if the buffer is empty; otherwise, it returns zero.
See Also

bob, eobp, bolp, eolp

11.2 bolp

Synopsis

bolp

Usage

Integer bolp ();

Description

bolp is used to test if the current position is at the beginning of a line or not. It returns non-zero if the position is at the beginning of a line or zero if not.

See Also

bol, eolp, bobp, eobp

11.3 count_chars

Synopsis

count_chars

Usage

String count_chars ();

Description

This function returns information about the size of the current buffer and current position in the buffer. The string returned is of the form:

        'h'=104/0x68/0150, point 90876 of 127057
See Also

what_char

11.4 eobp

Synopsis

eobp

Usage

Integer eobp ();

Description

The functio eobp is used to determine if the current position is at the end of the buffer or not. It returns a non-zero value if at the end of the buffer or zero if not.

See Also

eob, bolp, eolp

11.5 eolp

Synopsis

eolp

Usage

Integer eolp ();

Description

This function may be used to determine whether or not the current position is at the end of a line ot not. If it is, the routine returns a non-zero value; otherwise it returns zero.

See Also

eol, bolp, eobp, bobp

11.6 get_word_chars

Synopsis

Get the currently defined word range

Usage

String_Type get_word_chars ()

Description

The get_word_chars returns the currently defined set of characters that constitute a word. The set may be returned as a character range.

See Also

define_word

11.7 what_char

Synopsis

what_char

Usage

Integer what_char ();

Description

The what_char function returns the value of the character at the current position as an integer in the range 0 to 256. This simple example,

        while (not (eolp ()))
          {
             if (what_char () == '_')
               {
                  del (); insert ("\\_");
               }
          }
has the effect of replacing all underscore characters on the current line with a backslash-underscore combination.
See Also

looking_at

11.8 what_column

Synopsis

what_column

Usage

Integer what_column ();

Description

The what_column function returns the current column number expanding tabs, control characters, etc... The beginning of the line is at column number one.

See Also

whatline, whatpos, goto_column, bolp, eolp

11.9 what_line

Synopsis

Get the current line number

Usage

Int_Type what_line

Description

The value of the what_line specifies the current line number. Lines are numbered from one.

Notes

This is a read-only variable.

The actual number is measured from the top of the buffer which is itself is affected by whether the buffer is narrowed or not. For example,

   define one ()
   {
     push_mark (); narrow ();
     return what_line;
   }
always returns 1.
See Also

what_column, goto_line


Next Previous Contents