aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rwxr-xr-xinfo/behead12
-rw-r--r--info/fdl.texinfo505
-rw-r--r--info/libgamma.texinfo479
-rwxr-xr-xinfo/texise16
-rw-r--r--libgamma.7262
-rwxr-xr-xsrc/extract/cut46
-rwxr-xr-xsrc/extract/libgamma-error-extract26
-rwxr-xr-xsrc/extract/libgamma-method-extract120
9 files changed, 267 insertions, 1204 deletions
diff --git a/Makefile b/Makefile
index 9d64823..c8338f5 100644
--- a/Makefile
+++ b/Makefile
@@ -150,6 +150,8 @@ HDR =\
set_ramps_fun.h\
$(HDR_METHODS)
+MAN7 = libgamma.7
+
all: libgamma.a libgamma.$(LIBEXT) test
$(OBJ): $(@:.o=.c) $(HDR)
@@ -186,11 +188,13 @@ test: test.o libgamma.a
install: libgamma.a libgamma.$(LIBEXT)
mkdir -p -- "$(DESTDIR)$(PREFIX)/lib/"
mkdir -p -- "$(DESTDIR)$(PREFIX)/include/"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man7/"
cp -- libgamma.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBMINOREXT)"
ln -sf -- libgamma.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBMAJOREXT)"
ln -sf -- libgamma.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBEXT)"
cp -- libgamma.a "$(DESTDIR)$(PREFIX)/lib/"
cp -- libgamma.h "$(DESTDIR)$(PREFIX)/include/"
+ cp -- $(MAN7) "$(DESTDIR)$(MANPREFIX)/man7/"
uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBMAJOREXT)"
@@ -198,6 +202,7 @@ uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/lib/libgamma.$(LIBEXT)"
-rm -f -- "$(DESTDIR)$(PREFIX)/lib/libgamma.a"
-rm -f -- "$(DESTDIR)$(PREFIX)/include/libgamma.h"
+ -cd -- "$(DESTDIR)$(MANPREFIX)/man7/" && rm -f -- $(MAN7)
clean:
-rm -f -- *.o *.lo *.su *.a *.$(LIBEXT) test config.h
diff --git a/info/behead b/info/behead
deleted file mode 100755
index 9bd4ced..0000000
--- a/info/behead
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env sh
-# See LICENSE file for copyright and license details.
-
-beheading="$1"
-
-data="$(cat)"
-lines="$(echo "${data}" | wc -l)"
-lines=$(expr ${lines} - ${beheading} )
-
-if test $lines -gt 0; then
- echo "$(echo "${data}" | tail -n ${lines})"
-fi
diff --git a/info/fdl.texinfo b/info/fdl.texinfo
deleted file mode 100644
index cb71f05..0000000
--- a/info/fdl.texinfo
+++ /dev/null
@@ -1,505 +0,0 @@
-@c The GNU Free Documentation License.
-@center Version 1.3, 3 November 2008
-
-@c This file is intended to be included within another document,
-@c hence no sectioning command or @node.
-
-@display
-Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
-@uref{http://fsf.org/}
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@enumerate 0
-@item
-PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document @dfn{free} in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of ``copyleft'', which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-@item
-APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The ``Document'', below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as ``you''. You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A ``Modified Version'' of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A ``Secondary Section'' is a named appendix or a front-matter section
-of the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall
-subject (or to related matters) and contains nothing that could fall
-directly within that overall subject. (Thus, if the Document is in
-part a textbook of mathematics, a Secondary Section may not explain
-any mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The ``Invariant Sections'' are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
-Sections then there are none.
-
-The ``Cover Texts'' are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A ``Transparent'' copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text. A copy that is not ``Transparent'' is called ``Opaque''.
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, La@TeX{} input
-format, SGML or XML using a publicly available
-DTD, and standard-conforming simple HTML,
-PostScript or PDF designed for human modification. Examples
-of transparent image formats include PNG, XCF and
-JPG. Opaque formats include proprietary formats that can be
-read and edited only by proprietary word processors, SGML or
-XML for which the DTD and/or processing tools are
-not generally available, and the machine-generated HTML,
-PostScript or PDF produced by some word processors for
-output purposes only.
-
-The ``Title Page'' means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, ``Title Page'' means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-The ``publisher'' means any person or entity that distributes copies
-of the Document to the public.
-
-A section ``Entitled XYZ'' means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language. (Here XYZ stands for a
-specific section name mentioned below, such as ``Acknowledgements'',
-``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
-of such a section when you modify the Document means that it remains a
-section ``Entitled XYZ'' according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-@item
-VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-@item
-COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-@item
-MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-@enumerate A
-@item
-Use in the Title Page (and on the covers, if any) a title distinct
-from that of the Document, and from those of previous versions
-(which should, if there were any, be listed in the History section
-of the Document). You may use the same title as a previous version
-if the original publisher of that version gives permission.
-
-@item
-List on the Title Page, as authors, one or more persons or entities
-responsible for authorship of the modifications in the Modified
-Version, together with at least five of the principal authors of the
-Document (all of its principal authors, if it has fewer than five),
-unless they release you from this requirement.
-
-@item
-State on the Title page the name of the publisher of the
-Modified Version, as the publisher.
-
-@item
-Preserve all the copyright notices of the Document.
-
-@item
-Add an appropriate copyright notice for your modifications
-adjacent to the other copyright notices.
-
-@item
-Include, immediately after the copyright notices, a license notice
-giving the public permission to use the Modified Version under the
-terms of this License, in the form shown in the Addendum below.
-
-@item
-Preserve in that license notice the full lists of Invariant Sections
-and required Cover Texts given in the Document's license notice.
-
-@item
-Include an unaltered copy of this License.
-
-@item
-Preserve the section Entitled ``History'', Preserve its Title, and add
-to it an item stating at least the title, year, new authors, and
-publisher of the Modified Version as given on the Title Page. If
-there is no section Entitled ``History'' in the Document, create one
-stating the title, year, authors, and publisher of the Document as
-given on its Title Page, then add an item describing the Modified
-Version as stated in the previous sentence.
-
-@item
-Preserve the network location, if any, given in the Document for
-public access to a Transparent copy of the Document, and likewise
-the network locations given in the Document for previous versions
-it was based on. These may be placed in the ``History'' section.
-You may omit a network location for a work that was published at
-least four years before the Document itself, or if the original
-publisher of the version it refers to gives permission.
-
-@item
-For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
-the Title of the section, and preserve in the section all the
-substance and tone of each of the contributor acknowledgements and/or
-dedications given therein.
-
-@item
-Preserve all the Invariant Sections of the Document,
-unaltered in their text and in their titles. Section numbers
-or the equivalent are not considered part of the section titles.
-
-@item
-Delete any section Entitled ``Endorsements''. Such a section
-may not be included in the Modified Version.
-
-@item
-Do not retitle any existing section to be Entitled ``Endorsements'' or
-to conflict in title with any Invariant Section.
-
-@item
-Preserve any Warranty Disclaimers.
-@end enumerate
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled ``Endorsements'', provided it contains
-nothing but endorsements of your Modified Version by various
-parties---for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-@item
-COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled ``History''
-in the various original documents, forming one section Entitled
-``History''; likewise combine any sections Entitled ``Acknowledgements'',
-and any sections Entitled ``Dedications''. You must delete all
-sections Entitled ``Endorsements.''
-
-@item
-COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-@item
-AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an ``aggregate'' if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-@item
-TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled ``Acknowledgements'',
-``Dedications'', or ``History'', the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-@item
-TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense, or distribute it is void, and
-will automatically terminate your rights under this License.
-
-However, if you cease all violation of this License, then your license
-from a particular copyright holder is reinstated (a) provisionally,
-unless and until the copyright holder explicitly and finally
-terminates your license, and (b) permanently, if the copyright holder
-fails to notify you of the violation by some reasonable means prior to
-60 days after the cessation.
-
-Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, receipt of a copy of some or all of the same material does
-not give you any rights to use it.
-
-@item
-FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-@uref{http://www.gnu.org/copyleft/}.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License ``or any later version'' applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation. If the Document
-specifies that a proxy can decide which future versions of this
-License can be used, that proxy's public statement of acceptance of a
-version permanently authorizes you to choose that version for the
-Document.
-
-@item
-RELICENSING
-
-``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
-World Wide Web server that publishes copyrightable works and also
-provides prominent facilities for anybody to edit those works. A
-public wiki that anybody can edit is an example of such a server. A
-``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
-site means any set of copyrightable works thus published on the MMC
-site.
-
-``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
-license published by Creative Commons Corporation, a not-for-profit
-corporation with a principal place of business in San Francisco,
-California, as well as future copyleft versions of that license
-published by that same organization.
-
-``Incorporate'' means to publish or republish a Document, in whole or
-in part, as part of another Document.
-
-An MMC is ``eligible for relicensing'' if it is licensed under this
-License, and if all works that were first published under this License
-somewhere other than this MMC, and subsequently incorporated in whole
-or in part into the MMC, (1) had no cover texts or invariant sections,
-and (2) were thus incorporated prior to November 1, 2008.
-
-The operator of an MMC Site may republish an MMC contained in the site
-under CC-BY-SA on the same site at any time before August 1, 2009,
-provided the MMC is eligible for relicensing.
-
-@end enumerate
-
-@page
-@heading ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
-@smallexample
-@group
- Copyright (C) @var{year} @var{your name}.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.3
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
- Texts. A copy of the license is included in the section entitled ``GNU
- Free Documentation License''.
-@end group
-@end smallexample
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with@dots{}Texts.''@: line with this:
-
-@smallexample
-@group
- with the Invariant Sections being @var{list their titles}, with
- the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
- being @var{list}.
-@end group
-@end smallexample
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
-
-@c Local Variables:
-@c ispell-local-pdict: "ispell-dict"
-@c End:
diff --git a/info/libgamma.texinfo b/info/libgamma.texinfo
index c0e96cb..3094e95 100644
--- a/info/libgamma.texinfo
+++ b/info/libgamma.texinfo
@@ -1,474 +1,3 @@
-\input texinfo @c -*-texinfo-*-
-
-@c %%**start of header
-@setfilename libgamma.info
-@settitle libgamma
-@afourpaper
-@documentencoding UTF-8
-@documentlanguage en
-@finalout
-@c %%**end of header
-
-
-@dircategory Library
-@direntry
-* libgamma: (libgamma). Display server abstraction layer for gamma ramp adjustments
-@end direntry
-
-
-@copying
-Copyright @copyright{} 2014, 2015 Mattias Andr@'ee
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
-Texts. A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
-@end quotation
-@end copying
-
-%>set -u
-%>cd src/extract
-%>export PATH=".:../../info:${PATH}"
-
-@ifnottex
-@node Top
-@top libgamma -- Display server abstraction layer for gamma ramp adjustments
-@insertcopying
-@end ifnottex
-
-@titlepage
-@title libgamma
-@subtitle Display server abstraction layer for gamma ramp adjustments
-@author by Mattias Andr@'e (maandree)
-
-@page
-@c @center `'
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-@contents
-
-
-
-@menu
-* Overview:: Brief overview of @command{libgamma}.
-* Jargon:: The jargon of @command{libgamma}.
-* Compiling:: Configuring, compiling and installing @command{libgamma}.
-* Linking:: Linking your software to @command{libgamma}.
-* API:: @command{libgamma}'s advanced programming interface.
-* GNU Free Documentation License:: Copying and sharing this manual.
-@end menu
-
-
-
-@node Overview
-@chapter Overview
-
-@command{libgamma} is a C library that aims to
-abstract away the display server when adjusting
-the colours curves for monitors via gamma ramps,
-and to be cross-platform.
-
-@command{libgamma} have support for the X RandR
-(Resize and Rotate) extension, the X VidMode
-extension and under Linux the Direct Rendering
-Manager which lets software work with graphics
-outside of graphical environments. Additionally
-@command{libgamma} have support for Windows
-Graphics Device Interface (Windows GDI) under
-Windows and Quartz using CoreGraphics under OS X.
-However Windows GDI and Quartz/CoreGraphics do
-not receive first-party testing on their target
-platforms but do receive first-party testing
-using a compatibility layer that translates
-the calls to RandR calls. Neither does
-@command{libgamma}, currently, receive testing
-on any of the BSD:s, it is only tested on GNU/Linux.
-
-Furthermore @command{libgamma} provides a dummy
-method that can be used to ignore adjustments
-and can be controlled from another program to
-pretend like the environment has changed. This
-can be used test how well your software handles
-such events. It can also be configured at runtime
-to use another adjustment method such as RandR.
-
-
-
-@node Jargon
-@chapter Jargon
-
-@command{libgamma} uses a small jargon,
-parts of which is loaned from X.org,
-and some is commonly used jargon.
-
-@table @asis
-@item adjustment method [libgamma]
-A combination of the display server
-and a protocol used to tell to the
-display server.
-
-@item display server [X.org]
-The program used to display graphical
-elements to the monitors. In @command{libgamma}
-we also call the non-graphical environment
-a display server.
-
-@item display [X.org]
-@itemx site [libgamma]
-An instance of a display server.
-Non-graphical environment are only
-covered by `site'.
-
-@item screen [X.org]
-A group of CRTC:s within a display.
-
-@item CRTC
-@itemx cathode ray tube controller
-Controller for the output on monitor.
-Mapping from CRTC:s to encoders is an injection.
-
-@item monitor
-The physical medium used to display
-text and graphics.
-
-@item partition [libgamma]
-Umbrella term for `screen' and
-`graphics card'.
-
-@item page [libgamma]
-The desktop workspace or virtual
-terminal that is displayed on a CRTC.
-(This jargon is not currently used,
-but is reserved for future features.)
-
-@item output [X.org]
-A connector and its encoder.
-
-@item connector
-Physical port on the graphics card where
-a monitor can be plugged in. If and only
-if the connector is disabled it does not
-have a port and does not have a CRTC.
-
-@item encoder
-Translation layer between CRTC:s and connectors.
-
-@item gamma ramp
-@itemx colour curve
-A lookup table that translates an encoded
-value for a subpixel into its output value.
-
-@item subpixel
-@itemx colour channel
-One of the three colours that makes up a pixel:
-red, green or blue.
-
-@item gamma ramp size
-@itemx gamma stops
-The number of possible values on the encoding
-axis of a gamma ramp.
-
-@end table
-
-
-
-@node Compiling
-@chapter Compiling
-
-The build @command{libgamma} you will need
-to run @command{./configure} before you
-run @command{make}. @file{./configure} is
-not a configuration script from the GNU build
-system, rather it is just a simple shell script.
-Each adjustment method needs selected, if none
-are selected no adjustment method will be compiled
-into @command{libgamma}. They can either be
-selected explicitly and independently or by
-operating system.
-
-@table @option
-@item --enable-dummy
-Enables the dummy adjustment method.
-
-@item --enable-randr
-@itemx --linux
-@itemx --bsd
-Enables the X RandR extension adjustment method.
-
-@item --enable-vidmode
-@itemx --linux
-@itemx --bsd
-Enables the X VidMode extension adjustment method.
-
-@item --enable-drm
-@itemx --linux
-Enables the Direct Rendering Manager adjustment method.
-
-@item --enable-w32gdi
-@itemx --windows
-Enables the Windows GDI adjustment method.
-
-@item --enable-quartz
-@itemx --mac-os-x
-Enables the Quartz/CoreGraphics adjustment method.
-
-@item --enable-w32gdi=fake
-Enables the Windows GDI adjustment method using
-compatibility layer to either RandR or ``/dev/null''
-depending on whether RandR is enabled or not.
-
-@item --enable-quartz=fake
-Enables the Quartz/CoreGraphics adjustment method
-using a compatibility layer to either RandR or
-``/dev/null'' depending on whether RandR is
-enabled or not.
-
-@end table
-
-You may prefix anything to `bsd', for example
-@option{--freebsd} or @option{--openbsd}. Any
-prefix will be discard, but it may be a good
-idea incase there will be a difference in the
-future between the platforms.
-
-Developers of @command{libgamma} and developers
-who use @command{libgamma} for their software may
-also want to use @option{--debug} which enables
-extra checks to produce better error reports.
-Additionally @option{--debug} adds the @option{-Og -g}
-flags to the C compiler rather than @option{-Ofast}.
-Developers can also use the developer options
-instead of @option{--debug}, the adjustment and
-operating systems.
-
-@table @option
-@item --linux=developer
-@itemx --developer
-Enables all adjustment methods, with compatibility
-layers for Windows GDI and Quartz/CoreGraphics.
-Also enables @option{--debug}.
-
-@item --bsd=developer
-Enables all adjustment methods, except the Linux
-Direct Rendering Manager adjustment method, with
-compatibility layers for Windows GDI and
-Quartz/CoreGraphics.
-Also enables @option{--debug}.
-
-@item --windows=developer
-Enables the dummy adjustment method and the
-Windows GDI adjustment method.
-Also enables @option{--debug}.
-
-@item --mac-os-x=developer
-Enables the dummy adjustment method and the
-Quartz/CoreGraphics adjustment method.
-Also enables @option{--debug}.
-@end table
-
-Configuring with @option{--windows} or
-@option{--windows=developer} will also add
-configurations to the make script needed
-to compile for Windows. @option{--mac-os-x} or
-@option{--mac-os-x=developer} will do add
-configurations to the make script needed
-to compile for OS X.
-
-When you have configured @command{libgamma}
-using @command{./configure} you can compile
-the library with @command{make}. Straight up
-@command{make} without additions options
-should be all you need. But you can also use
-specify some build rules.
-
-@table @option
-@item default
-Builds the library, the test and the info manual.
-
-@item all
-Builds the library, the test and manual to all
-available formats: info, PDF, DVI, PostScript.
-
-@item lib
-Builds the library.
-
-@item test
-Builds the test, which in turns builts the library.
-
-@item doc
-Builds the manual to all available formats:
-info, PDF, DVI, PostScript.
-
-@item info
-Builds the info manual.
-
-@item pdf
-Builds the PDF manual.
-
-@item dvi
-Builds the DVI manual.
-
-@item ps
-Builds the PostScript manual.
-
-@end table
-
-You can also use @command{make clean}
-to remove all compiled files, and
-@command{make distclean} to remove
-all compiled files and the files
-generated by @command{./configure}.
-
-To install @command{libgamma} once
-it is compiled run @command{make install}
-and then @command{make uninstall} once
-you want to uninstall the library.
-When running @command{make install}
-include the option @option{DESTDIR="$@{pkgdir@}"},
-where @file{$@{pkgdir@}} is the directory
-you want the files to be installed to
-instead of @file{/}, this could for example
-be @file{/mnt} where you have mounted another
-installed operating system or a temporary
-location used by the package manager.
-This is also a set of options to specify
-how the system's file system hierarchy is
-structured.
-
-@table @option
-@item PREFIX
-The package path prefix, if you want to install
-to another root, set @option{DESTDIR} to that root.
-Defaults to @file{/usr}.
-
-@item LIB
-The library path excluding prefix.
-Defaults to @file{/lib}.
-
-@item INCLUDE
-The library header path excluding prefix.
-Defaults to @file{/include}.
-
-@item DATA
-The resource path excluding prefix.
-Defaults to @file{/share}.
-
-@item LIBDIR
-The library path including prefix.
-Defaults to @file{$(PREFIX)$(LIB)}.
-
-@item INCLUDEDIR
-The library header including prefix
-Defaults to @file{$(PREFIX)$(INCLUDE)}.
-
-@item DATADIR
-The resource path including prefix.
-Defaults to @file{$(PREFIX)$(DATA)}.
-
-@item DOCDIR
-The generic documentation path including prefix.
-Defaults to @file{$(DATADIR)/doc}.
-
-@item INFODIR
-The info manual documentation path including prefix.
-Defaults to @file{$(DATADIR)/info}.
-
-@item LICENSEDIR
-The license base path including prefix.
-Defaults to @file{$(DATADIR)/licenses}
-@end table
-
-There is also an option to specify the package name
-of the library: @option{PKGNAME}. This only affects
-the name and location of files installed into
-@option{DOCDIR}, @option{INFODIR} and @option{LICENSEDIR}.
-It does not affect the name of the library.
-
-For more control on what should be installed,
-subsitute @option{install} from @command{make install}
-for one or more of the following rules:
-
-@table @option
-@item install
-Macro for @option{install-base} and @option{install-info}.
-Installs everything but only the manual in the info format.
-@command{install-info} will not be execute the install the
-manual to the @file{dir} file for @command{info}.
-
-@item install-all
-Macro for @option{install-base} and @option{install-doc}.
-Installs everything including all available formats of the manual.
-@command{install-info} will not be execute the install the
-manual to the @file{dir} file for @command{info}.
-
-@item install-base
-Macro for @option{install-lib}, @option{install-include} and
-@option{install-copyright}.
-Installs the library, the headers files for the library
-so that you can compile other software that uses the library,
-and the copyright file and the license file.
-
-@item install-lib
-Installs the library, but not its header files.
-
-@item install-include
-Installs the library's header files but not the
-library itself.
-
-@item install-copyright
-Macro for @option{install-copying}, and @option{install-license}.
-Installs the copyright file and the license file.
-
-@item install-copying
-Installs the copyright file but not the license file.
-
-@item install-license
-Installs the license file but not the copyright file.
-
-@item install-doc
-Macro for @option{install-info}, @option{install-pdf},
-@option{install-ps} and @option{install-dvi}.
-Installs the manual in all available formats.
-@command{install-info} will not be execute the install the
-manual to the @file{dir} file for @command{info}.
-
-@item install-info
-Installs the info manual.
-@command{install-info} will not be execute the install the
-manual to the @file{dir} file for @command{info}.
-
-@item install-pdf
-Installs the PDF manual.
-
-@item install-ps
-Installs the PostScript manual.
-
-@item install-dvi
-Installs the DVI manual.
-@end table
-
-
-
-@node Linking
-@chapter Linking
-
-When compiling your program use @command{libgamma},
-you will not need to do anything for the compiling
-phase. But for the linking phase, will need to add
-the option @option{-lgamma}. Currently
-@command{libgamma}, does not provide a pkg-config file.
-
-Keep in mind that @command{libgamma} is GNU General
-Public License version 3 software for your freedom
-and for the freedom of all.
-
-
-
@node API
@chapter API
@@ -1324,11 +853,3 @@ Additionally, if the error code is the value of
@code{LIBGAMMA_DEVICE_REQUIRE_GROUP} the required group
will be printed with its numerical value and, if known,
its name.
-
-
-@node GNU Free Documentation License
-@appendix GNU Free Documentation License
-@include fdl.texinfo
-
-@bye
-
diff --git a/info/texise b/info/texise
deleted file mode 100755
index 48267e9..0000000
--- a/info/texise
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-# -*- mode: python, encoding: utf-8 -*-
-# See LICENSE file for copyright and license details.
-
-import sys
-
-data = sys.stdin.read()[:-1]
-
-n = 0
-while '`' in data:
- i = data.find('`')
- replacement = '@code{' if n % 2 == 0 else '}'
- data = data[:i] + replacement + data[i + 1:]
- n += 1
-
-print(data)
diff --git a/libgamma.7 b/libgamma.7
new file mode 100644
index 0000000..a59c9ae
--- /dev/null
+++ b/libgamma.7
@@ -0,0 +1,262 @@
+.TH LIBGAMMA 7 LIBGAMMA
+.SH NAME
+libgamma - Display server abstraction layer for gamma ramps
+
+.SH DESCRIPTION
+.B libgamma
+is a C library that aims to abstract away the display server
+when adjusting the colours curves for monitors via gamma ramps.
+
+.B libgamma
+have support for the RandR (Resize and Rotate) extension for X,
+the VidMode extension for X and under Linux the Direct Rendering
+Manager which lets software work with graphics outside of
+graphical environments. Additionally
+.B libgamma
+have support for Windows Graphics Device Interface (Windows GDI)
+under Windows and Quartz using CoreGraphics under OS X. However
+Windows GDI and Quartz/CoreGraphics do not receive first-party
+testing on their target platforms but do receive first-party
+testing using a compatibility layer that translates the calls to
+RandR calls. Neither does
+.BR libgamma ,
+currently, receive testing on any of the BSD:s, it is only tested
+on Linux. Furthermore
+.B libgamma
+provides a dummy adjustment method.
+
+
+.SH JARGON
+.B libgamma
+uses a small jargon, parts of which is loaned from X.org
+and redshift, and some is commonly used jargon.
+.TP
+.BR "adjustment method" " [redshift]"
+A combination of the display server and a protocol used to
+tell to the display server.
+.TP
+.BR "display server" " [X.org]"
+The program used to display graphical elements to the
+monitors. In
+.B libgamma
+we also call the non-graphical environment a display server.
+.TP
+.BR "display" " [X.org]"
+.TQ
+.BR "site" " [libgamma]"
+An instance of a display server. Non-graphical environment are
+only covered by \(aqsite\(aq.
+.TP
+.BR "screen" " [X.org]"
+A group of CRTC:s within a display.
+.TP
+.B CRTC
+.TQ
+.B cathode ray tube controller
+Controller for the output on monitor. The mapping from CRTC:s
+to encoders is an injection.
+.TP
+.B monitor
+The physical medium used to display text and graphics.
+.TP
+.BR "partition" " [libgamma]"
+Umbrella term for \(aqscreen\(aq and \(aqgraphics card\(aq.
+.TP
+.BR "page" " [libgamma]"
+The desktop workspace or virtual terminal that is displayed
+on a CRTC. (This jargon is not currently used, but is reserved
+for future features.)
+.TP
+.BR "output" " [X.org]"
+A connector and its encoder.
+.TP
+.B connector
+Physical port on the graphics card where a monitor can be
+plugged in. If and only if the connector is disabled it does
+not have a port and does not have a CRTC.
+.TP
+.B encoder
+Translation layer between CRTC:s and connectors.
+.TP
+.B gamma ramp
+.TQ
+.B colour curve
+.TQ
+.B CLUT
+.TQ
+.B colour lookup table
+A lookup table that translates an encoded value for a subpixel
+into its output value.
+.TP
+.B subpixel
+.TQ
+.B colour channel
+One of the three colours that makes up a pixel: red, green or blue.
+.TP
+.B gamma ramp size
+.TQ
+.B gamma stops
+The number of possible values on the encoding axis of a gamma ramp.
+
+.SH SEE ALSO
+.BR libgamma_behex_edid (3),
+.br
+.BR libgamma_behex_edid_lowercase (3),
+.br
+.BR libgamma_behex_edid_uppercase (3),
+.br
+.BR libgamma_connector_type_count (3),
+.br
+.BR libgamma_const_of_connector_type (3),
+.br
+.BR libgamma_const_of_method (3),
+.br
+.BR libgamma_const_of_subpixel_order (3),
+.br
+.BR libgamma_crtc_destroy (3),
+.br
+.BR libgamma_crtc_free (3),
+.br
+.BR libgamma_crtc_get_gamma_ramps8 (3),
+.br
+.BR libgamma_crtc_get_gamma_ramps16 (3),
+.br
+.BR libgamma_crtc_get_gamma_ramps32 (3),
+.br
+.BR libgamma_crtc_get_gamma_ramps64 (3),
+.br
+.BR libgamma_crtc_get_gamma_rampsf (3),
+.br
+.BR libgamma_crtc_get_gamma_rampsd (3),
+.br
+.BR libgamma_crtc_info_count (3),
+.br
+.BR libgamma_crtc_information_destroy (3),
+.br
+.BR libgamma_crtc_information_free (3),
+.br
+.BR libgamma_crtc_initialise (3),
+.br
+.BR libgamma_crtc_restore (3),
+.br
+.BR libgamma_crtc_set_gamma_ramps8 (3),
+.br
+.BR libgamma_crtc_set_gamma_ramps16 (3),
+.br
+.BR libgamma_crtc_set_gamma_ramps32 (3),
+.br
+.BR libgamma_crtc_set_gamma_ramps64 (3),
+.br
+.BR libgamma_crtc_set_gamma_rampsf (3),
+.br
+.BR libgamma_crtc_set_gamma_rampsd (3),
+.br
+.BR libgamma_crtc_set_gamma_ramps8_f (3),
+.br
+.BR libgamma_crtc_set_gamma_ramps16_f (3),
+.br
+.BR libgamma_crtc_set_gamma_ramps32_f (3),
+.br
+.BR libgamma_crtc_set_gamma_ramps64_f (3),
+.br
+.BR libgamma_crtc_set_gamma_rampsf_f (3),
+.br
+.BR libgamma_crtc_set_gamma_rampsd_f (3),
+.br
+.BR libgamma_error_min (3),
+.br
+.BR libgamma_gamma_ramps8_destroy (3),
+.br
+.BR libgamma_gamma_ramps16_destroy (3),
+.br
+.BR libgamma_gamma_ramps32_destroy (3),
+.br
+.BR libgamma_gamma_ramps64_destroy (3),
+.br
+.BR libgamma_gamma_rampsf_destroy (3),
+.br
+.BR libgamma_gamma_rampsd_destroy (3),
+.br
+.BR libgamma_gamma_ramps8_free (3),
+.br
+.BR libgamma_gamma_ramps16_free (3),
+.br
+.BR libgamma_gamma_ramps32_free (3),
+.br
+.BR libgamma_gamma_ramps64_free (3),
+.br
+.BR libgamma_gamma_rampsf_free (3),
+.br
+.BR libgamma_gamma_rampsd_free (3),
+.br
+.BR libgamma_gamma_ramps8_initialise (3),
+.br
+.BR libgamma_gamma_ramps16_initialise (3),
+.br
+.BR libgamma_gamma_ramps32_initialise (3),
+.br
+.BR libgamma_gamma_ramps64_initialise (3),
+.br
+.BR libgamma_gamma_rampsf_initialise (3),
+.br
+.BR libgamma_gamma_rampsd_initialise (3),
+.br
+.BR libgamma_get_crtc_information (3),
+.br
+.BR libgamma_group_gid (3),
+.br
+.BR libgamma_group_name (3),
+.br
+.BR libgamma_is_method_available (3),
+.br
+.BR libgamma_list_methods (3),
+.br
+.BR libgamma_method_capabilities (3),
+.br
+.BR libgamma_method_count (3),
+.br
+.BR libgamma_method_default_site (3),
+.br
+.BR libgamma_method_default_site_variable (3),
+.br
+.BR libgamma_name_of_connector_type (3),
+.br
+.BR libgamma_name_of_error (3),
+.br
+.BR libgamma_name_of_method (3),
+.br
+.BR libgamma_name_of_subpixel_order (3),
+.br
+.BR libgamma_partition_destroy (3),
+.br
+.BR libgamma_partition_free (3),
+.br
+.BR libgamma_partition_initialise (3),
+.br
+.BR libgamma_partition_restore (3),
+.br
+.BR libgamma_perror (3),
+.br
+.BR libgamma_site_destroy (3),
+.br
+.BR libgamma_site_free (3),
+.br
+.BR libgamma_site_initialise (3),
+.br
+.BR libgamma_site_restore (3),
+.br
+.BR libgamma_strerror (3),
+.br
+.BR libgamma_strerror_r (3),
+.br
+.BR libgamma_subpixel_order_count (3),
+.br
+.BR libgamma_unhex_edid (3),
+.br
+.BR libgamma_value_of_connector_type (3),
+.br
+.BR libgamma_value_of_error (3),
+.br
+.BR libgamma_value_of_method (3),
+.br
+.BR libgamma_value_of_subpixel_order (3)
diff --git a/src/extract/cut b/src/extract/cut
deleted file mode 100755
index ad7c81a..0000000
--- a/src/extract/cut
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env python
-# -*- mode: python, encoding: utf-8 -*-
-# See LICENSE file for copyright and license details.
-
-# Very limited GNU cut.
-
-
-import sys
-
-
-delimiter = '\t'
-fields = []
-complement = False
-
-
-i, n = 1, len(sys.argv)
-while i < n:
- arg = sys.argv[i]
- if arg == '-d':
- i += 1
- delimiter = sys.argv[i]
- elif arg == '-f':
- i += 1
- fields += [int(f) - 1 for f in sys.argv[i].split(',')]
- elif arg == '--complement':
- complement = True
- i += 1
-
-
-fields = set(fields)
-
-
-def modify(line):
- line = line.split(delimiter)
- if complement:
- line = [line[i] for i in range(len(line)) if i not in fields]
- else:
- line = [line[i] for i in range(len(line)) if i in fields]
- return delimiter.join(line)
-
-
-data = sys.stdin.read()
-data = '\n'.join(modify(line) for line in data.split('\n'))
-sys.stdout.write(data)
-sys.stdout.flush()
-
diff --git a/src/extract/libgamma-error-extract b/src/extract/libgamma-error-extract
deleted file mode 100755
index cbfb93a..0000000
--- a/src/extract/libgamma-error-extract
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-# -*- mode: python, encoding: utf-8 -*-
-# See LICENSE file for copyright and license details.
-
-import sys
-import os
-
-with open(os.path.dirname(sys.argv[0]) + '/../lib/libgamma-error.h', 'rb') as file:
- data = file.read()
-data = data.decode('utf-8')
-
-if sys.argv[1] == '--list':
- defs = [line for line in data.split('\n') if line.startswith('#define') and not line.endswith('_H')]
- defs = [line.split(' ')[1] for line in defs if 'LIBGAMMA_ERROR_MIN' not in line]
- print('\n'.join(defs))
-
-else:
- i = data.find('\n#define ' + sys.argv[1])
- data = data[:i]
- i = data.rfind('\n */')
- data = data[:i]
- i = data.rfind('/**\n')
- data = data[i + len('/**\n'):]
- data = [line[3:] for line in data.split('\n')]
- print('\n'.join(data))
-
diff --git a/src/extract/libgamma-method-extract b/src/extract/libgamma-method-extract
deleted file mode 100755
index b967ab3..0000000
--- a/src/extract/libgamma-method-extract
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/env python
-# -*- mode: python, encoding: utf-8 -*-
-# See LICENSE file for copyright and license details.
-
-import sys
-import os
-
-with open(os.path.dirname(sys.argv[0]) + '/../lib/libgamma-method.h', 'rb') as file:
- data = file.read()
-data = data.decode('utf-8')
-
-
-def list_define(prefix, *blacklist):
- global data
- test1 = lambda line : line.startswith('#define ' + prefix)
- test2 = lambda line : line.split(' ')[1] not in [prefix + b for b in list(blacklist)]
- test3 = lambda line : not line.endswith('_H')
- defs = [line for line in data.split('\n') if test1(line) and test2(line) and test3(line)]
- print('\n'.join([d.split(' ')[1] for d in defs]))
-
-def list_enum(prefix, *blacklist):
- global data
- test1 = lambda line : line.strip().startswith(prefix)
- test2 = lambda line : line.split(' ')[1] not in [prefix + b for b in list(blacklist)]
- defs = [line for line in data.split('\n') if test1(line) and test2(line)]
- print('\n'.join([d.strip().split(' ')[0].rstrip(',') for d in defs]))
-
-def list_struct(name):
- global data
- data = data[data.find('\ntypedef struct ' + name + '\n'):]
- data = data[:data.find('\n}')]
- test1 = lambda line : line.startswith(' ') and line.endswith(';')
- test2 = lambda line : ' * ' not in line
- defs = [line for line in data.split('\n') if test1(line) and test2(line)]
- print('\n'.join([d.strip().split(' : ')[0].split(' ')[-1].rstrip(';') for d in defs]))
-
-
-def type_struct(name):
- global data
- data = data[data.find('\ntypedef struct ' + name + '\n'):]
- data = data[:data.find('\n}')]
- test1 = lambda line : line.startswith(' ')
- test2 = lambda line : ' * ' not in line
- test3 = lambda line : line.strip().split(' : ')[0].split(' ')[-1].rstrip(';') == sys.argv[3]
- defs = [line for line in data.split('\n') if test1(line) and test2(line) and test3(line)]
- line = defs[0].strip().rstrip(';')
- if ' : ' in line:
- line = line.split(' : ')
- line[0] = ' '.join(line[0].split(' ')[:-1])
- print(':'.join(line))
- else:
- print(' '.join(line.split(' ')[:-1]))
-
-
-def doc_typedef(name):
- global data
- data = data[:data.find('\ntypedef ' + name + '\n'):]
- data = data[:data.rfind('\n */')]
- data = data[data.rfind('/**\n') + len('/**\n'):]
- data = [line[3:] for line in data.split('\n')]
- print('\n'.join(data))
-
-
-def doc_define():
- global data
- data = data[:data.find('\n#define ' + sys.argv[2] + ' ')]
- data = data[:data.rfind('\n */')]
- data = data[data.rfind('/**\n') + len('/**\n'):]
- data = [line[3:] for line in data.split('\n')]
- print('\n'.join(data))
-
-def doc_enum():
- global data
- while '\n ' in data:
- data = data.replace('\n ', '\n')
- data = data[:data.find('\n' + sys.argv[2])]
- data = data[:data.rfind('\n*/')]
- data = data[data.rfind('/**\n') + len('/**\n'):]
- data = [line[2:] for line in data.split('\n')]
- print('\n'.join(data))
-
-def doc_struct(name):
- global data
- data = data[data.find('\ntypedef struct ' + name + '\n'):]
- data = data[:data.find('\n}')]
- test1 = lambda line : line.startswith(' ')
- test2 = lambda line : ' * ' not in line
- test3 = lambda line : line.strip().split(' : ')[0].split(' ')[-1].rstrip(';') == sys.argv[2]
- defs = [line for line in data.split('\n') if test1(line) and test2(line) and test3(line)]
- line = defs[0]
- data = data[:data.find('\n' + line)]
- while '\n ' in data:
- data = data.replace('\n ', '\n')
- data = data[:data.rfind('\n*/')]
- data = data[data.rfind('/**\n') + len('/**\n'):]
- data = [line[2:] for line in data.split('\n')]
- print('\n'.join(data))
-
-
-struct_map = {'--info-t' : 'libgamma_crtc_information',
- '--cap-t' : 'libgamma_method_capabilities',
- '--site-t' : 'libgamma_site_state',
- '--part-t' : 'libgamma_partition_state',
- '--crtc-t' : 'libgamma_crtc_state'}
-
-if sys.argv[1] == '--list':
- if sys.argv[2] == '--method': list_define('LIBGAMMA_METHOD_', 'MAX', 'COUNT')
- elif sys.argv[2] == '--info': list_define('LIBGAMMA_CRTC_INFO_', 'COUNT')
- elif sys.argv[2] == '--connector': list_enum('LIBGAMMA_CONNECTOR_TYPE_', 'COUNT')
- elif sys.argv[2] == '--subpixel': list_enum('LIBGAMMA_SUBPIXEL_ORDER_', 'COUNT')
- elif sys.argv[2] in struct_map: list_struct(struct_map[sys.argv[2]])
-elif sys.argv[1] == '--type':
- if sys.argv[2] in struct_map: type_struct(struct_map[sys.argv[2]])
-elif sys.argv[1] == '--doc':
- if sys.argv[2] in struct_map: doc_typedef('struct ' + struct_map[sys.argv[2]])
-else:
- if sys.argv[1] in ('--method', '--info'): doc_define()
- elif sys.argv[1] in ('--connector', '--subpixel'): doc_enum()
- elif sys.argv[1] in struct_map: doc_struct(struct_map[sys.argv[1]])
-