xpacode(n)
π 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:
xpaxpa1c_xpa(containing sub-commandscmd1andcmd2)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
- fedora 43: xpa-devel 2.1.20-9.fc43 Β· MIT
- fedora 43: xpa-devel 2.1.20-9.fc43 Β· MIT
- fedora 44: xpa-devel 2.1.20-10.fc44 Β· MIT
- fedora 44: xpa-devel 2.1.20-10.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms