1xpacmdnew(3)                  SAORD Documentation                 xpacmdnew(3)
2
3
4

NAME

6       XPACmdNew: create a new XPA public access point for commands
7

SYNOPSIS

9         #include <xpa.h>
10
11         XPA XPACmdNew(char *class, char *name);
12

DESCRIPTION

14       Create a new XPA public access point for commands that will share a
15       common identifier class:name. Enter this access point into the XPA name
16       server, so that it can be accessed by external processes.  XPACmdNew()
17       returns an XPA struct.
18
19       It often is more convenient to have one public access point that can
20       manage a number of commands, rather than having individual access
21       points for each command. For example, it is easier to command the ds9
22       image display using:
23
24         echo "colormap I8"   | xpaset ds9
25         echo "scale log"     | xpaset ds9
26         echo "file foo.fits" | xpaset ds9
27
28       then to use:
29
30         echo "I8"       | xpaset ds9_colormap
31         echo "log"      | xpaset ds9_scale
32         echo "foo.fits" | xpaset ds9_file
33
34       In the first case, the commands remain the same regardless of the
35       target XPA name.  In the second case, the command names must change for
36       each instance of ds9.  That is, if a second instance of ds9 called DS9
37       were running, it would be commanded either as:
38
39         echo "colormap I8"   | xpaset DS9
40         echo "scale log"     | xpaset DS9
41         echo "file foo.fits" | xpaset DS9
42
43       or as:
44
45         echo "I8"       | xpaset DS9_colormap
46         echo "log"      | xpaset DS9_scale
47         echo "foo.fits" | xpaset DS9_file
48
49       Thus, in cases where a program is going to manage many commands, it
50       generally is easier to define them as commands associated with the
51       XPACmdNew() routine, rather than as separate access points using
52       XPANew().
53
54       When XPACmdNew() is called, only the class:name identifier is
55       specified.  Each sub-command is subsequently defined using the
56       XPACmdAdd() routine.
57

SEE ALSO

59       See xpa(n) for a list of XPA help pages
60
61
62
63version 2.1.15                   July 23, 2013                    xpacmdnew(3)
Impressum