xpacode(7)

✨ NAME ✨

XPACode β€” where to find example/test code πŸ’– (yes bestie, it's literally in the title, we're off to a strong start)


🌸 SYNOPSIS 🌸

okay so the XPA source code directory has two test programs in it: stest.c and ctest.c. They're your little demo besties β€” stest.c shows you how to write an XPA server, and ctest.c shows you how to write an XPA client. They also double as a vibe check for various features of XPA. πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

πŸŽ€ Building the test programs

To build the XPA test programs, you literally just run this:

make All

...in the XPA source directory, and boom πŸ’₯ you get the stest and ctest programs generated. (NB: this should work on all platforms, although we have had problems with unresolved externals on one Sun/Solaris machine, for reasons still unknown. 😭 not the mystery Solaris drama, we still don't know why, and honestly? we may never.)

πŸ‘‘ Playing with stest

Run stest with no arguments and it starts up an XPA server containing these access points:

  • xpa
  • xpa1
  • c_xpa β€” which itself contains the sub-commands cmd1 and cmd2
  • i_xpa

Then you get to hang out with them using xpaset and xpaget, like:

cat xpa.c | xpaset xpa      # send to xpa
cat xpa.c | xpaset "xpa*"   # send to xpa and xpa1
xpaget xpa                  # receive from xpa
xpaget xpa*                 # receive from xpa and xpa1

etc. ✨ You can also use ctest to do the exact same thing, or to iterate, which is where it gets fun:

ctest -s -l 100 xpa        # send to xpa 100 times
ctest -s -l 100 "xpa*"     # send to xpa and xpa1 100 times
ctest -g -l 100 xpa        # receive from xpa 100 times
ctest -g -l 100 "xpa*"     # receive from xpa and xpa1 100 times

More options are available: see the stest.c and ctest.c code itself, which were used extensively to debug XPA. 🫢 no cap, those files carried the whole debugging arc.

🧚 The Tcl side of things

The file test.tcl in the XPA source directory gives examples for using the XPATclInterface. go look, it's cute πŸ’œ


🌈 SEE ALSO 🌈

See xpa(n) for a list of XPA help pages πŸ“š


k that's the whole page bestie, you're officially caught up πŸŽ€βœ¨ this was version 2.1.15, dated July 23, 2013, from SAORD Documentation, and it's filed under xpacode(7) β€” slay, periodt πŸ’…πŸ‘‘