File: cmp.shtml

package info (click to toggle)
cupsys 1.0.4-12
  • links: PTS
  • area: main
  • in suites: potato
  • size: 9,988 kB
  • ctags: 12,841
  • sloc: ansic: 110,263; makefile: 684; sh: 222; lisp: 60
file content (717 lines) | stat: -rw-r--r-- 18,117 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
<HTML>
<HEAD>
	<META NAME="DOCNUMBER" CONTENT="CUPS-CMP-1.0">
	<META NAME="COPYRIGHT" CONTENT="Copyright 1997-1999, All Rights Reserved">
	<META NAME="Author" CONTENT="Easy Software Products">
	<TITLE>CUPS Configuration Management Plan</TITLE>
</HEAD>
<BODY>

<H1>Scope</H1>

<H2>Identification</H2>

This configuration management plan document provides the guidelines for
development and maintainance of the Common UNIX Printing System ("CUPS")
Version 1.0 software.

<H2>System Overview</H2>

The Common UNIX Printing System provides a portable printing layer for 
UNIX&reg; operating systems. It has been developed by Easy Software 
Products to promote a standard printing solution for all UNIX vendors 
and users. CUPS provides the System V and Berkeley command-line interfaces.

<P>CUPS uses the Internet Printing Protocol (IETF-IPP) as the basis
for managing print jobs and queues. The Line Printer Daemon (LPD,
RFC1179), Server Message Block (SMB), and AppSocket protocols are also
supported with reduced functionality.

<P>CUPS adds network printer browsing and PostScript Printer
Description (&quot;PPD&quot;)-based printing options to support real
world applications under UNIX.

<P>CUPS also includes a customized version of GNU GhostScript
(currently based off GNU GhostScript 4.03) and an image file RIP that
can be used to support non-PostScript printers.

<H2>Document Overview</H2>

This configuration management document is organized into the following
sections:

<UL>
	<LI>1 - Scope</LI>
	<LI>2 - References</LI>
	<LI>3 - File Management</LI>
	<LI>4 - Trouble Report Processing</LI>
	<LI>5 - Software Releases</LI>
	<LI>A - Glossary</LI>
	<LI>B - Coding Requirements</LI>
</UL>

<H1>References</H1>

<H2>CUPS Documentation</H2>

The following CUPS documentation is referenced by this document:

<UL>
	<LI>CUPS-CMP-1.0: CUPS Configuration Management Plan 
	<LI>CUPS-IDD-1.0: CUPS System Interface Design Description 
	<LI>CUPS-SAM-1.0.x: CUPS Software Administrators Manual 
	<LI>CUPS-SDD-1.0: CUPS Software Design Description 
	<LI>CUPS-SPM-1.0: CUPS Software Programming Manual
	<LI>CUPS-SSR-1.0: CUPS Software Security Report 
	<LI>CUPS-STP-1.0: CUPS Software Test Plan 
	<LI>CUPS-SUM-1.0.x: CUPS Software Users Manual 
	<LI>CUPS-SVD-1.0.x: CUPS Software Version Description 
</UL>

<H2>Other Documents</H2>

The following non-CUPS documents are referenced by this document:

<UL>
	<LI>IEEE 1387.4, System Administration: Printing (draft) 
	<LI>IPP/1.0: Additional Optional Operations - Set 1
	<LI>RFC 1179, Line Printer Daemon Protocol 
	<LI>RFC 2565, IPP/1.0: Encoding and Transport 
	<LI>RFC 2566, IPP/1.0: Model and Semantics
	<LI>RFC 2639, IPP/1.0: Implementers Guide
</UL>

<H1>File Management</H1>

<H2>Directory Structure</H2>

Each source file shall be placed a sub-directory corresponding to the software
sub-system it belongs to ("scheduler", "libcups", etc.) To remain compatible
with older UNIX filesystems, directory names shall not exceed 16 characters
in length.

<H2>Source Files</H2>

Source files shall be documented and formatted as described in Appendix
B, Coding Requirements.

