lxqclass() Subroutine

Issues the query class command.

Library:
LPEXAPI.H
Include File:
LPEXAPI.H

C Syntax

int lxqclass(long * ClassList); 

Parameter

ClassList 
Pointer to a long integer in which the data will be returned.

For each class set for the current line, one bit in the ClassList will be turned on. The order of the bits is the same as the order that the classes were specified in the CLASSES command, starting with the highest-order bit. (That is, the first class specified in the CLASSES command is represented by the bit 0x80000000.)

Description

The lxqclass subroutine provides a fast way of finding out about line classes, avoiding the need to do string operations that involve adding or deleting words. See the classes parameter for more information.

Examples

Before the examples below will work you must enter the command:

set classes DATA COMMENT CODE.
  1. If a file has three classes, defined as follows:
    #define DATA     0x80000000 
    #define COMMENT  0x40000000
    #define CODE     0x20000000 

    A line belonging to both the DATA and CODE classes would return the value 0xA0000000.

  2. To see if an line contains both DATA and CODE (using the same definitions as in the previous example), type:
    int classlist;
    lxqclass(&classlist);
    if ((classlist & DATA) && (classlist & CODE))
       printf("Element belongs to both DATA and CODE classes \n");

Return Value

The return value is the return code from the Editor.


Building External Commands Written in the C Language
lxsclass() Subroutine
lxalloc() Subroutine