CAPS Universe documentation  1.0.4
All you need to know to be successful
Data Structures | Macros | Functions | Variables
caps-printing-test-client.c File Reference

A simple CAPS client demo. More...

Data Structures

struct  test_client
 
struct  thread_data
 

Macros

#define THREAD_ARRAY_SIZE   10
 

Functions

void sig_handler (int sig)
 
static int create_test_printing_file (int fh)
 
static void * keep_printer_busy (void *param)
 
static size_t find_free_slot (const struct thread_data *threads)
 
static int create_new_client (struct test_client *client, caps_identifier pr_id)
 
static int print_printer_provider_info (struct test_client *client, caps_identifier printer_id)
 
static void notify_thread_about_provider_change (struct thread_data *threads, caps_identifier pr_id)
 
static int notifier_provider_change (void *data, caps_identifier pr_id, struct caps_cl_printer_state *pstate)
 
static void notify_thread_about_job_change (struct thread_data *threads, caps_identifier job_id)
 
static int notifier_job_change (void *data, caps_identifier pr_id, caps_identifier job_id, struct caps_cl_job_state *jstate, struct caps_job_progression *jprogression)
 
int main (void)
 

Variables

static volatile sig_atomic_t quit = 0
 
static caps_identifier pr_id = CAPS_INVALID_IDENTIFIER
 
static struct thread_data threads [10]
 
static const char file_header []
 
static const struct caps_cl_notifier client_notifier
 

Detailed Description

This application is mostly intended for testing purposes.

Note
This file isn't part of NLS and thus, all strings are plain English.

Macro Definition Documentation

◆ THREAD_ARRAY_SIZE

#define THREAD_ARRAY_SIZE   10

Function Documentation

◆ sig_handler()

void sig_handler ( int  sig)

◆ create_test_printing_file()

static int create_test_printing_file ( int  fh)
static
Returns
0 on success. negative value else

◆ keep_printer_busy()

static void * keep_printer_busy ( void *  param)
static

◆ find_free_slot()

static size_t find_free_slot ( const struct thread_data threads)
static

◆ create_new_client()

static int create_new_client ( struct test_client client,
caps_identifier  pr_id 
)
static

◆ print_printer_provider_info()

static int print_printer_provider_info ( struct test_client client,
caps_identifier  printer_id 
)
static

◆ notify_thread_about_provider_change()

static void notify_thread_about_provider_change ( struct thread_data threads,
caps_identifier  pr_id 
)
static

◆ notifier_provider_change()

static int notifier_provider_change ( void *  data,
caps_identifier  pr_id,
struct caps_cl_printer_state pstate 
)
static

◆ notify_thread_about_job_change()

static void notify_thread_about_job_change ( struct thread_data threads,
caps_identifier  job_id 
)
static

◆ notifier_job_change()

static int notifier_job_change ( void *  data,
caps_identifier  pr_id,
caps_identifier  job_id,
struct caps_cl_job_state jstate,
struct caps_job_progression jprogression 
)
static

◆ main()

int main ( void  )

Variable Documentation

◆ quit

volatile sig_atomic_t quit = 0
static

◆ pr_id

◆ threads

struct thread_data threads[10]
static

◆ file_header

const char file_header[]
static
Initial value:
= {
"**CAPS PRINTING TEST FILE**\n"
"#This file contains no useful data\n"
"#and is intended for testing purposes only\n"
}

◆ client_notifier

const struct caps_cl_notifier client_notifier
static
Initial value:
= {
.provider_change = notifier_provider_change,
.job_change = notifier_job_change,
}
static int notifier_job_change(void *data, caps_identifier pr_id, caps_identifier job_id, struct caps_cl_job_state *jstate, struct caps_job_progression *jprogression)
Definition: caps-printing-test-client.c:276
static int notifier_provider_change(void *data, caps_identifier pr_id, struct caps_cl_printer_state *pstate)
Definition: caps-printing-test-client.c:257