CAPS Universe documentation  1.0.4
All you need to know to be successful
Features
Client side API description

Talk to the printing coordinator from the client side. More...

Features

 Version info
 Info for user's code to do the right thing.
 
 Be part of the whole thing
 Connect to the Printing Coordinator.
 
 Deal with printers
 Retrieve available printers and their state.
 
 Receive state change notifiers
 The Printing Coordinator calls back.
 
 Error message handling
 How to deal with error messages.
 
 Print documents
 Commit documents to print and monitor their print progression.
 

Detailed Description

Intended to gain access to printers and printing documents.

Intended audience

Application developers

Overview

This library and its API is at most a thin layer to enable applications to communicate with the CAPS printing coordinator. You shouldn't do this by your own, even if it currently uses DBUS via libdbus as the communication channel (which may change in the future).

Use pkg-config

Don't try to be smart, use pkg-config instead to retrieve the information you need to compile and link your application against libcapsclient.

To compile your code, just include its header:

#include <libcapsclient.h>
Printer and printing access for clients.

And ask pkg-config what include path is required to find this header file.

pkg-config --cflags libcapsclient

To link your application against libcapsclient ask pkg-config as well. Use the output of this command to parametrize the linker:

pkg-config --libs libcapsclient
Note
Whenever you call a function from libcapsclient in your application you also must link it against libcapsclient. Different libraries you use may already be linked against libcapsclient, but that does not work for your application when the linker option --as-needed is in use (which is the default in the CAPS universe).

Use autotools

Don't invent your own Makefile to build your package. Use the autotools or something similar to manage your buildsystem.

For the autotools just use the PKG_CHECK_MODULES m4 macro in your configure.ac to get the information you need to use libcapsclient:

PKG_CHECK_MODULES([LIBCAPSCLIENT], [libcapsclient >= 1])
Attention
Select the required version carefully, e.g. the lowest version which meets your demands.

And then just refer this information in your Makefile.am:

my_application_CXXLAGS = \
     @LIBCAPSCLIENT_CFLAGS@
my_application_CFLAGS = \
     @LIBCAPSCLIENT_CFLAGS@
my_application_LDADD = \
     @LIBCAPSCLIENT_LIBS@
Note
my_application_CXXLAGS for C++ language and my_application_CFLAGS for C language