Coverage Report

Created: 2022-10-31 07:00

/src/ghostpdl/psi/zfbcp.c
Line
Count
Source (jump to first uncovered line)
1
/* Copyright (C) 2001-2021 Artifex Software, Inc.
2
   All Rights Reserved.
3
4
   This software is provided AS-IS with no warranty, either express or
5
   implied.
6
7
   This software is distributed under license and may not be copied,
8
   modified or distributed except as expressly authorized under the terms
9
   of the license contained in the file LICENSE in this distribution.
10
11
   Refer to licensing information at http://www.artifex.com or contact
12
   Artifex Software, Inc.,  1305 Grant Avenue - Suite 200, Novato,
13
   CA 94945, U.S.A., +1(415)492-9861, for further information.
14
*/
15
16
17
/* (T)BCP filter creation */
18
#include "memory_.h"
19
#include "ghost.h"
20
#include "oper.h"
21
#include "gsstruct.h"
22
#include "ialloc.h"
23
#include "stream.h"
24
#include "strimpl.h"
25
#include "sbcp.h"
26
#include "ifilter.h"
27
28
/* Define null handlers for the BCP out-of-band signals. */
29
static int
30
no_bcp_signal_interrupt(stream_state * st)
31
1.33k
{
32
1.33k
    return 0;
33
1.33k
}
34
static int
35
no_bcp_request_status(stream_state * st)
36
439
{
37
439
    return 0;
38
439
}
39
40
/* <source> BCPEncode/filter <file> */
41
/* <source> <dict> BCPEncode/filter <file> */
42
static int
43
zBCPE(i_ctx_t *i_ctx_p)
44
0
{
45
0
    return filter_write_simple(i_ctx_p, &s_BCPE_template);
46
0
}
47
48
/* <target> BCPDecode/filter <file> */
49
/* <target> <dict> BCPDecode/filter <file> */
50
static int
51
zBCPD(i_ctx_t *i_ctx_p)
52
0
{
53
0
    stream_BCPD_state state;
54
55
0
    state.signal_interrupt = no_bcp_signal_interrupt;
56
0
    state.request_status = no_bcp_request_status;
57
0
    return filter_read(i_ctx_p, 0, &s_BCPD_template, (stream_state *)&state, 0);
58
0
}
59
60
/* <source> TBCPEncode/filter <file> */
61
/* <source> <dict> TBCPEncode/filter <file> */
62
static int
63
zTBCPE(i_ctx_t *i_ctx_p)
64
0
{
65
0
    return filter_write_simple(i_ctx_p, &s_TBCPE_template);
66
0
}
67
68
/* <target> TBCPDecode/filter <file> */
69
/* <target> <dict> TBCPDecode/filter <file> */
70
static int
71
zTBCPD(i_ctx_t *i_ctx_p)
72
290
{
73
290
    stream_BCPD_state state;
74
75
290
    state.signal_interrupt = no_bcp_signal_interrupt;
76
290
    state.request_status = no_bcp_request_status;
77
290
    return filter_read(i_ctx_p, 0, &s_TBCPD_template, (stream_state *)&state, 0);
78
290
}
79
80
/* ------ Initialization procedure ------ */
81
82
const op_def zfbcp_op_defs[] =
83
{
84
    op_def_begin_filter(),
85
    {"1BCPEncode", zBCPE},
86
    {"1BCPDecode", zBCPD},
87
    {"1TBCPEncode", zTBCPE},
88
    {"1TBCPDecode", zTBCPD},
89
    op_def_end(0)
90
};