CAPS Universe documentation  1.0.4
All you need to know to be successful
Data Fields
doc_page_range_entry Struct Reference

Data Fields

unsigned first
 
unsigned last
 

Detailed Description

Define one page range to print. The first member is always the first page to print in this range. It is never '0'. The last member describes various scenarious:

Note
The library ensures the last member is never smaller then the first member (exception is the last = 0 with a special meaning)

Example:

Someone defines this list of page ranges: "1-4,7,9-12,28-"

This will result into four page range entries:

[0] = { .first = 1, .last = 4, }
[1] = { .first = 7, .last = 0, }
[2] = { .first = 9, .last = 12, }
[3] = { .first = 28, .last = UINT_MAX, }

Special case page range is "-12":

[0] = { .first = 1, .last = 12, }

More special page range is: "1-4,-12":

[0] = { .first = 1, .last = 4, }
[1] = { .first = 5, .last = 12, }

More special page range is: "1-4,-3":

[0] = { .first = 1, .last = 4, }
[1] = { .first = 1, .last = 3, } // TODO to be checked

And these two entries get then merged into one entry

Attention
Don't merge these entries! Think about double sided manual print on a simplex printer!
[0] = { .first = 1, .last = 12, }
Bug:

Bad case: 7-8,2-3,6-7,3-4

Bad case: 8-10,15-22 on a 10 pages document

Field Documentation

◆ first

unsigned first

First page to print in this range, always greater then '0'

◆ last

unsigned last

Last page to print in this range. Can be:

  • '0', which means print the first page only
  • a number greater than first defines the last page to print in this range
  • or UINT_MAX to print everything up to the end

The documentation for this struct was generated from the following file: