BRL-CAD
if_remote.c File Reference
#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "bu/color.h"
#include "bu/str.h"
#include "bu/log.h"
#include "pkg.h"
#include "fb_private.h"
#include "fb.h"
#include "fbmsg.h"
Include dependency graph for if_remote.c:

Go to the source code of this file.

Macros

#define NET_LONG_LEN   4 /* # bytes to network long */
 
#define MAX_HOSTNAME   128
 
#define PCP(ptr)   ((struct pkg_conn *)((ptr)->u1.p))
 
#define PCPL(ptr)   ((ptr)->u1.p) /* left hand side version */
 
#define REM_CMAP_BYTES   (256*3*2)
 

Functions

HIDDEN int numeric (const char *s)
 
HIDDEN void rem_log (const char *msg)
 
HIDDEN int rem_open (register fb *ifp, const char *file, int width, int height)
 
HIDDEN struct fb_platform_specificrem_get_fbps (uint32_t magic)
 
HIDDEN void rem_put_fbps (struct fb_platform_specific *fbps)
 
HIDDEN int rem_open_existing (fb *ifp, int width, int height, struct fb_platform_specific *fb_p)
 
HIDDEN int rem_close_existing (fb *ifp)
 
HIDDEN int rem_configure_window (fb *ifp, int width, int height)
 
HIDDEN int rem_refresh (fb *ifp, int x, int y, int w, int h)
 
HIDDEN int rem_close (fb *ifp)
 
HIDDEN int rem_free (fb *ifp)
 
HIDDEN int rem_clear (fb *ifp, unsigned char *bgpp)
 
HIDDEN ssize_t rem_read (register fb *ifp, int x, int y, unsigned char *pixelp, size_t num)
 
HIDDEN ssize_t rem_write (register fb *ifp, int x, int y, const unsigned char *pixelp, size_t num)
 
