CAPS Universe documentation  1.0.4
All you need to know to be successful
libcapsppd-api.h
Go to the documentation of this file.
1#pragma once
2
3/*
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 *
6 * (c) 2018 Juergen Borleis <projects@caps-printing.org>
7 *
8 * This library is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU Lesser General Public License as published by the Free
10 * Software Foundation; either version 2.1 of the License, or (at your option)
11 * any later version.
12 */
13
14#include <stddef.h>
15#include <stdbool.h>
16#include <features.h>
17
18#include <libcapsbase.h>
19#include <libcapstable.h>
20#include <libcapsppd.h>
21
22__BEGIN_DECLS
23
50#define LIBCAPSPPD_MAJOR 1
52#define LIBCAPSPPD_MINOR 3
54#define LIBCAPSPPD_MICRO 0
63void caps_libppd_version_get(unsigned *major, unsigned *minor, unsigned *micro) __nonnull();
152 const char *keyword;
154 const char *name;
156 const char *description;
158 const char *value;
161};
171void caps_libppd_init(void);
196int caps_ppd_options_table_file_read(struct caps_ppd_options_table *pot, const char *ppd_file_name) __nonnull();
206struct caps_ppd_option *caps_ppd_option_get(const struct caps_ppd_options_table *pot, const char *keyword) __nonnull();
217struct caps_ppd_option *caps_ppd_option_with_name_get(const struct caps_ppd_options_table *pot, const char *keyword, const char *name) __nonnull((1,2));
229void caps_ppd_option_add(struct caps_ppd_options_table *pot, const char *keyword, const char *name, const char *description, const char *value) __nonnull((1,2));
264 const char *manufacturer;
265 const char *product;
266 const char *model;
267 const char *nick;
268 const char *short_nick;
269};
283void caps_ppd_info_generate(struct caps_ppd_options_table *db, FILE *ppd_file, const struct caps_ppd_device_info *prod_info, const struct caps_ppd_base *cpb) __nonnull((1,2,4));
292int caps_ppd_paper_format_validate(const char *paper_name) __nonnull();
302struct caps_rect caps_ppd_paper_format_size_get(const char *paper_name) __nonnull();
314const char *caps_ppd_paper_format_name_get(const struct caps_rect *size) __nonnull();
330__END_DECLS
#define __returns_nonnull
Definition: libcapsbase.h:141
#define __nonnull(params)
Definition: libcapsbase.h:84
void caps_ppd_options_table_clean_up(struct caps_ppd_options_table *pot)
Definition: libcapsppd.c:223
void caps_ppd_info_generate(struct caps_ppd_options_table *db, FILE *ppd_file, const struct caps_ppd_device_info *prod_info, const struct caps_ppd_base *cpb)
Definition: libcapsppd-generator.c:1463
int caps_ppd_options_table_file_read(struct caps_ppd_options_table *pot, const char *ppd_file_name)
Definition: libcapsppd-scanner.c:671
const char * caps_ppd_paper_format_name_get(const struct caps_rect *size)
Definition: libcapsppd.c:355
size_t caps_ppd_options_table_element_count_get(const struct caps_ppd_options_table *pot)
Definition: libcapsppd.c:245
int caps_ppd_paper_format_validate(const char *paper_name)
Definition: libcapsppd.c:268
struct caps_ppd_options_table * caps_ppd_options_table_create(void)
Definition: libcapsppd.c:211
struct caps_rect caps_ppd_paper_format_size_get(const char *paper_name)
Definition: libcapsppd.c:279
void caps_ppd_option_add(struct caps_ppd_options_table *pot, const char *keyword, const char *name, const char *description, const char *value)
Definition: libcapsppd.c:194
void caps_libppd_init(void)
Definition: libcapsppd.c:72
const char * caps_ppd_paper_default_format_get(void)
Definition: libcapsppd.c:378
struct caps_ppd_option * caps_ppd_option_with_name_get(const struct caps_ppd_options_table *pot, const char *keyword, const char *name)
Definition: libcapsppd.c:177
struct caps_ppd_option * caps_ppd_option_get(const struct caps_ppd_options_table *pot, const char *keyword)
Definition: libcapsppd.c:162
struct caps_ppd_options_table * caps_ppd_options_table_duplicate(const struct caps_ppd_options_table *src)
Definition: libcapsppd.c:254
const struct caps_ppd_option * caps_ppd_options_table_base_get(const struct caps_ppd_options_table *pot)
Definition: libcapsppd.c:240
void caps_libppd_version_get(unsigned *major, unsigned *minor, unsigned *micro)
Definition: libcapsppd.c:93
Basic API for everything else of the CAPS universe.
Data declaration to handle PPD file information.
Manage variable arrays.
Basic description of common features a printing device/printing driver can provide.
Definition: libcapsppd.h:322
Some printer device product specific information to be used inside the PPD.
Definition: libcapsppd-api.h:263
const char * nick
Definition: libcapsppd-api.h:267
const char * product
Definition: libcapsppd-api.h:265
const char * short_nick
Definition: libcapsppd-api.h:268
const char * manufacturer
Definition: libcapsppd-api.h:264
const char * model
Definition: libcapsppd-api.h:266
Structure to keep the information read-in from an external PPD files.
Definition: libcapsppd-api.h:151
const char * keyword
Definition: libcapsppd-api.h:152
const char * description
Definition: libcapsppd-api.h:156
const char * value
Definition: libcapsppd-api.h:158
const char * name
Definition: libcapsppd-api.h:154
Manage the content of a PPD file.
Definition: libcapsppd-local.h:70
Defines a simple rectangle by its width and length in floating point values.
Definition: libcapsbase.h:338
Definition: libcapsppd-scanner.c:95