xpacode(n)

πŸ“¦ version 2.1.20, in fedora 43, fedora 44

πŸ’– XPACode: Where to Find Example/Test Code πŸ’–

okay bestie, welcome to xpacode(n) β€” this is the SAORD Documentation page that tells you where the actual, real-life example code lives. no gatekeeping here, we're sharing the goods 🫢


✨ SYNOPSIS ✨

so the XPA source code directory is literally holding two test programs for you: stest.c and ctest.c. they're your blueprint for writing XPA servers and clients respectively β€” like, stest.c shows you server energy, ctest.c shows you client energy. and bonus: you can also use them to test various features of XPA. two jobs, one iconic duo πŸ‘‘


🌸 DESCRIPTION 🌸

first things first, to build the XPA test programs, you gotta run this:

make All

in the XPA source directory, and boom πŸ’₯ that generates the stest and ctest programs.

NB: this should work on all platforms, although we have had problems with unresolved externals on one Sun/Solaris machine, for reasons still unknown. 😭 we don't know why. it just did that. mystery behavior fr fr.

πŸŽ€ running stest

the stest program can be executed with no arguments to start an XPA server that contains these access points:

  • xpa
  • xpa1
  • c_xpa (containing sub-commands cmd1 and cmd2)
  • i_xpa

then you can use xpaset and xpaget to interact with these access points, like so:

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. πŸ’… (the * wildcard is doing the most and we love her for it)


πŸ¦‹ running ctest

you also can use ctest to do the same thing, or to iterate β€” and honestly, iterating is where the drama happens:

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

like, 100 times?? she's committed. main character energy fr. 🌈


🧚 more options & the tcl moment

more options are available: see the stest.c and ctest.c code itself, which were used extensively to debug XPA. (iykyk β€” the source code is the real manual sometimes πŸ’€)

and finally, the file test.tcl in the XPA source directory gives examples for using the XPATclInterface. tcl besties, this one's for you πŸŽ€


🌟 SEE ALSO 🌟

  • See xpa(n) for a list of XPA help pages

version 2.1.15 Β· July 23, 2013 β€” yeah she's an elder but she still ate, periodt. thanks for reading bestie, now go build something slay πŸ’–βœ¨πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from