<H2>Configuration Management</H2>

Source files shall be placed under the control of the Concurrent Versions
System ("CVS") software. Source files shall be "checked in" with each change
so that modifications can be tracked.

<P>Documentation on the CVS software is included with the whitepaper, "CVS
II: Parallelizing Software Development".

<H1>Trouble Report Processing</H1>

A Software Trouble Report ("STR") shall be submitted every time a user
or vendor experiences a problem with the CUPS software. Trouble reports
are maintained in a database with one of the following states:

<OL>
	<LI>STR is closed with complete resolution</LI>
	<LI>STR is closed without resolution</LI>
	<LI>STR is active</LI>
	<LI>STR is pending (new STR or additional information available)</LI>
</OL>

Trouble reports shall be processed using the following steps.

<H2>Classification</H2>

When a trouble report is received it must be classified at one of the following
levels:

<OL>
	<LI>Request for enhancement</LI>
	<LI>Documentation error</LI>
	<LI>Unable to print a file</LI>
	<LI>Unable to print to a printer</LI>
	<LI>Unable to print at all</LI>
</OL>

The scope of the problem should also be determined as:

<OL>
	<LI>Specific to a machine</LI>
	<LI>Specific to an operating system</LI>
	<LI>Applies to all machines and operating systems</LI>
</OL>

<H2>Identification</H2>

Once the level and scope of the trouble report is determined the software
sub-system(s) involved with the problem are determined. This may involve
additional communication with the user or vendor to isolate the problem
to a specific cause.

<P>When the sub-system(s) involved have been identified, an engineer will
then determine the change(s) needed and estimate the time required for
the change(s).

<H2>Correction</H2>

Corrections are scheduled based upon the severity and complexity of the
problem. Once all changes have been made, documented, and tested successfully
a new software release snapshot is generated. Additional tests are added
as necessary for proper testing of the changes.

<H2>Notification</H2>

The user or vendor is notified when the fix is available or if the problem
was caused by user error.

<H1>Software Releases</H1>

<H2>Version Numbering</H2>

CUPS uses a three-part version number separated by periods to represent
the major, minor, and patch release numbers:

<UL>
<PRE>
major.minor.patch
1.0.0
</PRE>
</UL>

Beta-test releases are indentified by appending the letter B followed by
the build number:

<UL>
<PRE>
major.minor.patchbbuild
1.0.0b1
</PRE>
</UL>

A CVS snapshot is generated for every beta and final release and uses
the version number preceded by the letter "v" and with the decimal
points replaced by underscores:

<UL>
<PRE>
v1_0_0b1
v1_0_0
</PRE>
</UL>

Each change that corrects a fault in a software sub-system increments the
patch release number. If a change affects the software design of CUPS then
the minor release number will be incremented and the patch release number
reset to 0. If CUPS is completely redesigned the major release number will
be incremented and the minor and patch release numbers reset to 0:

<UL>
<PRE>
1.0.0b1    First beta release
1.0.0b2    Second beta release
1.0.0      First production release
1.0.1b1    First beta of 1.0.1
1.0.1      Production release of 1.0.1
1.1.0b1    First beta of 1.1.0
1.1.0      Production release of 1.1.0
2.0.0b1    First beta of 2.0.0
2.0.0      Production release of 2.0.0
</PRE>
</UL>

<H2>Generation</H2>

Software releases shall be generated for each successfully completed software
trouble report. All object and executable files shall be deleted prior
to performing a full build to ensure that source files are recompiled.

<H2>Testing</H2>

Software testing shall be conducted according to the CUPS Software Test
Plan, CUPS-STP-1.0. Failed tests cause STRs to be generated to correct
the problems found.

<H2>Release</H2>

When testing has been completed successfully a new distribution image is
created from the current CVS code "snapshot". No production release shall
contain software that has not passed the appropriate software tests.

<H1 TYPE=A VALUE=1>Glossary</H1>

<H2>Terms</H2>

