GESCAPE(3NCARG)
β¨ NAME β¨
gescape β the lil escape hatch for all your non-standard GKS needs, bestie π
π¦ DESCRIPTION π¦
okay so picture this: gescape (aka Escape) is the standard way to do the non-standard stuff in GKS. it's giving "official backdoor" energy. and NCAR GKS is lowkey minimal about it β there are only two user-accessible escape functions defined at all:
- one for changing the name of a metafile π
- one for pausing inside an X window βΈοΈ
that's it. that's the whole menu. no cap.
πΈ SYNOPSIS πΈ
#include <ncarg/gks.h>
void gescape(Gint func_id, const Gescape_in_data *in_data, Gstore
*store_data,Gescape_out_data **out_data);
π DESCRIPTION (yes, again, the parameters this time) π
func_id(Input) β the function identifier tellinggescapewhich activity you want. the legal values are"-1391"for changing a metafile name, and"-1396"for effecting a pause in an X window. memorize those two numbers, they're your besties fr fr.in_data.escape_r1.size(size_t, Input) β size of the input data record array (the input data record is described right below, keep scrolling π«Ά).in_data.escape_r1.data(void *, Input) β the input data record itself. here's the tea:- if you're calling
gescapewithfunc_idequal to-1391, this record should be a character string holding the metafile name you want, left justified and blank filled β¨ - if you're calling
gescapewithfunc_idequal to-1396, this record should be a character string holding the workstation identifier, encoded as a five character number.
- if you're calling
store_data(void *, Input) β storage for output data. not currently in use for NCAR GKS. she's just sitting there, being a vibe πout_data.escape_r1.size(size_t, Output) β size of the output data record array. also not currently in use for NCAR GKS. πout_data.escape_r1.data(void *, Output) β the output data record. yep, you guessed it: not currently in use for NCAR GKS. three for three.
π USAGE π
the sizes of the data records must always be at least "1" in value. don't come at her with a zero, she will not be accepting that. π
π EXAMPLES π
so gescape can dynamically change the name of an output metafile β iconic β and to pull that off you should use the calls gopen_gks and gopen_ws instead of c_opngks. but if you are using c_opngks, no worries bestie, go check the man page for setusv(3NCARG) for changing the name of the metafile.
to change the name of the output metafile inside your program, you should make a call similar to this one:
int str_len = 12;
Gescape_in_data in_data;
gopen_gks("stdout",0);
in_data.escape_r1.data = (Gdata *)malloc(str_len*sizeof(char));
strcpy(in_data.escape_r1.data, "new.cgm.name" );
in_data.escape_r1.size = str_len;
gescape(-1391,&in_data,NULL,NULL);
β οΈ the call togescapeto change the metafile name must always occur just before the call togopen_wsthat opens a CGM workstation. timing is everything, periodt.
π¨ also: setting the environment variableNCARG_GKS_OUTPUToverrides any attempt to change the name of an output metafile via agescapecall. she said "I'm the main character now."
see the "User's Guide for NCAR GKS-0A Graphics" for a more complete example of changing metafile names from within a code. π
okay and here's an example of a piece of code that will create an X window, draw a line, and then pause waiting for a mouse click or a key click. obsessed with the drama of it:
Gescape_in_data in_data;
int str_len = 5;
gopen_gks("stdout",0);
gopen_ws(3,NULL,8);
gactivate_ws(3);
c_line(0.,0.,1.,1.);
c_sflush();
in_data.escape_r1.data = (Gdata *)malloc(str_len*sizeof(char));
strcpy(in_data.escape_r1.data, " 3" );
in_data.escape_r1.size = str_len;
gescape(-1396,&in_data,NULL,NULL);
gdeactivate_ws(3);
gclose_ws(3);
gclose_gks();
ngl, the functions c_frame and c_ngpict are in general much easier to use and more flexible than the direct ESCAPE call for pausing in an X window. it is suggested that those functions be used. take the easy road, queen. π
π₯ ACCESS π₯
to use the GKS C-binding routines, load the ncarg_gks and ncarg_c libraries. load 'em up, you got this. πͺ
π SEE ALSO π
Online: setusv(3NCARG), frame(3NCARG), ngpict(3NCARG), gks(3NCARG), ncarg_gks_cbind(3NCARG)
Hardcopy: User's Guide for NCAR GKS-0A Graphics; NCAR Graphics Fundamentals, UNIX Version
π COPYRIGHT π
Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.
and that's the whole page, bestie!! this little love letter dropped way back in March 1993 under the UNIX manual, straight from NCAR GRAPHICS β GESCAPE(3NCARG), slay forever. go forth and escape responsibly π¦β¨π
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms