]> git.ipfire.org Git - thirdparty/cups.git/blame - ppdc/ppdc-shared.cxx
Merge CUPS 1.4svn-r7319.
[thirdparty/cups.git] / ppdc / ppdc-shared.cxx
CommitLineData
ac884b6a
MS
1//
2// "$Id$"
3//
4// Shared data class for the CUPS PPD Compiler.
5//
6// Copyright 2007 by Apple Inc.
7// Copyright 2002-2005 by Easy Software Products.
8//
9// These coded instructions, statements, and computer programs are the
10// property of Apple Inc. and are protected by Federal copyright
11// law. Distribution and use rights are outlined in the file "LICENSE.txt"
12// which should have been included with this file. If this file is
13// file is missing or damaged, see the license at "http://www.cups.org/".
14//
15// Contents:
16//
17// ppdcShared::ppdcShared() - Create shared data.
18// ppdcShared::~ppdcShared() - Destroy shared data.
19// ppdcShared::get() - Increment the use count for this data.
20// ppdcShared::release() - Decrement the use count and delete as needed.
21//
22
23//
24// Include necessary headers...
25//
26
27#include "ppdc.h"
28
29
30//
31// 'ppdcShared::ppdcShared()' - Create shared data.
32//
33
34ppdcShared::ppdcShared()
35{
36 use = 1;
37}
38
39
40//
41// 'ppdcShared::~ppdcShared()' - Destroy shared data.
42//
43
44ppdcShared::~ppdcShared()
45{
46}
47
48
49//
50// 'ppdcShared::get()' - Increment the use count for this data.
51//
52
53void
54ppdcShared::get(void)
55{
56 use ++;
57}
58
59
60//
61// 'ppdcShared::release()' - Decrement the use count and delete as needed.
62//
63
64void
65ppdcShared::release(void)
66{
67 use --;
68 if (!use)
69 delete this;
70}
71
72
73//
74// End of "$Id$".
75//