HIDDEN int rem_readrect (fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
 
HIDDEN int rem_writerect (fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
 
HIDDEN int rem_bwreadrect (fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
 
HIDDEN int rem_bwwriterect (fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
 
HIDDEN int rem_cursor (fb *ifp, int mode, int x, int y)
 
HIDDEN int rem_getcursor (fb *ifp, int *mode, int *x, int *y)
 
HIDDEN int rem_setcursor (fb *ifp, const unsigned char *bits, int xbits, int ybits, int xorig, int yorig)
 
HIDDEN int rem_view (fb *ifp, int xcenter, int ycenter, int xzoom, int yzoom)
 
HIDDEN int rem_getview (fb *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom)
 
HIDDEN int rem_rmap (register fb *ifp, register ColorMap *cmap)
 
HIDDEN int rem_wmap (register fb *ifp, const ColorMap *cmap)
 
HIDDEN int rem_poll (fb *ifp)
 
HIDDEN int rem_flush (fb *ifp)
 
HIDDEN int rem_help (fb *ifp)
 

Variables

fb remote_interface
 

Detailed Description

Remote libfb interface.

Duplicates the functions in libfb via communication with a remote server (fbserv).

Note that internal errors are returned as -2 and below, because most remote errors (unpacked by ntohl) will be -1 (although they could be anything).

Definition in file if_remote.c.

Macro Definition Documentation

#define MAX_HOSTNAME   128

Definition at line 66 of file if_remote.c.

Referenced by rem_open().

#define PCPL (   ptr)    ((ptr)->u1.p) /* left hand side version */

Definition at line 68 of file if_remote.c.

Referenced by rem_open().

#define REM_CMAP_BYTES   (256*3*2)

Definition at line 680 of file if_remote.c.

Referenced by rem_rmap(), and rem_wmap().

Function Documentation

HIDDEN int numeric ( const char *  s)

Definition at line 80 of file if_remote.c.

HIDDEN void rem_log ( const char *  msg)

Definition at line 200 of file if_remote.c.

References fb_log().

Referenced by rem_open().

Here is the call graph for this function:

HIDDEN int rem_open ( register fb ifp,
const char *  file,
int  width,
int  height 
)

Definition at line 213 of file if_remote.c.

References bu_strlcpy, FB_CK_FB, fb_log(), fb_internal::if_fd, fb_internal::if_height, fb_internal::if_max_height, fb_internal::if_max_width, fb_internal::if_width, MAX_HOSTNAME, NET_LONG_LEN, PCPL, PKC_ERROR, pkg_conn::pkc_fd, pkg_open(), pkg_send(), pkg_waitfor(), and rem_log().

Here is the call graph for this function:

HIDDEN struct fb_platform_specific* rem_get_fbps ( uint32_t  magic)

Definition at line 291 of file if_remote.c.

HIDDEN void rem_put_fbps ( struct fb_platform_specific fbps)

Definition at line 298 of file if_remote.c.

HIDDEN int rem_open_existing ( fb ifp,
int  width,
int  height,
struct fb_platform_specific fb_p 
)

Definition at line 304 of file if_remote.c.

HIDDEN int rem_close_existing ( fb ifp)

Definition at line 310 of file if_remote.c.

HIDDEN int rem_configure_window ( fb ifp,
int  width,
int  height 
)

Definition at line 316 of file if_remote.c.

HIDDEN int rem_refresh ( fb ifp,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 322 of file if_remote.c.

HIDDEN int rem_close ( fb ifp)

Definition at line 329 of file if_remote.c.

References NET_LONG_LEN, PCP, pkg_close(), pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN int rem_free ( fb ifp)

Definition at line 354 of file if_remote.c.

References NET_LONG_LEN, PCP, pkg_close(), pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN int rem_clear ( fb ifp,
unsigned char *  bgpp 
)

Definition at line 369 of file if_remote.c.

References BLU, GRN, NET_LONG_LEN, PCP, PIXEL_NULL, pkg_send(), pkg_waitfor(), and RED.

Here is the call graph for this function:

HIDDEN ssize_t rem_read ( register fb ifp,
int  x,
int  y,
unsigned char *  pixelp,
size_t  num 
)

Definition at line 393 of file if_remote.c.

References fb_log(), NET_LONG_LEN, PCP, pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN ssize_t rem_write ( register fb ifp,
int  x,
int  y,
const unsigned char *  pixelp,
size_t  num 
)

Definition at line 422 of file if_remote.c.

References NET_LONG_LEN, PCP, and pkg_2send().

Here is the call graph for this function:

HIDDEN int rem_readrect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
unsigned char *  pp 
)

Definition at line 446 of file if_remote.c.

References fb_log(), NET_LONG_LEN, PCP, pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN int rem_writerect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
const unsigned char *  pp 
)

Definition at line 476 of file if_remote.c.

References NET_LONG_LEN, PCP, and pkg_2send().

Here is the call graph for this function:

HIDDEN int rem_bwreadrect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
unsigned char *  pp 
)

Definition at line 507 of file if_remote.c.

References fb_log(), NET_LONG_LEN, PCP, pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN int rem_bwwriterect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
const unsigned char *  pp 
)

Definition at line 536 of file if_remote.c.

References NET_LONG_LEN, PCP, and pkg_2send().

Here is the call graph for this function:

HIDDEN int rem_cursor ( fb ifp,
int  mode,
int  x,
int  y 
)

Definition at line 567 of file if_remote.c.

References NET_LONG_LEN, PCP, pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN int rem_getcursor ( fb ifp,
int *  mode,
int *  x,
int *  y 
)

Definition at line 584 of file if_remote.c.

References NET_LONG_LEN, PCP, pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN int rem_setcursor ( fb ifp,
const unsigned char *  bits,
int  xbits,
int  ybits,
int  xorig,
int  yorig 
)

Definition at line 612 of file if_remote.c.

References NET_LONG_LEN, PCP, and pkg_2send().

Here is the call graph for this function:

HIDDEN int rem_view ( fb ifp,
int  xcenter,
int  ycenter,
int  xzoom,
int  yzoom 
)

Definition at line 641 of file if_remote.c.

References NET_LONG_LEN, PCP, pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN int rem_getview ( fb ifp,
int *  xcenter,
int *  ycenter,
int *  xzoom,
int *  yzoom 
)

Definition at line 659 of file if_remote.c.

References NET_LONG_LEN, PCP, pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN int rem_rmap ( register fb ifp,
register ColorMap cmap 
)

Definition at line 683 of file if_remote.c.

References ColorMap::cm_blue, ColorMap::cm_green, ColorMap::cm_red, MSG_DATA, NET_LONG_LEN, PCP, pkg_send(), pkg_waitfor(), and REM_CMAP_BYTES.

Here is the call graph for this function:

HIDDEN int rem_wmap ( register fb ifp,
const ColorMap cmap 
)

Definition at line 705 of file if_remote.c.

References ColorMap::cm_blue, ColorMap::cm_green, ColorMap::cm_red, COLORMAP_NULL, NET_LONG_LEN, PCP, pkg_send(), pkg_waitfor(), and REM_CMAP_BYTES.

Here is the call graph for this function:

HIDDEN int rem_poll ( fb ifp)

Definition at line 735 of file if_remote.c.

References PCP, and pkg_send().

Here is the call graph for this function:

HIDDEN int rem_flush ( fb ifp)

Definition at line 745 of file if_remote.c.

References NET_LONG_LEN, PCP, pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

HIDDEN int rem_help ( fb ifp)

Definition at line 759 of file if_remote.c.

References fb_log(), NET_LONG_LEN, PCP, pkg_send(), and pkg_waitfor().

Here is the call graph for this function:

Variable Documentation

fb remote_interface

Definition at line 788 of file if_remote.c.

Referenced by fb_genhelp(), and fb_open().