Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!deimos.cis.ksu.edu!uxc!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!uxe.cso.uiuc.edu!spirit From: spirit@uxe.cso.uiuc.edu Newsgroups: comp.sys.hp Subject: HP GKS GESC_FILDES question? Message-ID: <47500008@uxe.cso.uiuc.edu> Date: 10 May 89 18:40:00 GMT Lines: 70 Nf-ID: #N:uxe.cso.uiuc.edu:47500008:000:1678 Nf-From: uxe.cso.uiuc.edu!spirit May 10 13:40:00 1989 Does anybody out there use HP-GKS? We want to be able to let users make pictures and print them. (GASP! What a concept.) To do this you have to have a file descriptor for the open workstation you are using. To get this file descriptor you need to call a special "escape" function: gescape. Here's the catch: one of the parameters you must supply to gescape is the file descriptor. So according to HP to determine the file descriptor you must already know the file descriptor. Brilliant! Here is the full test code. If anyone has had any luck with (or use for) the gescape(fildes,GESC_FILDES,&arg1,&arg2) call please let me know. John Kemp -------------------------------------- University of Illinois Department of Atmospheric Sciences kemp%atmos.uiuc.edu@uxc.cso.uiuc.edu -------------------------------------- /* * test hpgks GESC_FILDES call */ #include #include #include #define NBYTES 0 #define ERROUT stderr #define CONID 4 #define WSTYP 4 int i,fildes; /* set to 3 if you want it to "work" */ gescape_arg arg1, arg2; main() { /* * Open the workstation and GKS */ gopks( ERROUT, NBYTES ); gopwk( 1, CONID, WSTYP ); gacwk( 1 ); /* * Call gescape to determine active file descriptor */ arg1.i[0] = 1; arg1.i[1] = -1; gescape(fildes,GESC_FILDES,&arg1,&arg2); #ifdef DEBUG printf("arg1.i[0] %d \n",arg1.i[0]); printf("arg1.i[1] %d \n",arg1.i[1]); printf("arg2.i[0] %d \n",arg2.i[0]); printf("arg2.i[1] %d \n",arg2.i[1]); #endif /* * Close the workstation and shut down GKS. */ gdawk ( 1 ); gclwk ( 1 ); gclks(); }