Nano-X API Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# general

## Name

general —

## Synopsis

    void        GrFlush                         (void);
    int         GrOpen                          (void);
    void        GrClose                         (void);
    void        GrMainLoop                      (GR_FNCALLBACKEVENT fncb);
    void        GrGetScreenInfo                 (GR_SCREEN_INFO *sip);
    GR_FNCALLBACKEVENT GrSetErrorHandler        (GR_FNCALLBACKEVENT fncb);
    void        GrDefaultErrorHandler           (GR_EVENT *ep);

## Description

## Details

### GrFlush ()

    void        GrFlush                         (void);

Flush the message buffer of any messages it may contain.

### GrOpen ()

    int         GrOpen                          (void);

Open a connection to the graphics server.

Returns : | the fd of the connection to the server or -1 on failure

### GrClose ()

    void        GrClose                         (void);

Close the graphics device, flushing any waiting messages.

### GrMainLoop ()

    void        GrMainLoop                      (GR_FNCALLBACKEVENT fncb);

A convenience function which calls the specified callback function whenever an event arrives or there is data to be read on a file descriptor previously specified by GrRegisterInput(). Currently never returns.

`fncb` : |

### GrGetScreenInfo ()

    void        GrGetScreenInfo                 (GR_SCREEN_INFO *sip);

Fills in the specified GR_SCREEN_INFO structure.

`sip` : | pointer to a GR_SCREEN_INFO structure

### GrSetErrorHandler ()

    GR_FNCALLBACKEVENT GrSetErrorHandler        (GR_FNCALLBACKEVENT fncb);

Sets an error handling routine that will be called on any errors from the server (assuming the client has asked to receive them). If zero is used as the argument, errors will be returned as regular events instead.

`fncb` : | the function to call to handle error events
Returns : | the address of the previous error handler

### GrDefaultErrorHandler ()

    void        GrDefaultErrorHandler           (GR_EVENT *ep);

The default error handler which is called when the server reports an error event and the client hasn't set up a handler of it's own.

Generates a human readable error message on stderr describing what error occurred and what function it occured in, then exits.

`ep` : | the error event structure

<<< Previous Page | Home | Up | Next Page >>>
libnano-X | window