home *** CD-ROM | disk | FTP | other *** search
- /* Dec 1990 (userutl.h) Version 4.00 */
-
- /************************************************************************
- * Copyright(C) 1988-1990 NeuralWare Inc
- * Penn Center West, IV-227, Pittsburgh, PA 15276
- *
- * All rights reserved. No part of this program may be reproduced,
- * stored in a retrieval system, or transmitted, in any form or by any
- * means, electronic, mechanical, photocopying, recording or otherwise
- * without the prior written permission of the copyright owner,
- * NeuralWare, Inc.
- ************************************************************************
- */
-
- #include "host.h"
-
- #ifdef __ZTC__
- #ifndef DLC
- #define DLC 1
- #endif
- #endif
-
- #ifdef THINK_C /* No command line for Think C */
- #ifndef MAC
- #define MAC 1
- #endif
- #include <stdio.h>
- #endif
-
- #ifdef MAC
- #undef UNIX
- #endif
-
- #ifdef DLC
- #undef UNIX
- #endif
-
- #ifdef XTM
- struct sem {
- int semval;
- };
- struct sembuf{
- int sem_num;
- int sem_op;
- int sem_flg;
- };
- #endif
-
- #ifdef UNIX
- #if defined(RS6) || defined(XTM)
-
- #define SEMTYPE struct sem
-
- #else
-
- #if defined(EWS) || defined(VAXULT)
- typedef union {
- int val;
- struct semid_ds *buf;
- ushort *array;
- } SEMTYPE;
-
- #define semval val /* for "arg.val" */
-
- #else
- #define SEMTYPE union semun
- #define semval val /* for "arg.val" */
- #endif
-
- #endif
-
- #endif /* UNIX */
-
- #if defined(THINK_C)
- #define NEW_LINE ((int)'\r')
- #define NEW_LINE_STR "\r"
- #else /* THINK_C */
- #define NEW_LINE ((int)'\n')
- #define NEW_LINE_STR "\n"
- #endif /* THINK_C */
-
- /* Request codes for commands from NeuralWorks */
-
- #define RQ_LEARNIN 1 /* training input */
- #define RQ_LEARNOUT 2 /* training desired output */
- #define RQ_LEARNRSLT 6 /* training result */
- #define RQ_READ 3 /* operational input */
- #define RQ_WRITE 4 /* operational output */
- #define RQ_WRSTEP 10 /* interim output (Hopfield/BAM) */
- #define RQ_LSTART 7 /* start learning */
- #define RQ_RSTART 8 /* start recall */
- #define RQ_LEND 14 /* end learning */
- #define RQ_REND 15 /* end recall */
- #define RQ_TERM 5 /* terminate */
- #define RQ_ATTENTION 9 /* unsolicited request for attention */
- #define RQ_REWIND 11 /* rewind input file */
- #define RQ_INSTRUM 13 /* output data from instrument */
- #define RQ_RCLTST 16 /* Recall Test */
- #define RQ_EXPLAIN 17 /* Explain output */
-
- /* the following definitions are for requests to NeuralWorks */
-
- #define UGX_DATA 0 /* responded to data */
- #define UGX_GETDS 1 /* get a string from dialog area */
- #define UGX_PUTDS 2 /* put a string to dialog area */
- #define UGX_SAVENET 3 /* save the network */
- #define UGX_GRPARM 4 /* get x-size, y-size, ncolors */
- #define UGX_CLEAR 5 /* clear a window's contents */
- #define UGX_DELETE 6 /* delete a window */
- #define UGX_WINDOW 7 /* set up a window */
- #define UGX_LINE 8 /* draw a line */
- #define UGX_POINT 9 /* draw a point */
- #define UGX_BOX 10 /* draw an outline box */
- #define UGX_BOXF 11 /* draw a filled box */
- #define UGX_PUTS 12 /* put a string in a window */
- #define UGX_MOUSE 13 /* read mouse position / buttons */
- #define UGX_RDPOINT 14 /* read a point */
- #define UGX_RDNETINF 15 /* read network info */
- #define UGX_GETINSTRT 16 /* Get instrument title */
-
- /* the following are ONLY for requests from user control routines */
-
- #define UGX_LOADNET 17 /* load a network */
- #define UGX_LEARN 18 /* learn */
- #define UGX_RECALL 19 /* recall */
- #define UGX_MSGIO 20 /* message I/O */
-
- /* Additional features for accessing network data */
-
- #define UGX_PEIO 25 /* PE read/write */
- #define UGX_SCHDIO 26 /* L/R Schedule R/W */
- #define UGX_CTRIO 27 /* Super-Layer Ctrs R/W */
-
- /* The following codes are for faster graphics where fewer context
- switches are needed */
-
- #define UGX_BLIT 21 /* blit an array to the screen*/
- #define UGX_PBLIT 24 /* blit a single-color pattern to scrn */
-
- /* New features added for Pruning */
-
- #define UGX_WTSTATS 22 /* weight statistics */
- #define UGX_PRUNE 23 /* prune network */
-
- #ifndef NPHIST
- #define NPHIST 100 /* # of items in histogram */
- #endif
-
- /* mouse button bit definitions for "ug_mouse" */
-
- #define MBUT_RIGHT 0x04 /* right mouse button */
- #define MBUT_MIDDLE 0x02 /* middle mouse button */
- #define MBUT_LEFT 0x01 /* left mouse button */
-
- /************************************************************************
- * *
- * Graphics menu interface header file *
- * *
- ************************************************************************
- These structures and defines are included for convience as part of the
- graphics interface used by several of the User I/O examples. They are
- not necessary to the operation of the program.
-
- The GMENU structure defines the basic parameters for a menu. Menu
- items (which go ACROSS the screen) are defined in an array of
- GMENU_ITEM structures.
- */
-
- typedef struct { /* Graphics menu item */
- int code; /* menu item code */
- char *text; /* line of text for menu item */
- char *text2; /* auxillary line of text for menu item */
- int flag;
- #define GM_HILITE 0x0001 /* item highlighted */
- #define GM_LOCKED 0x0002 /* item locked */
- int x0,y0,x1,y1; /* interior box (for highlighting) */
- int xt, yt; /* x,y coords of text */
- } GMENU_ITEM;
-
-
- typedef struct { /* Graphics menu - horizontal line of items */
- GMENU_ITEM *item; /* pointer to array of items */
- int num_items; /* number of menu items */
- int key; /* window key */
- int flag;
- #define GM_AUX 0x0001 /* Set if auxillary line of text */
- int x0, y0; /* BL of menu relative to window */
- int x1, y1; /* TR of menu relative to BL */
- } GMENU;
-
- #define GM_MARGIN 2 /* text margin in y direction */
-
-
- extern int gm_intcolor; /* interior color */
- extern int gm_outcolor; /* outline color */
- extern int gm_txtcolor; /* text color */
-
-
- #ifdef PROTOTYPING
- /* --- prototypes --- */
- extern InitGMenu(GMENU *,int,int ); /* Initialize a menu */
- extern DispGMenu( GMENU * ); /* Display menu */
- extern DispGItem(GMENU *,GMENU_ITEM *,int,int ); /* Display menu item */
- extern GMENU_ITEM *LookGMenu( GMENU *, int * ); /* Look at menu */
- #else
- extern GMENU_ITEM *LookGMenu(); /* look at menu */
- #endif
-
- #ifndef UIO_STRC_H
- #include "uio_strc.h"
- #endif
-
- #include "uio_reqs.pro"
-