/usr/share/doc/xviewg/examples/misc/type_to_string.c is in xview-examples 3.2p1.4-28.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | /*
* a useful library routine for getting the type of an XView object.
* Typical use:
* printf("object is: %s\n", type_to_string(xv_get(obj, XV_TYPE)));
*/
#include <xview/xview.h>
#include <xview/textsw.h>
#include <xview/panel.h>
#include <xview/server.h>
#include <xview/font.h>
#include <xview/svrimage.h>
#include <xview/termsw.h>
#include <xview/ttysw.h>
#include <xview/tty.h>
#include <xview/text.h>
char *
type_to_string(type)
long type;
{
static char *sprintf(), buf[32];
switch (type) {
case CANVAS_TYPE : return "canvas";
case FONT_TYPE : return "font";
case FRAME_TYPE : return "frame";
case ICON_TYPE : return "icon";
case MENU_TYPE : return "menu";
case PANEL_TYPE : return "panel";
case SCREEN_TYPE : return "screen";
case SERVER_IMAGE_TYPE : return "server image";
case TERMSW_TYPE : return "term";
case TERMSW_VIEW_TYPE : return "termsw view";
case TERMSW_MODE_TYPE : return "termsw mode";
case TTYSW_MODE_TYPE : return "ttysw mode";
case TEXTSW_TYPE : return "text subwindow";
case TTY_VIEW_TYPE : return "tty view";
case TTY_TYPE : return "tty";
case WINDOW_TYPE : return "window";
case WIN_MESSAGE_TYPE : return "win message";
default :
return sprintf(buf, "%x: Unknown type", type);
}
}
|