Using PUPS/P3
Home Introduction Successes Examples Download Install Documentation Discussion Acknowledgments


Example of a PUPS/P3 server application sources

Here are a couple of examples of PUPS/P3 server applications, which will show you just how easy it is to incorporate PUPS/P3 functionality into your code. In fact, in order to take advantage of PUPS/P3 builtin functionality you only need to add four function calls to your program:

  1. psrp_ignore_requests() which disables the interprocess communication interface during initialisation

  2. std_init() which initialises the PUPS/P3 environment (providing generic PUPS/P3 API etc)

  3. psrp_accept_requests() which enables the interprocess communication interface once initialisation is complete

    A skeleton code skelpapp.c (which forms the basis of a PUPS/P3 application) and a more concrete code example embryo.c are included for you to look at.

  4. pups_exit() which cleanly exits the application



Example of a PUPS/P3 dynamic link library source

In addition to monotlithic pre-compiled applications, PUPS/P3 also supports dynamic link libraries (DLLs) which are implemented via the POSIX dl interface). 

An example DLL is included here

Making a DLL is easy. Just define a set of orifice functions using the example as a template. Then type gcc -c dll.o dll.c followed by share dll.o dll.so. share is a utility which generated shared libraries (.so files from object (.o) files. share is linker dependent, the version shipped with the standard PUPS/P3 distribution is at present COFF/ ELF specific and will not run on Darwin which uses a radically different linking scheme.


PUPS/P3 (c) Mark A. O'Neill 2007