Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xpaconvert(7) [debian man page]

xpaconvert(7)							SAORD Documentation						     xpaconvert(7)

NAME
XPAConvert - Converting the XPA API to 2.0 SYNOPSIS
This document describes tips for converting from xpa 1.0 (Xt-based xpa) to xpa 2.0 (socket-based xpa). DESCRIPTION
The following are tips for converting from xpa 1.0 (Xt-based xpa) to xpa 2.0 (socket-based xpa). The changes are straight-forward and almost can be done automatically (we used editor macros for most of the conversion). o The existence of the cpp XPA_VERSION directive to distinguish between 1.0 (where it is not defined) and 2.0 (where it is defined). o Remove the first widget argument from all send and receive server callbacks. Also change first 2 arguments from XtPointer to void *. For example: #ifdef XPA_VERSION static void XPAReceiveFile(client_data, call_data, paramlist, buf, len) void *client_data; void *call_data; char *paramlist; char *buf; int len; #else static void XPAReceiveFile(w, client_data, call_data, paramlist, buf, len) Widget w; XtPointer client_data; XtPointer call_data; char *paramlist; char *buf; int len; #endif o Server callbacks should be declared as returning int instead of void. They now should return 0 for no errors, -1 for error. o The mode flags have changed when defining XPA server callbacks. The old S flag (save buffer) is replaced by freebuf=false. The old E flag (empty buffer is OK) is no longer used (it was an artifact of the X implementation). o Change NewXPACommand() to XPAcmdNew(), with the new calling sequence: xpa = NewXPACommand(toplevel, NULL, prefix, NULL); is changed to: xpa = XPACmdNew(xclass, name); o Change the AddXPACommand() subroutine name to XPACmdAdd (with the same calling sequence): AddXPACommand(xpa, "file", " display a new file requires: filename", NULL, NULL, NULL, XPAReceiveFile, text, NULL); is changed to: XPACmdAdd(xpa, "file", " display a new file requires: filename", NULL, NULL, NULL, XPAReceiveFile, text, NULL); o The XPAXtAppInput() routine should be called just before XtAppMainLoop() to add xpa fds to the Xt event loop: /* add the xpas to the Xt loop */ XPAXtAddInput(app, NULL); /* process events */ XtAppMainLoop(app); o Change NewXPA() to XPANew() and call XPAXtAddInput() if the XtAppMainLoop routine already has been entered: xpa = NewXPA(saotng->xim->toplevel, prefix, xparoot, "FITS data or image filename options: file type", XPASendData, new, NULL, XPAReceiveData, new, "SE"); is changed to: sprintf(tbuf, "%s.%s", prefix, xparoot); xpa = XPANew("SAOTNG", tbuf, "FITS data or image filename options: file type", XPASendData, new, NULL, XPAReceiveData, new, "SE"); XPAXtAddInput(XtWidgetToApplicationContext(saotng->xim->toplevel), xpa); o Change XPAInternalReceiveCommand() to XPACmdInternalReceive() remove first argument in the calling sequence): XPAInternalReceiveCommand(im->saotng->xim->toplevel, im->saotng, im->saotng->commands, "zoom reset", NULL, 0); is changed to: XPACmdInternalReceive(im->saotng, im->saotng->commands, "zoom reset", NULL, 0); o Change DestroyXPA to XPAFree: DestroyXPA(im->dataxpa); is changed to: XPAFree(im->dataxpa); SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpaconvert(7)

Check Out this Related Man Page

xpainfo(3)							SAORD Documentation							xpainfo(3)

NAME
XPAInfo - send short message to one or more XPA servers SYNOPSIS
#include <xpa.h> int XPAInfo(XPA xpa, char *template, char *paramlist, char *mode, char **names, char **messages, int n); DESCRIPTION
Send a short paramlist message 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 XPAInfo() routine does not send data from a buf to the XPA servers. Only the paramlist is sent. The semantics of the paramlist is not formalized, but at a minimum is should tell the server how to get more information. For example, it might contain the class:name of the XPA access point from which the server (acting as a client) can obtain more info using XPAGet. 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 or the server callback sends a message back to the client, then the message will be stored in the associated element of the messages array. The returned message string will be of the form: XPA$ERROR error-message (class:name ip:port) or XPA$MESSAGE message (class:name ip:port) 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 following keywords are recognized: key value default explanation ------ -------- -------- ----------- ack true/false true if false, don't wait for ack from server When ack is false, XPAInfo() will not wait for an error return from the XPA server. This means, in effect, that XPAInfo will send its paramlist string to the XPA server and then exit: no information will be sent from the server to the client. This UDP-like behavior is essential to avoid race conditions in cases where XPA servers are sending info messages to other servers. If two servers try to send each other an info message at the same time and then wait for an ack, a race condition will result and one or both will time out. Example - (void)XPAInfo(NULL, "IMAGE", "ds9 image", NULL, NULL, NULL, 0); SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpainfo(3)
Man Page