<DL>

	<DT>C
	<DD>A computer language.

	<DT>parallel
	<DD>Sending or receiving data more than 1 bit at a time.

	<DT>pipe
	<DD>A one-way communications channel between two programs.

	<DT>serial
	<DD>Sending or receiving data 1 bit at a time.

	<DT>socket
	<DD>A two-way network communications channel.

</DL>

<H2>Acronyms</H2>

<DL>

	<DT>ASCII
	<DD>American Standard Code for Information Interchange

	<DT>CUPS
	<DD>Common UNIX Printing System

	<DT>ESC/P
	<DD>EPSON Standard Code for Printers

	<DT>FTP
	<DD>File Transfer Protocol

	<DT>HP-GL
	<DD>Hewlett-Packard Graphics Language

	<DT>HP-PCL
	<DD>Hewlett-Packard Printer Control Language

	<DT>HP-PJL
	<DD>Hewlett-Packard Printer Job Language

	<DT>IETF
	<DD>Internet Engineering Task Force

	<DT>IPP
	<DD>Internet Printing Protocol

	<DT>ISO
	<DD>International Standards Organization

	<DT>LPD
	<DD>Line Printer Daemon

	<DT>MIME
	<DD>Multimedia Internet Mail Exchange

	<DT>PCL
	<DD>Page Control Language

	<DT>PPD
	<DD>PostScript Printer Description

	<DT>SMB
	<DD>Server Message Block

	<DT>TFTP
	<DD>Trivial File Transfer Protocol

</DL>

<H1>Coding Requirements</H1>

These coding requirements provide detailed information on source file
formatting and documentation content. These guidelines shall be applied
to all C and C++ source files provided with CUPS.

<H2>Source Files</H2>

<H3>Naming</H3>

All source files names shall be 16 characters or less in length to
ensure compatibility with older UNIX filesystems. Source files
containing functions shall have an extension of ".c" for ANSI C and
".cpp" for C++ source files. All other "include" files shall have an
extension of ".h".

<H3>Documentation</H3>

The top of each source file shall contain a header giving the name of the
file, the purpose or nature of the source file, the copyright and licensing
notice, and the functions contained in the file.  The file name and revision
information is provided by the CVS "$Id: cmp.shtml,v 1.4 1999/09/22 20:06:18 mike Exp $" tag:

<UL>
<PRE>
/*
 * "$Id: cmp.shtml,v 1.4 1999/09/22 20:06:18 mike Exp $"
 *
 *   Description of file contents.
 *
 *   Copyright 1997-1999 by Easy Software Products, all rights
 *   reserved.
 *
 *   These coded instructions, statements, and computer programs are
 *   the property of Easy Software Products and are protected by
 *   Federal copyright law.  Distribution and use rights are outlined
 *   in the file "LICENSE.txt" which should have been included with
 *   this file.  If this file is missing or damaged please contact
 *   Easy Software Products at:
 *
 *       Attn: CUPS Licensing Information
 *       Easy Software Products
 *       44145 Airport View Drive, Suite 204
 *       Hollywood, Maryland 20636-3111 USA
 *
 *       Voice: (301) 373-9603
 *       EMail: cups-info@cups.org
 *         WWW: http://www.cups.org
 *
 * Contents:
 *
 *   function1() - Description 1.
 *   function2() - Description 2.
 *   function3() - Description 3.
 */
</PRE>
</UL>

The bottom of each source file shall contain a trailer giving the name
of the file using the CVS "$Id: cmp.shtml,v 1.4 1999/09/22 20:06:18 mike Exp $" tag. The primary purpose of this is to
mark the end of a source file; if the trailer is missing it is possible
that code has been lost near the end of the file:

<UL>
<PRE>
/*
 * End of "$Id: cmp.shtml,v 1.4 1999/09/22 20:06:18 mike Exp $".
 */
</PRE>
</UL>

<H2>Functions</H2>

<H3>Naming</H3>

Functions with a global scope shall be capitalized ("DoThis", "DoThat",
"DoSomethingElse", etc.) The only exception to this rule shall be the
CUPS interface library functions which may begin with a prefix word in
lowercase ("cupsDoThis", "cupsDoThat", etc.)

