Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xpainfonew(3) [debian man page]

xpainfonew(3)							SAORD Documentation						     xpainfonew(3)

NAME
XPAInfoNew - define an XPA info public access point SYNOPSIS
#include <xpa.h> XPA XPAInfoNew(char *class, char *name, int (*info_callback)(), void *info_data, char *info_mode); DESCRIPTION
[NB: this is an experimental interface, new to XPA 2.0, whose value and best use is evolving.] A program can register interest in receiving a short message about a particular topic from any other process that cares to send such a mes- sage. Neither has to be an XPA server. For example, if a user starts to work with a new image file called new.fits, she might wish to alert interested programs about this new file by sending a short message using xpainfo: xpainfo IMAGEFILE /data/new.fits In this example, each process that has used the XPAInfoNew() call to register interest in messages associated with the identifier IMAGEFILE will have its info_callback() executed with the following calling sequence: int info_cb(void *info_data, void *call_data, char *paramlist) { XPA xpa = (XPA)call_data; } The arguments passed to this routine are equivalent to those sent in the send_callback() routine. The main difference is that there is no buf sent to the info callback: this mechanism is meant for short announcement of messages of interest to many clients. The mode string is of the form: "key1=value1,key2=value2,..." The following keywords are recognized: key value default explanation ------ -------- -------- ----------- acl true/false true enable access control Because no buf is passed to this callback, the usual buf-related keywords are not applicable here. The information sent in the parameter list is arbitrary. However, we envision sending information such as file names or XPA access points from which to collect more data. Note that the xpainfo program and the XPAInfo() routine that cause the info_callback to execute do not wait for the callback to complete before returning. SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpainfonew(3)

Check Out this Related Man Page

xpasetfd(3)							SAORD Documentation						       xpasetfd(3)

NAME
XPASetFd - send data from stdin to one or more XPA servers SYNOPSIS
#include <xpa.h> int XPASetFd(XPA xpa, char *template, char *paramlist, char *mode, int fd, char **names, char **messages, int n) DESCRIPTION
Read data from a standard I/O fd and send it to one or more XPA servers whose class:name identifier matches the specified template. A template of the form "class1:name1" is sent to the XPA name server, which returns a list of at most n matching XPA servers. A connection is established with each of these servers and the paramlist string is passed to the server as the data transfer request is initiated. If an XPA struct is passed to the call, then the persistent connections are updated as described above. Otherwise, temporary connections are made to the servers (which will be closed when the call completes). The XPASetFd() routine then reads bytes from the specified fd until EOF and sends these bytes to the XPA servers. The final parameter n specifies the maximum number of servers to contact. A string containing the class:name and ip:port of each server is returned in the name array. If a given server returned an error, then the error message will be stored in the associated element of the messages array. NB: if specified, the name and messages arrays must be of size n or greater. The return value will contain the actual number of servers that were processed. This value thus will hold the number of valid entries in the names and messages arrays, and can be used to loop through these arrays. In names and/or messages is NULL, no information is passed back in that array. The mode string is of the form: "key1=value1,key2=value2,..." The following keywords are recognized: key value default explanation ------ -------- -------- ----------- ack true/false true if false, don't wait for ack from server (after callback completes) verify true/false false send buf from XPASet[Fd] to stdout The ack keyword is useful in cases where one does not want to wait for the server to complete, e.g. is a lot of processing needs to be done on the passed data or when the success of the server operation is not relevant to the client. Example - #include <xpa.h> #define NXPA 10 int i, got; int fd; char *names[NXPA]; char *messages[NXPA]; fd = open(...); got = XPASetFd(NULL, "ds9", "fits", NULL, fd, names, messages, NXPA); for(i=0; i<got; i++){ if( messages[i] != NULL ){ /* error processing */ fprintf(stderr, "ERROR: %s (%s) ", messages[i], names[i]); } if( names[i] ) free(names[i]); if( messages[i] ) free(messages[i]); } SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpasetfd(3)
Man Page