<P>Functions with a local scope shall be declared "static" and be lowercase
with underscores between words ("do_this", "do_that", "do_something_else",
etc.)

<H3>Documentation</H3>

Each function shall begin with a comment header describing what the function
does, the possible input limits (if any), and the possible output values
(if any), and any special information needed:

<UL>
<PRE>
/*
 * 'do_this()' - Compute y = this(x).
 *
 * Notes: none.
 */

static float     /* O - Inverse power value, 0.0 &lt;= y &lt;= 1.0 */
do_this(float x) /* I - Power value (0.0 &lt;= x &lt;= 1.0) */
{
 ...
 return (y);
}
</PRE>
</UL>

<H2>Methods</H2>

<H3>Naming</H3>

Methods shall be in lowercase with underscores between words ("do_this",
"do_that", "do_something_else", etc.)

<H3>Documentation</H3>

Each method shall begin with a comment header describing what the method
does, the possible input limits (if any), and the possible output values
(if any), and any special information needed:

<UL>
<PRE>
/*
 * 'class::do_this()' - Compute y = this(x).
 *
 * Notes: none.
 */

float                   /* O - Inverse power value, 0.0 &lt;= y &lt;= 1.0 */
class::do_this(float x) /* I - Power value (0.0 &lt;= x &lt;= 1.0) */
{
 ...
 return (y);
}
</PRE>
</UL>

<H2>Variables</H2>

<H3>Naming</H3>

Variables with a global scope shall be capitalized ("ThisVariable",
"ThatVariable", "ThisStateVariable", etc.) The only exception to this
rule shall be the CUPS interface library global variables which must
begin with the prefix "cups" ("cupsThisVariable", "cupsThatVariable",
etc.) Global variables shall be replaced by function arguments whenever
possible.

<P>Variables with a local scope shall be lowercase with underscores between
words ("this_variable", "that_variable", etc.) Any local variables shared
by functions within a source file shall be declared "static".

<H3>Documentation</H3>

Each variable shall be declared on a separate line and shall be immediately
followed by a comment block describing the variable:

<UL><PRE>
int this_variable;   /* The current state of this */
int that_variable;   /* The current state of that */
</PRE></UL>

<H2>Types</H2>

<H3>Naming</H3>

All type names shall be lowercase with underscores between words and
"_t" appended to the end of the name ("this_type_t", "that_type_t",
etc.)

<H3>Documentation</H3>

Each type shall have a comment block immediately before the typedef:

<UL>
<PRE>
/*
 * This type is for CUPS foobar options.
 */
typedef int cups_this_type_t;
</PRE>
</UL>

<H2>Structures</H2>

<H3>Naming</H3>

All structure names shall be lowercase with underscores between words and
"_str" appended to the end of the name ("this_struct_str", "that_struct_str",
etc.)

<H3>Documentation</H3>

Each structure shall have a comment block immediately before the struct
and each member shall be documented in accordance with the variable naming
policy above:

<UL>
<PRE>
/*
 * This structure is for CUPS foobar options.
 */
struct cups_this_struct_str
{
  int this_member;   /* Current state for this */
  int that_member;   /* Current state for that */
};
</PRE>
</UL>

<H2>Classes</H2>

<H3>Naming</H3>

All class names shall be lowercase with underscores between words
("this_class", "that_class", etc.)

<H3>Documentation</H3>

Each class shall have a comment block immediately before the class
and each member shall be documented in accordance with the variable naming
policy above:

<UL>
<PRE>
/*
 * This class is for CUPS foobar options.
 */
class cups_this_class
{
  int this_member;   /* Current state for this */
  int that_member;   /* Current state for that */
};
</PRE>
</UL>

<H2>Constants</H2>

<H3>Naming</H3>

All constant names shall be uppercase with underscored between words
("THIS_CONSTANT", "THAT_CONSTANT", etc.) Constants defined for the CUPS
interface library must begin with an uppercase prefix
("CUPS_THIS_CONSTANT", "CUPS_THAT_CONSTANT", etc.)

<P>Typed enumerations shall be used whenever possible to allow for type
checking by the compiler.

<H3>Documentation</H3>

Comment blocks shall immediately follow each constant:

<UL>
<PRE>
enum
{
  CUPS_THIS_TRAY,   /* This tray */
  CUPS_THAT_TRAY    /* That tray */
};
</PRE>
</UL>

<H2>Code</H2>

<H3>Documentation</H3>

All source code shall utilize block comments within functions to describe
the operations being performed by a group of statements:

<UL>
<PRE>
/*
 * Clear the state array before we begin...
 */

for (i = 0; i &lt; (sizeof(array) / sizeof(sizeof(array[0])); i ++)
  array[i] = STATE_IDLE;

/*
 * Wait for state changes...
 */

do
{
  for (i = 0; i &lt; (sizeof(array) / sizeof(sizeof(array[0])); i ++)
    if (array[i] != STATE_IDLE)
      break;

  if (i == (sizeof(array) / sizeof(array[0])))
    sleep(1);
} while (i == (sizeof(array) / sizeof(array[0])));
</PRE>
</UL>

<H3>Style</H3>

<H4 TYPE="a">Indentation</H4>

All code blocks enclosed by brackets shall begin with the opening brace
on a new line. The code then follows starting on a new line after the brace
and is indented 2 spaces. The closing brace is then placed on a new line
following the code at the original indentation:

<UL>
<PRE>
{
  int i; /* Looping var */

 /*
  * Process foobar values from 0 to 999...
  */

  for (i = 0; i &lt; 1000; i ++)
  {
    do_this(i);
    do_that(i);
  }
}
</PRE>
</UL>

Single-line statements following "do", "else", "for", "if", and "while"
shall be indented 2 spaces as well. Blocks of code in a "switch" block
shall be indented 4 spaces after each "case" and "default" case:

<UL>
<PRE>
switch (array[i])
{
  case STATE_IDLE :
      do_this(i);
      do_that(i);
      break;
  default :
      do_nothing(i);
      break;
}
</PRE>
</UL>

<H4>Spacing</H4>

A space shall follow each reserved word ("if", "while", etc.) Spaces shall
not be inserted between a function name and the arguments in parenthesis.

<H4>Return Values</H4>

Parenthesis shall surround values returned from a function using "return":

<UL>
<PRE>
return (STATE_IDLE);
</PRE>
</UL>

<H4>Loops</H4>

Whenever convenient loops should count downward to zero to improve program
performance:

<UL>
<PRE>
for (i = sizeof(array) / sizeof(array[0]) - 1; i >= 0; i --)
  array[i] = STATE_IDLE;
</PRE>
</UL>

<H1 ALIGN=RIGHT>Software Trouble Report Form</H1>

<CENTER><TABLE WIDTH="80%">
<TR>
	<TH ALIGN=RIGHT>Summary of Problem:</TH>
	<TD ALIGN=LEFT>________________________________________</TD>
</TR>

<TR>
	<TH ALIGN=RIGHT>Problem Severity:</TH>
	<TD ALIGN=LEFT>__1=RFE
	<BR>__2=Documentation-Error
	<BR>__3=Unable-to-Print-a-File
	<BR>__4=Unable-to-Print-to-a-Printer
	<BR>__5=Unable-to-Print-at-All</TD>
</TR>

<TR>
	<TH ALIGN=RIGHT>Problem Scope:</TH>
	<TD ALIGN=LEFT>__1=Machine __2=Operating-System __3=All</TD>
</TR>

<TR>
	<TH ALIGN=RIGHT VALIGN=TOP>Detailed Description of Problem:</TH>
	<TD ALIGN=LEFT>________________________________________ 
	<BR>________________________________________ 
	<BR>________________________________________ 
	<BR>________________________________________ 
	<BR>________________________________________ 
	<BR>________________________________________</TD>
</TR>
</TABLE></CENTER>

</BODY>
</HTML>