Import Upstream version 0.2.8
This commit is contained in:
commit
a1a56a0801
|
@ -0,0 +1,2 @@
|
|||
Albert Astals Cid <aacid@kde.org>
|
||||
Carlos Garcia Campos <carlosgc@gnome.org>
|
|
@ -0,0 +1,339 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public 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.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
|
@ -0,0 +1,247 @@
|
|||
# Doxyfile 1.5.3
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = @PACKAGE@
|
||||
PROJECT_NUMBER = @VERSION@
|
||||
OUTPUT_DIRECTORY = doc
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
QT_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 8
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
CPP_CLI_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
EXTRACT_ANON_NSPACES = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = NO
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = @top_srcdir@/libspectre
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = spectre-status.[ch] \
|
||||
spectre-document.[ch] \
|
||||
spectre-render-context.[ch] \
|
||||
spectre-page.[ch] \
|
||||
spectre-exporter.[ch] \
|
||||
spectre-version.h
|
||||
RECURSIVE = NO
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
HTML_DYNAMIC_SECTIONS = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = "SPECTRE_BEGIN_DECLS=" \
|
||||
"SPECTRE_END_DECLS="
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
MSCGEN_PATH =
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = YES
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = NO
|
||||
INCLUDED_BY_GRAPH = NO
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
|
@ -0,0 +1,236 @@
|
|||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. (Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.)
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You only need
|
||||
`configure.ac' if you want to change it or regenerate `configure' using
|
||||
a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that the
|
||||
`configure' script does not know about. Run `./configure --help' for
|
||||
details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not support the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a
|
||||
time in the source code directory. After you have installed the
|
||||
package for one architecture, use `make distclean' before reconfiguring
|
||||
for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out automatically,
|
||||
but needs to determine by the type of machine the package will run on.
|
||||
Usually, assuming the package is built to be run on the _same_
|
||||
architectures, `configure' can figure that out, but if it prints a
|
||||
message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share, you
|
||||
can create a site shell script called `config.site' that gives default
|
||||
values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script). Here is a another example:
|
||||
|
||||
/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
|
||||
configuration-related scripts to be executed by `/bin/bash'.
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
SUBDIRS = libspectre
|
||||
|
||||
if ENABLE_TEST
|
||||
SUBDIRS += test
|
||||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
AUTHORS \
|
||||
Doxyfile.in \
|
||||
INSTALL \
|
||||
README \
|
||||
libspectre.pc.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libspectre.pc
|
||||
|
||||
DISTCLEANFILES = \
|
||||
$(pkgconfig_DATA) \
|
||||
Doxyfile \
|
||||
ChangeLog
|
||||
|
||||
dist-hook: changelog
|
||||
|
||||
changelog:
|
||||
@if test -d "$(srcdir)/.git"; then \
|
||||
git log --stat > ChangeLog; \
|
||||
cp ChangeLog $(distdir)/; \
|
||||
fi
|
||||
|
||||
doc: Doxyfile
|
||||
doxygen Doxyfile
|
||||
|
||||
# Releasing stuff based on Cairo
|
||||
# Some custom targets to make it easier to release things.
|
||||
# To make real stable releases use:
|
||||
# make release-publish
|
||||
|
||||
RELEASE_UPLOAD_HOST = libspectre.freedesktop.org
|
||||
RELEASE_UPLOAD_BASE = /srv/$(RELEASE_UPLOAD_HOST)/www
|
||||
RELEASE_UPLOAD_DIR = $(RELEASE_UPLOAD_BASE)/releases
|
||||
RELEASE_URL_BASE = http://$(RELEASE_UPLOAD_HOST)/releases
|
||||
|
||||
MANUAL_DATED = libspectre-manual-`date +%Y%m%d`
|
||||
MANUAL_TAR_FILE = $(MANUAL_DATED).tar.gz
|
||||
MANUAL_UPLOAD_DIR = $(RELEASE_UPLOAD_BASE)
|
||||
|
||||
tar_file = $(PACKAGE)-$(VERSION).tar.gz
|
||||
sha1_file = $(tar_file).sha1
|
||||
gpg_file = $(sha1_file).asc
|
||||
|
||||
$(sha1_file): $(tar_file)
|
||||
sha1sum $^ > $@
|
||||
|
||||
$(gpg_file): $(sha1_file)
|
||||
@echo "Please enter your GPG password to sign the checksum."
|
||||
gpg --armor --sign $^
|
||||
|
||||
release-verify-soname-major:
|
||||
@echo -n "Checking that the libspectre soname major number is 1..."
|
||||
@test "$(LT_CURRENT_MINUS_AGE)" = "1" \
|
||||
|| (echo "Ouch." && echo "The soname major number is $(LT_CURRENT_MINUS_AGE) instead of 1." \
|
||||
&& echo "The libtool shared library version numbers in configure.ac must be incremented properly." \
|
||||
&& false)
|
||||
@echo "Good."
|
||||
|
||||
release-verify-newer:
|
||||
@echo -n "Checking that no $(VERSION) release already exists..."
|
||||
@ssh $(RELEASE_UPLOAD_HOST) test ! -e $(RELEASE_UPLOAD_DIR)/$(tar_file) \
|
||||
|| (echo "Ouch." && echo "Found: $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)/$(tar_file)" \
|
||||
&& echo "Are you sure you have an updated checkout?" \
|
||||
&& echo "This should never happen." \
|
||||
&& false)
|
||||
@echo "Good."
|
||||
|
||||
release-remove-old:
|
||||
$(RM) $(tar_file) $(sha1_file) $(gpg_file)
|
||||
|
||||
release-cleanup-group-sticky:
|
||||
find . -type f | xargs chmod g-s
|
||||
|
||||
release-check: release-verify-soname-major release-verify-newer release-remove-old release-cleanup-group-sticky distcheck
|
||||
|
||||
release-upload: release-check $(tar_file) $(sha1_file) $(gpg_file)
|
||||
mkdir -p releases
|
||||
scp $(tar_file) $(sha1_file) $(gpg_file) $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)
|
||||
mv $(tar_file) $(sha1_file) $(gpg_file) releases
|
||||
ssh $(RELEASE_UPLOAD_HOST) "rm -f $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_file) $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
|
||||
git tag -s -m "libspectre $(SPECTRE_MAJOR_VERSION).$(SPECTRE_MINOR_VERSION).$(SPECTRE_MICRO_VERSION) release" $(SPECTRE_MAJOR_VERSION).$(SPECTRE_MINOR_VERSION).$(SPECTRE_MICRO_VERSION)
|
||||
|
||||
release-publish-message: releases/$(sha1_file)
|
||||
@echo "Please follow the instructions in RELEASING to push stuff out and"
|
||||
@echo "send out the announcement mails. Here is the excerpt you need:"
|
||||
@echo ""
|
||||
@echo "Subject: $(PACKAGE) release $(VERSION) now available"
|
||||
@echo ""
|
||||
@echo "============================== CUT HERE =============================="
|
||||
@echo "A new $(PACKAGE) release $(VERSION) is now available from:"
|
||||
@echo ""
|
||||
@echo " $(RELEASE_URL_BASE)/$(tar_file)"
|
||||
@echo ""
|
||||
@echo " which can be verified with:"
|
||||
@echo ""
|
||||
@echo " $(RELEASE_URL_BASE)/$(sha1_file)"
|
||||
@echo -n " "
|
||||
@cat releases/$(sha1_file)
|
||||
@echo ""
|
||||
@echo " $(RELEASE_URL_BASE)/$(gpg_file)"
|
||||
@echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)"
|
||||
@echo ""
|
||||
@echo " Additionally, a git clone of the source tree:"
|
||||
@echo ""
|
||||
@echo " git clone git://anongit.freedesktop.org/git/libspectre"
|
||||
@echo ""
|
||||
@echo " will include a signed $(VERSION) tag which points to a commit named:"
|
||||
@echo " `git cat-file tag $(VERSION) | grep ^object | sed -e 's,object ,,'`"
|
||||
@echo ""
|
||||
@echo " which can be verified with:"
|
||||
@echo " git verify-tag $(VERSION)"
|
||||
@echo ""
|
||||
@echo " and can be checked out with a command such as:"
|
||||
@echo " git checkout -b build $(VERSION)"
|
||||
@echo ""
|
||||
@echo "============================== CUT HERE =============================="
|
||||
|
||||
release-publish: release-upload release-publish-message
|
||||
|
||||
doc-publish: doc
|
||||
cp -a doc/html $(MANUAL_DATED)
|
||||
tar czf $(MANUAL_TAR_FILE) $(MANUAL_DATED)
|
||||
scp $(MANUAL_TAR_FILE) $(RELEASE_UPLOAD_HOST):$(MANUAL_UPLOAD_DIR)
|
||||
ssh $(RELEASE_UPLOAD_HOST) "cd $(MANUAL_UPLOAD_DIR) && tar xzf $(MANUAL_TAR_FILE) && rm -f manual && ln -s $(MANUAL_DATED) manual && ln -sf $(MANUAL_TAR_FILE) libspectre-manual.tar.gz"
|
||||
|
||||
.PHONY: release-verify-newer release-remove-old release-cleanup-group-sticky release-check release-upload release-publish doc-publish changelog
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,171 @@
|
|||
libspectre 0.2.8 (01 July 2016)
|
||||
===============================
|
||||
|
||||
This is another bugfix only release in the libspectre's 0.2 series.
|
||||
|
||||
Marek fixed the document rotation with newer versions of Ghostscript (Bug #76450)
|
||||
|
||||
Build was also broken with Ghostscript >= 9.18 and has been fixed.
|
||||
|
||||
Fixed a compile warning due to a comparison of integers of different
|
||||
signs reported by Daniel Macks when building on OS X (Bug #56476)
|
||||
|
||||
Makefiles were updated to properly use CPPFLAGS instead of CFLAGS as
|
||||
suggested by Daniel Macks (Bug #56481)
|
||||
|
||||
|
||||
libspectre 0.2.7 (08 August 2012)
|
||||
=================================
|
||||
|
||||
This is another bugfix only release in the libspectre's 0.2 series.
|
||||
|
||||
This release fixes two crashes than can happen when %%Pages: or
|
||||
%%Page: comments are missing in the document or when %%Pages: comment
|
||||
is present but it's invalid.
|
||||
|
||||
|
||||
libspectre 0.2.6 (10 June 2010)
|
||||
===============================
|
||||
|
||||
This is another bugfix only release in the libspectre's 0.2 series.
|
||||
|
||||
The most important change in this release is that gs is now always
|
||||
initalized with the flag -P- to make Ghostscript not look in the
|
||||
current directory for library files. See Debian bug
|
||||
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583183
|
||||
|
||||
Compiler flags -ansi and -pedantic are now optional and can be enabled
|
||||
with --enable-iso-c configure option. It seems -pedantic causes
|
||||
performance regression when compiling with Sun Studio compiler. Thanks
|
||||
to Dagobert Michelsen for eporting the issue. (Bug #27735)
|
||||
|
||||
Files with a doseps header and without EOF comment are correctly
|
||||
rendered now. (Bug #27830)
|
||||
|
||||
|
||||
libspectre 0.2.5 (18 April 2010)
|
||||
================================
|
||||
|
||||
This is another bugfix only release in the libspectre's 0.2 series.
|
||||
|
||||
This release contains two important fixes:
|
||||
|
||||
- The first one is a portability issue that caused crashes on
|
||||
big-endian 64 bit systems. Thanks to Rogério Brito who spotted the
|
||||
problem, see launchpad bug
|
||||
https://bugs.launchpad.net/ubuntu/+source/libspectre/+bug/298139
|
||||
|
||||
- The second one is a crash when something goes wrong while running
|
||||
pdf exporter. (Bug #26592)
|
||||
|
||||
|
||||
libspectre 0.2.4 (21 February 2010)
|
||||
===================================
|
||||
|
||||
This is another bugfix only release in the libspectre's 0.2 series.
|
||||
|
||||
Documents containing embedded documents inside the prolog,
|
||||
typically font resources, were not correctly rendered (Bug #25573)
|
||||
|
||||
Hib Eris fixed some portability issues to make libspectre build and
|
||||
work on Windows (Bug #26377)
|
||||
|
||||
PDF exporter was broken which might cause a crash when printing some
|
||||
documents (Bug #26592)
|
||||
|
||||
|
||||
libspectre 0.2.3 (18 October 2009)
|
||||
==================================
|
||||
|
||||
This is another bugfix only release in the libspectre's 0.2 series.
|
||||
|
||||
Several fixes in the PostScript parser:
|
||||
|
||||
- Detection of invalid or broken files has been improved. A document
|
||||
scanned without errors with no pages and no format is likely to be
|
||||
an invalid file, or not a PostScript file at all (Bug #19042)
|
||||
|
||||
- Fix possible uninitialized use of Document media struct
|
||||
contents. Thanks to Alexander Myltsev (Bug #18685)
|
||||
|
||||
- Fix documents with PJL commands before the initial DSC comments.
|
||||
|
||||
Ghostscript is now always run with -dSAFER option
|
||||
|
||||
A missing argument in gs command line of PDF exporter was making it
|
||||
always fail for any document in BSD systems. Thanks to Antoine
|
||||
Jacoutot who gave me remote access to an OpenBSD system to fix this
|
||||
(Bug #18826)
|
||||
|
||||
Internal copy of ghostscript headers have been removed since they are
|
||||
already installed by ghostscript since version 8.62 (Bug #18827)
|
||||
|
||||
|
||||
libspectre 0.2.2 (25 November 2008)
|
||||
===================================
|
||||
|
||||
This is another bugfix only release in the libspectre's 0.2 series.
|
||||
|
||||
A problem when rendering some documents where the page size is
|
||||
different from the Bounding Box has been fixed (Bug #18239)
|
||||
|
||||
Parser is now locale-independent when parsing float numbers (Bug #18685)
|
||||
|
||||
The display format has been fixed to match cairo/pixman. Thanks to
|
||||
Chris Wilson (Bug #18266)
|
||||
|
||||
|
||||
libspectre 0.2.1 (10 August 2008)
|
||||
=================================
|
||||
|
||||
This is a bugfix only release. There are no API changes at all.
|
||||
|
||||
Fixes and improvements in the PostScript parser:
|
||||
|
||||
- Support DOS EPS files (Bug #16810)
|
||||
- A work around for some invalid documents generated by some versions
|
||||
of Mozilla has been added. (Bug #14384)
|
||||
- PS-AdobeFont comments are not considered as begining of a nested
|
||||
document anymore so that the font code is not ignored.
|
||||
|
||||
Portability fixes:
|
||||
|
||||
- Alternative implementation of spectre_strdup_vprintf for platforms
|
||||
where vasprintf is not available (Bug #15127)
|
||||
- Implement _spectre_get_pid for win32 (Bug #16309)
|
||||
- Open files in binary mode for win32 compatibility (Bug #16309)
|
||||
- Fix endianness bug
|
||||
|
||||
Several cleanups and improvements have been made in the code and lots
|
||||
of compile warnings have been fixed.
|
||||
|
||||
|
||||
libspectre 0.2.0 (03 January 2008)
|
||||
==================================
|
||||
|
||||
API additions:
|
||||
|
||||
- Rendering unstructured documents: it's a bit confusing calling
|
||||
get_page for a document with no pages. The following functions has
|
||||
been added for rendering unstructured documents:
|
||||
|
||||
* spectre_document_render
|
||||
* spectre_document_render_full
|
||||
* spectre_document_get_page_size
|
||||
|
||||
- Tile rendering: spectre_page_render_slice has been added to allow
|
||||
rendering rectangles of the page. (Bug #13754)
|
||||
|
||||
API changes:
|
||||
|
||||
- spectre_render_context_set_page_size determines the size of the
|
||||
output image, but it doesn't affect the scale factor anymore.
|
||||
|
||||
- spectre_render_context_[set|get]_scale now require the scale factor for
|
||||
both the X and Y dimensions.
|
||||
|
||||
|
||||
libspectre 0.1.0 (16 December 2007)
|
||||
===================================
|
||||
|
||||
This is the first public release of libspectre.
|
|
@ -0,0 +1,33 @@
|
|||
What is libspectre
|
||||
==================
|
||||
|
||||
libspectre is a small library for rendering Postscript documents. It
|
||||
provides a convenient easy to use API for handling and rendering
|
||||
Postscript documents.
|
||||
|
||||
libspectre is free software and is available to be redistributed
|
||||
and/or modified under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
Dependencies
|
||||
============
|
||||
|
||||
libspectre depends on libgs which is available at
|
||||
http://www.ghostscript.com.
|
||||
|
||||
More information about libspectre
|
||||
=================================
|
||||
|
||||
Web site:
|
||||
|
||||
http://libspectre.freedesktop.org/
|
||||
|
||||
The programming manual:
|
||||
|
||||
http://libspectre.freedesktop.org/manual
|
||||
|
||||
Bug reports and feedback:
|
||||
|
||||
https://bugs.freedesktop.org/ Product: libspectre
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
[X] Eps (unstructured doc) support
|
||||
[X] Check input params in public methods
|
||||
[/] API Documentation
|
||||
[X] Printing API (Exporter)
|
||||
[X] spectre_document_save if make sense
|
||||
[X] Fill README file
|
||||
[X] Makefile for ghostscript dir. It's not installale but it's distribuible
|
||||
[ ] spectre_document_load_from_data
|
||||
[ ] spectre_document_save_to_data
|
||||
[X] A convenient function spectre_document_render for unstructured documents
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,347 @@
|
|||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2012-10-14.11; # UTC
|
||||
|
||||
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,94 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if the 'vasprintf' function is available. */
|
||||
#undef HAVE_VASPRINTF
|
||||
|
||||
/* Define if the '_vscprintf' function is available. */
|
||||
#undef HAVE__VSCPRINTF
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Disable assertion checking */
|
||||
#undef SPECTRE_DISABLE_ASSERT
|
||||
|
||||
/* Disable public API sanity checking */
|
||||
#undef SPECTRE_DISABLE_CHECKS
|
||||
|
||||
/* A 'va_copy' style function */
|
||||
#undef SPECTRE_VA_COPY
|
||||
|
||||
/* 'va_lists' cannot be copies as values */
|
||||
#undef SPECTRE_VA_COPY_AS_ARRAY
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,302 @@
|
|||
AC_PREREQ(2.59)
|
||||
|
||||
m4_define([spectre_major_version], [0])
|
||||
m4_define([spectre_minor_version], [2])
|
||||
m4_define([spectre_micro_version], [8])
|
||||
m4_define([spectre_version],
|
||||
[spectre_major_version.spectre_minor_version.spectre_micro_version])
|
||||
|
||||
AC_INIT(libspectre, [spectre_version])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
AM_INIT_AUTOMAKE([1.7])
|
||||
|
||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
# libtool versioning
|
||||
#
|
||||
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
|
||||
#
|
||||
|
||||
## increment if the interface has additions, changes, removals.
|
||||
LT_CURRENT=2
|
||||
|
||||
## increment any time the source changes; set to
|
||||
## 0 if you increment CURRENT
|
||||
LT_REVISION=8
|
||||
|
||||
## increment if any interfaces have been added; set to 0
|
||||
## if any interfaces have been changed or removed. removal has
|
||||
## precedence over adding, so set to 0 if both happened.
|
||||
LT_AGE=1
|
||||
|
||||
VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
|
||||
AC_SUBST(VERSION_INFO)
|
||||
|
||||
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
||||
AC_SUBST(LT_CURRENT_MINUS_AGE)
|
||||
|
||||
AC_SUBST(LT_CURRENT)
|
||||
AC_SUBST(LT_REVISION)
|
||||
AC_SUBST(LT_AGE)
|
||||
|
||||
SPECTRE_MAJOR_VERSION=spectre_major_version
|
||||
SPECTRE_MINOR_VERSION=spectre_minor_version
|
||||
SPECTRE_MICRO_VERSION=spectre_micro_version
|
||||
SPECTRE_VERSION=spectre_major_version.spectre_minor_version.spectre_micro_version
|
||||
|
||||
AC_SUBST(SPECTRE_MAJOR_VERSION)
|
||||
AC_SUBST(SPECTRE_MINOR_VERSION)
|
||||
AC_SUBST(SPECTRE_MICRO_VERSION)
|
||||
AC_SUBST(SPECTRE_VERSION)
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_CC
|
||||
AC_ISC_POSIX
|
||||
AC_PROG_CC_STDC
|
||||
AC_STDC_HEADERS
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
AC_CHECK_FUNC(vasprintf, [ AC_DEFINE(HAVE_VASPRINTF, 1, [Define if the 'vasprintf' function is available.]) ])
|
||||
|
||||
AC_CHECK_FUNC(_vscprintf, [ AC_DEFINE(HAVE__VSCPRINTF, 1, [Define if the '_vscprintf' function is available.]) ])
|
||||
|
||||
LIBGS_REQUIRED="8.62"
|
||||
|
||||
AC_CHECK_LIB(gs, gsapi_new_instance, have_libgs=yes, have_libgs=no)
|
||||
if test "x$have_libgs" = "xyes"; then
|
||||
LIB_GS="-lgs"
|
||||
save_LIBS=$LIBS
|
||||
LIBS="$LIBS -lgs"
|
||||
AC_LANG_PUSH(C)
|
||||
AC_MSG_CHECKING([for libgs >= $LIBGS_REQUIRED])
|
||||
AC_RUN_IFELSE([AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <ghostscript/iapi.h>
|
||||
]],
|
||||
[[
|
||||
gsapi_revision_t gsrev;
|
||||
|
||||
if (gsapi_revision (&gsrev, sizeof (gsrev)) != 0)
|
||||
return 1;
|
||||
if (gsrev.revision < `echo "$LIBGS_REQUIRED" | sed -e 's/\.//'`)
|
||||
return 1;
|
||||
]])],
|
||||
[have_libgs=yes],
|
||||
[have_libgs=no],
|
||||
[have_libgs=yes]
|
||||
)
|
||||
AC_MSG_RESULT($have_libgs)
|
||||
AC_LANG_POP(C)
|
||||
LIBS=$save_LIBS
|
||||
if test "x$have_libgs" = "xno"; then
|
||||
AC_MSG_ERROR([You need libgs >= $LIBGS_REQUIRED in order to compile libspectre])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([You need libgs in order to compile libspectre])
|
||||
fi
|
||||
AC_SUBST(LIB_GS)
|
||||
|
||||
AC_ARG_ENABLE(asserts,
|
||||
AS_HELP_STRING([--enable-asserts],[include assertion checks]),
|
||||
enable_asserts=$enableval,
|
||||
enable_asserts=$USE_MAINTAINER_MODE)
|
||||
|
||||
if test x$enable_asserts = xno; then
|
||||
AC_DEFINE(SPECTRE_DISABLE_ASSERT,[1],[Disable assertion checking])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(checks,
|
||||
AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),
|
||||
enable_checks=$enableval,
|
||||
enable_checks=yes)
|
||||
|
||||
if test x$enable_checks = xno; then
|
||||
AC_DEFINE(SPECTRE_DISABLE_CHECKS,[1],[Disable public API sanity checking])
|
||||
fi
|
||||
|
||||
dnl Test
|
||||
AC_ARG_ENABLE(test,
|
||||
[AC_HELP_STRING([--enable-test], [Compile tests])],enable_test="$enableval",enable_test=yes)
|
||||
|
||||
if test "x$enable_test" = "xyes"; then
|
||||
PKG_CHECK_MODULES(CAIRO, cairo cairo-png, enable_test=yes,enable_test=no)
|
||||
|
||||
if test "x$enable_test" != "xyes"; then
|
||||
AC_MSG_WARN("Tests disabled since required cairo library was not found")
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes)
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl check compiler flags (From cairo)
|
||||
AC_DEFUN([SPECTRE_CC_TRY_FLAG], [
|
||||
AC_MSG_CHECKING([whether $CC supports $1])
|
||||
|
||||
spectre_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $1"
|
||||
|
||||
AC_COMPILE_IFELSE([ ], [spectre_cc_flag=yes], [spectre_cc_flag=no])
|
||||
CFLAGS="$spectre_save_CFLAGS"
|
||||
|
||||
if test "x$spectre_cc_flag" = "xyes"; then
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_MSG_RESULT([$spectre_cc_flag])
|
||||
])
|
||||
|
||||
|
||||
dnl Use lots of warning flags with with gcc and compatible compilers
|
||||
|
||||
dnl Note: if you change the following variable, the cache is automatically
|
||||
dnl skipped and all flags rechecked. So there's no need to do anything
|
||||
dnl else. If for any reason you need to force a recheck, just change
|
||||
dnl MAYBE_WARN in an ignorable way (like adding whitespace)
|
||||
|
||||
MAYBE_WARN="-Wall -Wextra \
|
||||
-Wsign-compare -Werror-implicit-function-declaration \
|
||||
-Wpointer-arith -Wstrict-prototypes \
|
||||
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
|
||||
-Wpacked -Wswitch-enum \
|
||||
-Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
|
||||
-Wdeclaration-after-statement \
|
||||
-Wno-missing-field-initializers -Wno-unused-parameter \
|
||||
-Wno-attributes -Wno-long-long -Winline"
|
||||
|
||||
AC_ARG_ENABLE(iso-c,
|
||||
AC_HELP_STRING([--enable-iso-c], [Try to warn if code is not ISO C ]),,[enable_iso_c=no])
|
||||
|
||||
if test "x$enable_iso_c" != "xno"; then
|
||||
MAYBE_WARN="$MAYBE_WARN -ansi -pedantic"
|
||||
fi
|
||||
|
||||
# invalidate cached value if MAYBE_WARN has changed
|
||||
if test "x$spectre_cv_warn_maybe" != "x$MAYBE_WARN"; then
|
||||
unset spectre_cv_warn_cflags
|
||||
fi
|
||||
AC_CACHE_CHECK([for supported warning flags], spectre_cv_warn_cflags, [
|
||||
echo
|
||||
WARN_CFLAGS=""
|
||||
|
||||
# Some warning options are not supported by all versions of
|
||||
# gcc, so test all desired options against the current
|
||||
# compiler.
|
||||
#
|
||||
# Note that there are some order dependencies
|
||||
# here. Specifically, an option that disables a warning will
|
||||
# have no net effect if a later option then enables that
|
||||
# warnings, (perhaps implicitly). So we put some grouped
|
||||
# options (-Wall and -Wextra) up front and the -Wno options
|
||||
# last.
|
||||
|
||||
for W in $MAYBE_WARN; do
|
||||
SPECTRE_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
|
||||
done
|
||||
|
||||
spectre_cv_warn_cflags=$WARN_CFLAGS
|
||||
spectre_cv_warn_maybe=$MAYBE_WARN
|
||||
|
||||
AC_MSG_CHECKING([which warning flags were supported])])
|
||||
WARN_CFLAGS="$spectre_cv_warn_cflags"
|
||||
SPECTRE_CFLAGS="$SPECTRE_CFLAGS $WARN_CFLAGS"
|
||||
|
||||
AC_SUBST(SPECTRE_CFLAGS)
|
||||
|
||||
dnl **********************************
|
||||
dnl *** va_copy checks (from GLib) ***
|
||||
dnl **********************************
|
||||
dnl we currently check for all three va_copy possibilities, so we get
|
||||
dnl all results in config.log for bug reports.
|
||||
AC_CACHE_CHECK([for an implementation of va_copy()],spectre_cv_va_copy,[
|
||||
AC_LINK_IFELSE([#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
void f (int i, ...) {
|
||||
va_list args1, args2;
|
||||
va_start (args1, i);
|
||||
va_copy (args2, args1);
|
||||
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
|
||||
exit (1);
|
||||
va_end (args1); va_end (args2);
|
||||
}
|
||||
int main() {
|
||||
f (0, 42);
|
||||
return 0;
|
||||
}],
|
||||
[spectre_cv_va_copy=yes],
|
||||
[spectre_cv_va_copy=no])
|
||||
])
|
||||
AC_CACHE_CHECK([for an implementation of __va_copy()],spectre_cv___va_copy,[
|
||||
AC_LINK_IFELSE([#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
void f (int i, ...) {
|
||||
va_list args1, args2;
|
||||
va_start (args1, i);
|
||||
__va_copy (args2, args1);
|
||||
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
|
||||
exit (1);
|
||||
va_end (args1); va_end (args2);
|
||||
}
|
||||
int main() {
|
||||
f (0, 42);
|
||||
return 0;
|
||||
}],
|
||||
[spectre_cv___va_copy=yes],
|
||||
[spectre_cv___va_copy=no])
|
||||
])
|
||||
|
||||
if test "x$spectre_cv_va_copy" = "xyes"; then
|
||||
spectre_va_copy_func=va_copy
|
||||
else if test "x$spectre_cv___va_copy" = "xyes"; then
|
||||
spectre_va_copy_func=__va_copy
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$spectre_va_copy_func"; then
|
||||
AC_DEFINE_UNQUOTED(SPECTRE_VA_COPY,$spectre_va_copy_func,[A 'va_copy' style function])
|
||||
fi
|
||||
|
||||
AC_LANG_PUSH(C)
|
||||
AC_CACHE_CHECK([whether va_lists can be copied by value],
|
||||
spectre_cv_va_val_copy,
|
||||
[AC_RUN_IFELSE([AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
]],
|
||||
[[
|
||||
void f (int i, ...) {
|
||||
va_list args1, args2;
|
||||
va_start (args1, i);
|
||||
args2 = args1;
|
||||
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
|
||||
exit (1);
|
||||
va_end (args1); va_end (args2);
|
||||
}
|
||||
int main() {
|
||||
f (0, 42);
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[spectre_cv_va_val_copy=yes],
|
||||
[spectre_cv_va_val_copy=no],
|
||||
[spectre_cv_va_val_copy=yes])
|
||||
])
|
||||
AC_LANG_POP(C)
|
||||
|
||||
if test "x$spectre_cv_va_val_copy" = "xno"; then
|
||||
AC_DEFINE(SPECTRE_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
|
||||
fi
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
Doxyfile
|
||||
libspectre/Makefile
|
||||
libspectre/spectre-version.h
|
||||
test/Makefile
|
||||
libspectre.pc
|
||||
])
|
|
@ -0,0 +1,791 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2013-05-30.07; # UTC
|
||||
|
||||
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by 'PROGRAMS ARGS'.
|
||||
object Object file output by 'PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputting dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get the directory component of the given path, and save it in the
|
||||
# global variables '$dir'. Note that this directory component will
|
||||
# be either empty or ending with a '/' character. This is deliberate.
|
||||
set_dir_from ()
|
||||
{
|
||||
case $1 in
|
||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
||||
*) dir=;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get the suffix-stripped basename of the given path, and save it the
|
||||
# global variable '$base'.
|
||||
set_base_from ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
||||
}
|
||||
|
||||
# If no dependency file was actually created by the compiler invocation,
|
||||
# we still have to create a dummy depfile, to avoid errors with the
|
||||
# Makefile "include basename.Plo" scheme.
|
||||
make_dummy_depfile ()
|
||||
{
|
||||
echo "#dummy" > "$depfile"
|
||||
}
|
||||
|
||||
# Factor out some common post-processing of the generated depfile.
|
||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
||||
aix_post_process_depfile ()
|
||||
{
|
||||
# If the compiler actually managed to produce a dependency file,
|
||||
# post-process it.
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependency.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# $object: dependency.h
|
||||
# and one to simply output
|
||||
# dependency.h:
|
||||
# which is needed to avoid the deleted-header problem.
|
||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
||||
} > "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
}
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
# Character ranges might be problematic outside the C locale.
|
||||
# These definitions help.
|
||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
lower=abcdefghijklmnopqrstuvwxyz
|
||||
digits=0123456789
|
||||
alpha=${upper}${lower}
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interferences from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The second -e expression handles DOS-style file names with drive
|
||||
# letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the "deleted header file" problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
||||
| tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
tcc)
|
||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
||||
# FIXME: That version still under development at the moment of writing.
|
||||
# Make that this statement remains true also for stable, released
|
||||
# versions.
|
||||
# It will wrap lines (doesn't matter whether long or short) with a
|
||||
# trailing '\', as in:
|
||||
#
|
||||
# foo.o : \
|
||||
# foo.c \
|
||||
# foo.h \
|
||||
#
|
||||
# It will put a trailing '\' even on the last line, and will use leading
|
||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
||||
# "Emit spaces for -MD").
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
||||
# We have to change lines of the first kind to '$object: \'.
|
||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
||||
# dummy dependency, to avoid the deleted-header problem.
|
||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
set_dir_from "$object"
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
set_base_from "$source"
|
||||
tmpdepfile=$base.d
|
||||
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir=$base.d-lock
|
||||
trap "
|
||||
echo '$0: caught signal, cleaning up...' >&2
|
||||
rmdir '$lockdir'
|
||||
exit 1
|
||||
" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir "$lockdir" 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rmdir "$lockdir"
|
||||
break
|
||||
else
|
||||
# If the lock is being held by a different process, wait
|
||||
# until the winning process is done or we timeout.
|
||||
while test -d "$lockdir" && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
# Same post-processing that is required for AIX mode.
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
showIncludes=-Wc,-showIncludes
|
||||
else
|
||||
showIncludes=-showIncludes
|
||||
fi
|
||||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The first sed program below extracts the file names and escapes
|
||||
# backslashes for cygpath. The second sed program outputs the file
|
||||
# name when reading, but also accumulates all include files in the
|
||||
# hold buffer in order to output them again at the end. This only
|
||||
# works with sed implementations that can handle large buffers.
|
||||
sed < "$tmpdepfile" -n '
|
||||
/^Note: including file: *\(.*\)/ {
|
||||
s//\1/
|
||||
s/\\/\\\\/g
|
||||
p
|
||||
}' | $cygpath_u | sort -u | sed -n '
|
||||
s/ /\\ /g
|
||||
s/\(.*\)/'"$tab"'\1 \\/p
|
||||
s/.\(.*\) \\/\1:/
|
||||
H
|
||||
$ {
|
||||
s/.*/'"$tab"'/
|
||||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7msys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for ':'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no eat=no
|
||||
for arg
|
||||
do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
if test $eat = yes; then
|
||||
eat=no
|
||||
continue
|
||||
fi
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-arch)
|
||||
eat=yes ;;
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix=`echo "$object" | sed 's/^.*\././'`
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed '1,2d' "$tmpdepfile" \
|
||||
| tr ' ' "$nl" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E \
|
||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
||||
echo "$tab" >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvcmsys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
|
@ -0,0 +1,508 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2014-09-12.12; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
doit=${DOITPROG-}
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
# $RANDOM is not portable (e.g. dash); use it when possible to
|
||||
# lower collision chance
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
|
||||
# create the $tmpdir first (and fail if unsuccessful) to make sure
|
||||
# that nobody tries to guess the $tmpdir name.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
|
@ -0,0 +1,12 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: libspectre
|
||||
Description: libgs wrapper library
|
||||
Version: @VERSION@
|
||||
|
||||
Libs: -L${libdir} -lspectre
|
||||
Cflags: -I${includedir}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
EXTRA_DIST=spectre-version.h.in
|
||||
|
||||
lib_LTLIBRARIES = libspectre.la
|
||||
|
||||
libspectreincludedir = $(includedir)/libspectre
|
||||
libspectreinclude_HEADERS = \
|
||||
spectre.h \
|
||||
spectre-macros.h \
|
||||
spectre-status.h \
|
||||
spectre-document.h \
|
||||
spectre-render-context.h \
|
||||
spectre-page.h \
|
||||
spectre-exporter.h \
|
||||
spectre-version.h
|
||||
|
||||
gv_sources = \
|
||||
ps.h \
|
||||
ps.c
|
||||
|
||||
libspectre_la_SOURCES = \
|
||||
spectre.h \
|
||||
spectre-private.h \
|
||||
spectre-macros.h \
|
||||
spectre-status.h \
|
||||
spectre-status.c \
|
||||
spectre-document.h \
|
||||
spectre-document.c \
|
||||
spectre-gs.h \
|
||||
spectre-gs.c \
|
||||
spectre-render-context.h \
|
||||
spectre-render-context.c \
|
||||
spectre-device.h \
|
||||
spectre-device.c \
|
||||
spectre-page.h \
|
||||
spectre-page.c \
|
||||
spectre-exporter.h \
|
||||
spectre-exporter.c \
|
||||
spectre-exporter-pdf.c \
|
||||
spectre-exporter-ps.c \
|
||||
spectre-utils.h \
|
||||
spectre-utils.c \
|
||||
$(gv_sources)
|
||||
|
||||
libspectre_la_CPPFLAGS = \
|
||||
$(SPECTRE_CFLAGS)
|
||||
|
||||
libspectre_la_LIBADD = $(LIB_GS)
|
||||
libspectre_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined
|
|
@ -0,0 +1,826 @@
|
|||
# Makefile.in generated by automake 1.15 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = libspectre
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(libspectreinclude_HEADERS) \
|
||||
$(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES = spectre-version.h
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(libdir)" \
|
||||
"$(DESTDIR)$(libspectreincludedir)"
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
am__DEPENDENCIES_1 =
|
||||
libspectre_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
||||
am__objects_1 = libspectre_la-ps.lo
|
||||
am_libspectre_la_OBJECTS = libspectre_la-spectre-status.lo \
|
||||
libspectre_la-spectre-document.lo libspectre_la-spectre-gs.lo \
|
||||
libspectre_la-spectre-render-context.lo \
|
||||
libspectre_la-spectre-device.lo libspectre_la-spectre-page.lo \
|
||||
libspectre_la-spectre-exporter.lo \
|
||||
libspectre_la-spectre-exporter-pdf.lo \
|
||||
libspectre_la-spectre-exporter-ps.lo \
|
||||
libspectre_la-spectre-utils.lo $(am__objects_1)
|
||||
libspectre_la_OBJECTS = $(am_libspectre_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
libspectre_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libspectre_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libspectre_la_SOURCES)
|
||||
DIST_SOURCES = $(libspectre_la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
HEADERS = $(libspectreinclude_HEADERS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/spectre-version.h.in \
|
||||
$(top_srcdir)/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIB_GS = @LIB_GS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@
|
||||
LT_REVISION = @LT_REVISION@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SPECTRE_CFLAGS = @SPECTRE_CFLAGS@
|
||||
SPECTRE_MAJOR_VERSION = @SPECTRE_MAJOR_VERSION@
|
||||
SPECTRE_MICRO_VERSION = @SPECTRE_MICRO_VERSION@
|
||||
SPECTRE_MINOR_VERSION = @SPECTRE_MINOR_VERSION@
|
||||
SPECTRE_VERSION = @SPECTRE_VERSION@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
VERSION_INFO = @VERSION_INFO@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
EXTRA_DIST = spectre-version.h.in
|
||||
lib_LTLIBRARIES = libspectre.la
|
||||
libspectreincludedir = $(includedir)/libspectre
|
||||
libspectreinclude_HEADERS = \
|
||||
spectre.h \
|
||||
spectre-macros.h \
|
||||
spectre-status.h \
|
||||
spectre-document.h \
|
||||
spectre-render-context.h \
|
||||
spectre-page.h \
|
||||
spectre-exporter.h \
|
||||
spectre-version.h
|
||||
|
||||
gv_sources = \
|
||||
ps.h \
|
||||
ps.c
|
||||
|
||||
libspectre_la_SOURCES = \
|
||||
spectre.h \
|
||||
spectre-private.h \
|
||||
spectre-macros.h \
|
||||
spectre-status.h \
|
||||
spectre-status.c \
|
||||
spectre-document.h \
|
||||
spectre-document.c \
|
||||
spectre-gs.h \
|
||||
spectre-gs.c \
|
||||
spectre-render-context.h \
|
||||
spectre-render-context.c \
|
||||
spectre-device.h \
|
||||
spectre-device.c \
|
||||
spectre-page.h \
|
||||
spectre-page.c \
|
||||
spectre-exporter.h \
|
||||
spectre-exporter.c \
|
||||
spectre-exporter-pdf.c \
|
||||
spectre-exporter-ps.c \
|
||||
spectre-utils.h \
|
||||
spectre-utils.c \
|
||||
$(gv_sources)
|
||||
|
||||
libspectre_la_CPPFLAGS = \
|
||||
$(SPECTRE_CFLAGS)
|
||||
|
||||
libspectre_la_LIBADD = $(LIB_GS)
|
||||
libspectre_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libspectre/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign libspectre/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
spectre-version.h: $(top_builddir)/config.status $(srcdir)/spectre-version.h.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
list2="$$list2 $$p"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
|
||||
}
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
libspectre.la: $(libspectre_la_OBJECTS) $(libspectre_la_DEPENDENCIES) $(EXTRA_libspectre_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libspectre_la_LINK) -rpath $(libdir) $(libspectre_la_OBJECTS) $(libspectre_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-ps.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-device.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-document.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-exporter-pdf.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-exporter-ps.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-exporter.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-gs.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-page.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-render-context.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-status.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspectre_la-spectre-utils.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
libspectre_la-spectre-status.lo: spectre-status.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-status.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-status.Tpo -c -o libspectre_la-spectre-status.lo `test -f 'spectre-status.c' || echo '$(srcdir)/'`spectre-status.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-status.Tpo $(DEPDIR)/libspectre_la-spectre-status.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-status.c' object='libspectre_la-spectre-status.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-status.lo `test -f 'spectre-status.c' || echo '$(srcdir)/'`spectre-status.c
|
||||
|
||||
libspectre_la-spectre-document.lo: spectre-document.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-document.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-document.Tpo -c -o libspectre_la-spectre-document.lo `test -f 'spectre-document.c' || echo '$(srcdir)/'`spectre-document.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-document.Tpo $(DEPDIR)/libspectre_la-spectre-document.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-document.c' object='libspectre_la-spectre-document.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-document.lo `test -f 'spectre-document.c' || echo '$(srcdir)/'`spectre-document.c
|
||||
|
||||
libspectre_la-spectre-gs.lo: spectre-gs.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-gs.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-gs.Tpo -c -o libspectre_la-spectre-gs.lo `test -f 'spectre-gs.c' || echo '$(srcdir)/'`spectre-gs.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-gs.Tpo $(DEPDIR)/libspectre_la-spectre-gs.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-gs.c' object='libspectre_la-spectre-gs.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-gs.lo `test -f 'spectre-gs.c' || echo '$(srcdir)/'`spectre-gs.c
|
||||
|
||||
libspectre_la-spectre-render-context.lo: spectre-render-context.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-render-context.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-render-context.Tpo -c -o libspectre_la-spectre-render-context.lo `test -f 'spectre-render-context.c' || echo '$(srcdir)/'`spectre-render-context.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-render-context.Tpo $(DEPDIR)/libspectre_la-spectre-render-context.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-render-context.c' object='libspectre_la-spectre-render-context.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-render-context.lo `test -f 'spectre-render-context.c' || echo '$(srcdir)/'`spectre-render-context.c
|
||||
|
||||
libspectre_la-spectre-device.lo: spectre-device.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-device.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-device.Tpo -c -o libspectre_la-spectre-device.lo `test -f 'spectre-device.c' || echo '$(srcdir)/'`spectre-device.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-device.Tpo $(DEPDIR)/libspectre_la-spectre-device.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-device.c' object='libspectre_la-spectre-device.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-device.lo `test -f 'spectre-device.c' || echo '$(srcdir)/'`spectre-device.c
|
||||
|
||||
libspectre_la-spectre-page.lo: spectre-page.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-page.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-page.Tpo -c -o libspectre_la-spectre-page.lo `test -f 'spectre-page.c' || echo '$(srcdir)/'`spectre-page.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-page.Tpo $(DEPDIR)/libspectre_la-spectre-page.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-page.c' object='libspectre_la-spectre-page.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-page.lo `test -f 'spectre-page.c' || echo '$(srcdir)/'`spectre-page.c
|
||||
|
||||
libspectre_la-spectre-exporter.lo: spectre-exporter.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-exporter.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-exporter.Tpo -c -o libspectre_la-spectre-exporter.lo `test -f 'spectre-exporter.c' || echo '$(srcdir)/'`spectre-exporter.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-exporter.Tpo $(DEPDIR)/libspectre_la-spectre-exporter.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-exporter.c' object='libspectre_la-spectre-exporter.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-exporter.lo `test -f 'spectre-exporter.c' || echo '$(srcdir)/'`spectre-exporter.c
|
||||
|
||||
libspectre_la-spectre-exporter-pdf.lo: spectre-exporter-pdf.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-exporter-pdf.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-exporter-pdf.Tpo -c -o libspectre_la-spectre-exporter-pdf.lo `test -f 'spectre-exporter-pdf.c' || echo '$(srcdir)/'`spectre-exporter-pdf.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-exporter-pdf.Tpo $(DEPDIR)/libspectre_la-spectre-exporter-pdf.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-exporter-pdf.c' object='libspectre_la-spectre-exporter-pdf.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-exporter-pdf.lo `test -f 'spectre-exporter-pdf.c' || echo '$(srcdir)/'`spectre-exporter-pdf.c
|
||||
|
||||
libspectre_la-spectre-exporter-ps.lo: spectre-exporter-ps.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-exporter-ps.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-exporter-ps.Tpo -c -o libspectre_la-spectre-exporter-ps.lo `test -f 'spectre-exporter-ps.c' || echo '$(srcdir)/'`spectre-exporter-ps.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-exporter-ps.Tpo $(DEPDIR)/libspectre_la-spectre-exporter-ps.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-exporter-ps.c' object='libspectre_la-spectre-exporter-ps.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-exporter-ps.lo `test -f 'spectre-exporter-ps.c' || echo '$(srcdir)/'`spectre-exporter-ps.c
|
||||
|
||||
libspectre_la-spectre-utils.lo: spectre-utils.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-spectre-utils.lo -MD -MP -MF $(DEPDIR)/libspectre_la-spectre-utils.Tpo -c -o libspectre_la-spectre-utils.lo `test -f 'spectre-utils.c' || echo '$(srcdir)/'`spectre-utils.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-spectre-utils.Tpo $(DEPDIR)/libspectre_la-spectre-utils.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-utils.c' object='libspectre_la-spectre-utils.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-spectre-utils.lo `test -f 'spectre-utils.c' || echo '$(srcdir)/'`spectre-utils.c
|
||||
|
||||
libspectre_la-ps.lo: ps.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libspectre_la-ps.lo -MD -MP -MF $(DEPDIR)/libspectre_la-ps.Tpo -c -o libspectre_la-ps.lo `test -f 'ps.c' || echo '$(srcdir)/'`ps.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspectre_la-ps.Tpo $(DEPDIR)/libspectre_la-ps.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ps.c' object='libspectre_la-ps.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspectre_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libspectre_la-ps.lo `test -f 'ps.c' || echo '$(srcdir)/'`ps.c
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-libspectreincludeHEADERS: $(libspectreinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(libspectreinclude_HEADERS)'; test -n "$(libspectreincludedir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libspectreincludedir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libspectreincludedir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libspectreincludedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(libspectreincludedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-libspectreincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(libspectreinclude_HEADERS)'; test -n "$(libspectreincludedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(libspectreincludedir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libspectreincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-libspectreincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-libLTLIBRARIES \
|
||||
uninstall-libspectreincludeHEADERS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
|
||||
ctags-am distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-libLTLIBRARIES \
|
||||
install-libspectreincludeHEADERS install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \
|
||||
uninstall-libspectreincludeHEADERS
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,243 @@
|
|||
/*
|
||||
* ps.h -- Include file for PostScript routines.
|
||||
* Copyright (C) 1992 Timothy O. Theisen
|
||||
* Copyright (C) 2004 Jose E. Marchesi
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNU gv; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA
|
||||
*
|
||||
* Author: Tim Theisen Systems Programmer
|
||||
* Internet: tim@cs.wisc.edu Department of Computer Sciences
|
||||
* UUCP: uwvax!tim University of Wisconsin-Madison
|
||||
* Phone: (608)262-0438 1210 West Dayton Street
|
||||
* FAX: (608)262-9777 Madison, WI 53706
|
||||
*/
|
||||
|
||||
#ifndef PS_H
|
||||
#define PS_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
#include <stdio.h>
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
#ifndef NeedFunctionPrototypes
|
||||
#if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
|
||||
#define NeedFunctionPrototypes 1
|
||||
#else
|
||||
#define NeedFunctionPrototypes 0
|
||||
#endif /* __STDC__ */
|
||||
#endif /* NeedFunctionPrototypes */
|
||||
|
||||
/* Constants used to index into the bounding box array. */
|
||||
|
||||
#define LLX 0
|
||||
#define LLY 1
|
||||
#define URX 2
|
||||
#define URY 3
|
||||
|
||||
/* Constants used to store keywords that are scanned. */
|
||||
/* NONE is not a keyword, it tells when a field was not set */
|
||||
|
||||
/*
|
||||
enum {ATEND = -1, NONE = 0, PORTRAIT, LANDSCAPE, ASCEND, DESCEND, SPECIAL};
|
||||
*/
|
||||
|
||||
#define ATEND (-1)
|
||||
#define NONE 0
|
||||
#define PORTRAIT 1
|
||||
#define LANDSCAPE 2
|
||||
#define SEASCAPE 3
|
||||
#define UPSIDEDOWN 4
|
||||
#define ASCEND 5
|
||||
#define DESCEND 6
|
||||
#define SPECIAL 7
|
||||
#define AUTOMATIC 8
|
||||
|
||||
#define PSLINELENGTH 257 /* 255 characters + 1 newline + 1 NULL */
|
||||
|
||||
/* rjl: DOS binary EPS header */
|
||||
#define PS_DWORD unsigned long/* must be 32 bits unsigned */
|
||||
#define PS_WORD unsigned short/* must be 16 bits unsigned */
|
||||
typedef struct tagDOSEPS {
|
||||
unsigned char id[4];
|
||||
PS_DWORD ps_begin;
|
||||
PS_DWORD ps_length;
|
||||
PS_DWORD mf_begin;
|
||||
PS_DWORD mf_length;
|
||||
PS_DWORD tiff_begin;
|
||||
PS_DWORD tiff_length;
|
||||
PS_WORD checksum;
|
||||
} DOSEPS;
|
||||
|
||||
|
||||
/*##############################################
|
||||
media
|
||||
##############################################*/
|
||||
typedef struct documentmedia {
|
||||
char *name;
|
||||
int width;
|
||||
int height;
|
||||
} MediaStruct, *Media;
|
||||
|
||||
typedef const struct documentmedia *ConstMedia;
|
||||
|
||||
typedef struct document {
|
||||
unsigned int ref_count;
|
||||
|
||||
#ifdef GV_CODE
|
||||
int structured; /* toc will be useful */
|
||||
int labels_useful; /* page labels are distinguishable, hence useful */
|
||||
#endif
|
||||
char *format; /* Postscript format */
|
||||
char *filename; /* Document filename */
|
||||
int epsf; /* Encapsulated PostScript flag. */
|
||||
char *title; /* Title of document. */
|
||||
char *date; /* Creation date. */
|
||||
char *creator; /* Program that created the file */
|
||||
char *fortext;
|
||||
char *languagelevel;
|
||||
int pageorder; /* ASCEND, DESCEND, SPECIAL */
|
||||
long beginheader, endheader; /* offsets into file */
|
||||
unsigned int lenheader;
|
||||
long beginpreview, endpreview;
|
||||
unsigned int lenpreview;
|
||||
long begindefaults, enddefaults;
|
||||
unsigned int lendefaults;
|
||||
long beginprolog, endprolog;
|
||||
unsigned int lenprolog;
|
||||
long beginsetup, endsetup;
|
||||
unsigned int lensetup;
|
||||
long begintrailer, endtrailer;
|
||||
unsigned int lentrailer;
|
||||
int boundingbox[4];
|
||||
int default_page_boundingbox[4];
|
||||
int orientation; /* PORTRAIT, LANDSCAPE */
|
||||
int default_page_orientation; /* PORTRAIT, LANDSCAPE */
|
||||
unsigned int nummedia;
|
||||
struct documentmedia *media;
|
||||
ConstMedia default_page_media;
|
||||
DOSEPS *doseps;
|
||||
unsigned int numpages;
|
||||
struct page *pages;
|
||||
} *Document;
|
||||
|
||||
struct page {
|
||||
char *label;
|
||||
int boundingbox[4];
|
||||
const struct documentmedia *media;
|
||||
int orientation; /* PORTRAIT, LANDSCAPE */
|
||||
long begin, end; /* offsets into file */
|
||||
unsigned int len;
|
||||
};
|
||||
|
||||
/* scans a PostScript file and return a pointer to the document
|
||||
structure. Returns NULL if file does not Conform to commenting
|
||||
conventions . */
|
||||
|
||||
#define SCANSTYLE_NORMAL 0
|
||||
#define SCANSTYLE_IGNORE_EOF (1<<0)
|
||||
#define SCANSTYLE_IGNORE_DSC (1<<1)
|
||||
|
||||
Document psscan (
|
||||
#if NeedFunctionPrototypes
|
||||
const char *,
|
||||
int /* scanstyle */
|
||||
#endif
|
||||
);
|
||||
|
||||
void psdocdestroy (
|
||||
#if NeedFunctionPrototypes
|
||||
struct document *
|
||||
#endif
|
||||
);
|
||||
|
||||
Document psdocreference (
|
||||
#if NeedFunctionPrototypes
|
||||
struct document *
|
||||
#endif
|
||||
);
|
||||
|
||||
extern void pscopydoc (
|
||||
#if NeedFunctionPrototypes
|
||||
FILE *,
|
||||
char *,
|
||||
Document,
|
||||
char *
|
||||
#endif
|
||||
);
|
||||
|
||||
int psgetpagebbox (
|
||||
#if NeedFunctionPrototypes
|
||||
const struct document *,
|
||||
int,
|
||||
int *,
|
||||
int *,
|
||||
int *,
|
||||
int *
|
||||
#endif
|
||||
);
|
||||
|
||||
void psgetpagebox (
|
||||
#if NeedFunctionPrototypes
|
||||
const struct document *,
|
||||
int,
|
||||
int *,
|
||||
int *,
|
||||
int *,
|
||||
int *
|
||||
#endif
|
||||
);
|
||||
|
||||
void pscopy (
|
||||
#if NeedFunctionPrototypes
|
||||
FILE *,
|
||||
FILE *,
|
||||
Document,
|
||||
long,
|
||||
long
|
||||
#endif
|
||||
);
|
||||
|
||||
void pscopyheaders (
|
||||
#if NeedFunctionPrototypes
|
||||
FILE *,
|
||||
FILE *,
|
||||
Document
|
||||
#endif
|
||||
);
|
||||
|
||||
void pscopypage (
|
||||
#if NeedFunctionPrototypes
|
||||
FILE *,
|
||||
FILE *,
|
||||
Document,
|
||||
unsigned int,
|
||||
unsigned int
|
||||
#endif
|
||||
);
|
||||
|
||||
void pscopytrailer (
|
||||
#if NeedFunctionPrototypes
|
||||
FILE *,
|
||||
FILE *,
|
||||
Document,
|
||||
unsigned int
|
||||
#endif
|
||||
);
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* PS_H */
|
|
@ -0,0 +1,417 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "spectre-device.h"
|
||||
#include "spectre-gs.h"
|
||||
#include "spectre-utils.h"
|
||||
#include "spectre-private.h"
|
||||
|
||||
/* ghostscript stuff */
|
||||
#include <ghostscript/gdevdsp.h>
|
||||
|
||||
struct SpectreDevice {
|
||||
struct document *doc;
|
||||
|
||||
int width, height;
|
||||
int row_length; /*! Size of a horizontal row (y-line) in the image buffer */
|
||||
unsigned char *gs_image; /*! Image buffer we received from Ghostscript library */
|
||||
unsigned char *user_image;
|
||||
int page_called;
|
||||
};
|
||||
|
||||
static int
|
||||
spectre_open (void *handle, void *device)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spectre_preclose (void *handle, void *device)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spectre_close (void *handle, void *device)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spectre_presize (void *handle, void *device, int width, int height,
|
||||
int raster, unsigned int format)
|
||||
{
|
||||
SpectreDevice *sd;
|
||||
|
||||
if (!handle)
|
||||
return 0;
|
||||
|
||||
sd = (SpectreDevice *)handle;
|
||||
sd->width = width;
|
||||
sd->height = height;
|
||||
sd->row_length = raster;
|
||||
sd->gs_image = NULL;
|
||||
sd->user_image = malloc (sd->row_length * sd->height);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spectre_size (void *handle, void *device, int width, int height, int raster,
|
||||
unsigned int format, unsigned char *pimage)
|
||||
{
|
||||
SpectreDevice *sd;
|
||||
|
||||
if (!handle)
|
||||
return 0;
|
||||
|
||||
sd = (SpectreDevice *)handle;
|
||||
sd->gs_image = pimage;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spectre_sync (void *handle, void *device)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spectre_page (void *handle, void *device, int copies, int flush)
|
||||
{
|
||||
SpectreDevice *sd;
|
||||
|
||||
if (!handle)
|
||||
return 0;
|
||||
|
||||
sd = (SpectreDevice *)handle;
|
||||
sd->page_called = TRUE;
|
||||
memcpy (sd->user_image, sd->gs_image, sd->row_length * sd->height);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spectre_update (void *handle, void *device, int x, int y, int w, int h)
|
||||
{
|
||||
SpectreDevice *sd;
|
||||
int i;
|
||||
|
||||
if (!handle)
|
||||
return 0;
|
||||
|
||||
sd = (SpectreDevice *)handle;
|
||||
if (!sd->gs_image || sd->page_called || !sd->user_image)
|
||||
return 0;
|
||||
|
||||
for (i = y; i < y + h; ++i) {
|
||||
memcpy (sd->user_image + sd->row_length * i + x * 4,
|
||||
sd->gs_image + sd->row_length * i + x * 4, w * 4);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const display_callback spectre_device = {
|
||||
sizeof (display_callback),
|
||||
DISPLAY_VERSION_MAJOR,
|
||||
DISPLAY_VERSION_MINOR,
|
||||
spectre_open,
|
||||
spectre_preclose,
|
||||
spectre_close,
|
||||
spectre_presize,
|
||||
spectre_size,
|
||||
spectre_sync,
|
||||
spectre_page,
|
||||
spectre_update
|
||||
};
|
||||
|
||||
SpectreDevice *
|
||||
spectre_device_new (struct document *doc)
|
||||
{
|
||||
SpectreDevice *device;
|
||||
|
||||
device = calloc (1, sizeof (SpectreDevice));
|
||||
if (!device)
|
||||
return NULL;
|
||||
|
||||
device->doc = psdocreference (doc);
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
#define PIXEL_SIZE 4
|
||||
#define ROW_ALIGN 32
|
||||
|
||||
static void
|
||||
swap_pixels (unsigned char *data,
|
||||
size_t pixel_a_start,
|
||||
size_t pixel_b_start)
|
||||
{
|
||||
unsigned char value;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < PIXEL_SIZE; i++) {
|
||||
value = data[pixel_a_start + i];
|
||||
data[pixel_a_start + i] = data[pixel_b_start + i];
|
||||
data[pixel_b_start + i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
copy_pixel (unsigned char *dest,
|
||||
unsigned char *src,
|
||||
size_t dest_pixel_start,
|
||||
size_t src_pixel_start)
|
||||
{
|
||||
memcpy (dest + dest_pixel_start, src + src_pixel_start, PIXEL_SIZE);
|
||||
}
|
||||
|
||||
static void
|
||||
rotate_image_to_orientation (unsigned char **page_data,
|
||||
int *row_length,
|
||||
int width,
|
||||
int height,
|
||||
SpectreOrientation orientation)
|
||||
{
|
||||
int i, j;
|
||||
size_t stride, padding;
|
||||
unsigned char *user_image;
|
||||
|
||||
switch (orientation) {
|
||||
default:
|
||||
case SPECTRE_ORIENTATION_PORTRAIT:
|
||||
break;
|
||||
case SPECTRE_ORIENTATION_REVERSE_PORTRAIT:
|
||||
for (j = 0; j < height / 2; ++j) {
|
||||
for (i = 0; i < width; ++i) {
|
||||
swap_pixels (*page_data,
|
||||
*row_length * j + PIXEL_SIZE * i,
|
||||
*row_length * (height - 1 - j) + PIXEL_SIZE * (width - 1 - i));
|
||||
}
|
||||
}
|
||||
if (height % 2 == 1) {
|
||||
for (i = 0; i < width / 2; ++i) {
|
||||
swap_pixels (*page_data,
|
||||
*row_length * (height / 2) + PIXEL_SIZE * i,
|
||||
*row_length * (height - 1 - height / 2) + PIXEL_SIZE * (width - 1 - i));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SPECTRE_ORIENTATION_LANDSCAPE:
|
||||
case SPECTRE_ORIENTATION_REVERSE_LANDSCAPE:
|
||||
if (height % ROW_ALIGN > 0) {
|
||||
padding = (ROW_ALIGN - height % ROW_ALIGN) * PIXEL_SIZE;
|
||||
stride = height * PIXEL_SIZE + padding;
|
||||
user_image = malloc (width * stride);
|
||||
|
||||
for (j = 0; j < width; ++j)
|
||||
memset (user_image + j * stride + stride - padding, 0, padding);
|
||||
} else {
|
||||
stride = height * PIXEL_SIZE;
|
||||
user_image = malloc (width * stride);
|
||||
}
|
||||
|
||||
if (orientation == SPECTRE_ORIENTATION_LANDSCAPE) {
|
||||
for (j = 0; j < height; ++j) {
|
||||
for (i = 0; i < width; ++i) {
|
||||
copy_pixel (user_image,
|
||||
*page_data,
|
||||
stride * i + PIXEL_SIZE * (height - 1 - j),
|
||||
*row_length * j + PIXEL_SIZE * i);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (j = 0; j < height; ++j) {
|
||||
for (i = 0; i < width; ++i) {
|
||||
copy_pixel (user_image,
|
||||
*page_data,
|
||||
stride * (width - 1 - i) + PIXEL_SIZE * j,
|
||||
*row_length * j + PIXEL_SIZE * i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free (*page_data);
|
||||
*page_data = user_image;
|
||||
*row_length = stride;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
SpectreStatus
|
||||
spectre_device_render (SpectreDevice *device,
|
||||
unsigned int page,
|
||||
SpectreRenderContext *rc,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
unsigned char **page_data,
|
||||
int *row_length)
|
||||
{
|
||||
SpectreGS *gs;
|
||||
char **args;
|
||||
int n_args = 13;
|
||||
int arg = 0;
|
||||
int success;
|
||||
char *fmt;
|
||||
char *text_alpha, *graph_alpha;
|
||||
char *size = NULL;
|
||||
char *resolution, *set;
|
||||
char *dsp_format, *dsp_handle;
|
||||
char *width_points = NULL;
|
||||
char *height_points = NULL;
|
||||
long gs_version;
|
||||
|
||||
gs = spectre_gs_new ();
|
||||
if (!gs)
|
||||
return SPECTRE_STATUS_NO_MEMORY;
|
||||
|
||||
gs_version = spectre_gs_get_version();
|
||||
|
||||
if (!spectre_gs_create_instance (gs, device)) {
|
||||
spectre_gs_cleanup (gs, CLEANUP_DELETE_INSTANCE);
|
||||
spectre_gs_free (gs);
|
||||
|
||||
return SPECTRE_STATUS_RENDER_ERROR;
|
||||
}
|
||||
|
||||
if (!spectre_gs_set_display_callback (gs, (display_callback *)&spectre_device)) {
|
||||
spectre_gs_cleanup (gs, CLEANUP_DELETE_INSTANCE);
|
||||
spectre_gs_free (gs);
|
||||
|
||||
return SPECTRE_STATUS_RENDER_ERROR;
|
||||
}
|
||||
|
||||
width = (int) ((width * rc->x_scale) + 0.5);
|
||||
height = (int) ((height * rc->y_scale) + 0.5);
|
||||
|
||||
if (rc->use_platform_fonts == FALSE)
|
||||
n_args++;
|
||||
if (rc->width != -1 && rc->height != -1)
|
||||
n_args += 3;
|
||||
|
||||
args = calloc (sizeof (char *), n_args);
|
||||
args[arg++] = "libspectre"; /* This value doesn't really matter */
|
||||
args[arg++] = "-dMaxBitmap=10000000";
|
||||
args[arg++] = "-dSAFER";
|
||||
args[arg++] = "-dNOPAUSE";
|
||||
args[arg++] = "-dNOPAGEPROMPT";
|
||||
args[arg++] = "-P-";
|
||||
args[arg++] = "-sDEVICE=display";
|
||||
args[arg++] = text_alpha = _spectre_strdup_printf ("-dTextAlphaBits=%d",
|
||||
rc->text_alpha_bits);
|
||||
args[arg++] = graph_alpha = _spectre_strdup_printf ("-dGraphicsAlphaBits=%d",
|
||||
rc->graphic_alpha_bits);
|
||||
args[arg++] = size =_spectre_strdup_printf ("-g%dx%d", width, height);
|
||||
args[arg++] = resolution = _spectre_strdup_printf ("-r%fx%f",
|
||||
rc->x_scale * rc->x_dpi,
|
||||
rc->y_scale * rc->y_dpi);
|
||||
args[arg++] = dsp_format = _spectre_strdup_printf ("-dDisplayFormat=%d",
|
||||
DISPLAY_COLORS_RGB |
|
||||
DISPLAY_DEPTH_8 |
|
||||
DISPLAY_ROW_ALIGN_32 |
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
DISPLAY_UNUSED_FIRST |
|
||||
DISPLAY_BIGENDIAN |
|
||||
#else
|
||||
DISPLAY_UNUSED_LAST |
|
||||
DISPLAY_LITTLEENDIAN |
|
||||
#endif
|
||||
DISPLAY_TOPFIRST);
|
||||
#ifdef WIN32
|
||||
#define FMT64 "I64"
|
||||
#else
|
||||
#define FMT64 "ll"
|
||||
#endif
|
||||
fmt = _spectre_strdup_printf ("-sDisplayHandle=16#%s",
|
||||
sizeof (device) == 4 ? "%lx" : "%"FMT64"x");
|
||||
args[arg++] = dsp_handle = _spectre_strdup_printf (fmt, device);
|
||||
free (fmt);
|
||||
#undef FMT64
|
||||
if (rc->use_platform_fonts == FALSE)
|
||||
args[arg++] = "-dNOPLATFONTS";
|
||||
|
||||
if (rc->width != -1 && rc->height != -1) {
|
||||
args[arg++] = width_points = _spectre_strdup_printf ("-dDEVICEWIDTHPOINTS=%d",
|
||||
rc->width);
|
||||
args[arg++] = height_points = _spectre_strdup_printf ("-dDEVICEHEIGHTPOINTS=%d",
|
||||
rc->height);
|
||||
args[arg++] = "-dFIXEDMEDIA";
|
||||
}
|
||||
|
||||
success = spectre_gs_run (gs, n_args, args);
|
||||
free (text_alpha);
|
||||
free (graph_alpha);
|
||||
free (size);
|
||||
free (width_points);
|
||||
free (height_points);
|
||||
free (resolution);
|
||||
free (dsp_format);
|
||||
free (dsp_handle);
|
||||
free (args);
|
||||
if (!success) {
|
||||
spectre_gs_free (gs);
|
||||
return SPECTRE_STATUS_RENDER_ERROR;
|
||||
}
|
||||
|
||||
set = _spectre_strdup_printf ("<< /Orientation %d >> setpagedevice .locksafe",
|
||||
gs_version >= 908 ? SPECTRE_ORIENTATION_PORTRAIT : rc->orientation);
|
||||
if (!spectre_gs_send_string (gs, set)) {
|
||||
free (set);
|
||||
spectre_gs_free (gs);
|
||||
return SPECTRE_STATUS_RENDER_ERROR;
|
||||
}
|
||||
free (set);
|
||||
|
||||
if (!spectre_gs_send_page (gs, device->doc, page, x, y)) {
|
||||
spectre_gs_free (gs);
|
||||
return SPECTRE_STATUS_RENDER_ERROR;
|
||||
}
|
||||
|
||||
*page_data = device->user_image;
|
||||
*row_length = device->row_length;
|
||||
if (gs_version >= 908)
|
||||
rotate_image_to_orientation (page_data, row_length, width, height, rc->orientation);
|
||||
|
||||
spectre_gs_free (gs);
|
||||
|
||||
return SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_device_free (SpectreDevice *device)
|
||||
{
|
||||
if (!device)
|
||||
return;
|
||||
|
||||
if (device->doc) {
|
||||
psdocdestroy (device->doc);
|
||||
device->doc = NULL;
|
||||
}
|
||||
|
||||
free (device);
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_DEVICE_H
|
||||
#define SPECTRE_DEVICE_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
#include <libspectre/spectre-render-context.h>
|
||||
#include <libspectre/spectre-status.h>
|
||||
|
||||
#include "ps.h"
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
typedef struct SpectreDevice SpectreDevice;
|
||||
|
||||
SpectreDevice *spectre_device_new (struct document *doc);
|
||||
SpectreStatus spectre_device_render (SpectreDevice *device,
|
||||
unsigned int page,
|
||||
SpectreRenderContext *rc,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
unsigned char **page_data,
|
||||
int *row_length);
|
||||
void spectre_device_free (SpectreDevice *device);
|
||||
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_DEVICE_H */
|
|
@ -0,0 +1,501 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* For stat */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "spectre-document.h"
|
||||
#include "spectre-private.h"
|
||||
#include "spectre-exporter.h"
|
||||
#include "spectre-utils.h"
|
||||
|
||||
struct SpectreDocument
|
||||
{
|
||||
struct document *doc;
|
||||
|
||||
SpectreStatus status;
|
||||
|
||||
int structured;
|
||||
};
|
||||
|
||||
SpectreDocument *
|
||||
spectre_document_new (void)
|
||||
{
|
||||
SpectreDocument *doc;
|
||||
|
||||
doc = calloc (1, sizeof (SpectreDocument));
|
||||
return doc;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_document_load (SpectreDocument *document,
|
||||
const char *filename)
|
||||
{
|
||||
_spectre_return_if_fail (document != NULL);
|
||||
_spectre_return_if_fail (filename != NULL);
|
||||
|
||||
if (document->doc && strcmp (filename, document->doc->filename) == 0) {
|
||||
document->status = SPECTRE_STATUS_SUCCESS;
|
||||
return;
|
||||
}
|
||||
|
||||
if (document->doc) {
|
||||
psdocdestroy (document->doc);
|
||||
document->doc = NULL;
|
||||
}
|
||||
|
||||
document->doc = psscan (filename, SCANSTYLE_NORMAL);
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_LOAD_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
if (document->doc->numpages == 0 && document->doc->lenprolog == 0) {
|
||||
document->status = SPECTRE_STATUS_LOAD_ERROR;
|
||||
psdocdestroy (document->doc);
|
||||
document->doc = NULL;
|
||||
|
||||
return;
|
||||
} else if (document->doc->numpages == 0 && !document->doc->format) {
|
||||
/* Make sure it's a valid PS document */
|
||||
unsigned char *data = NULL;
|
||||
int row_length;
|
||||
|
||||
spectre_document_render (document, &data, &row_length);
|
||||
free (data);
|
||||
|
||||
if (spectre_document_status (document)) {
|
||||
document->status = SPECTRE_STATUS_LOAD_ERROR;
|
||||
psdocdestroy (document->doc);
|
||||
document->doc = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
document->structured = ((!document->doc->epsf && document->doc->numpages > 0) ||
|
||||
(document->doc->epsf && document->doc->numpages > 1));
|
||||
|
||||
if (document->status != SPECTRE_STATUS_SUCCESS)
|
||||
document->status = SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_document_free (SpectreDocument *document)
|
||||
{
|
||||
if (!document)
|
||||
return;
|
||||
|
||||
if (document->doc) {
|
||||
psdocdestroy (document->doc);
|
||||
document->doc = NULL;
|
||||
}
|
||||
|
||||
free (document);
|
||||
}
|
||||
|
||||
SpectreStatus
|
||||
spectre_document_status (SpectreDocument *document)
|
||||
{
|
||||
_spectre_return_val_if_fail (document != NULL, SPECTRE_STATUS_DOCUMENT_NOT_LOADED);
|
||||
|
||||
return document->status;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
spectre_document_get_n_pages (SpectreDocument *document)
|
||||
{
|
||||
_spectre_return_val_if_fail (document != NULL, 0);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return document->structured ? document->doc->numpages : 1;
|
||||
}
|
||||
|
||||
SpectreOrientation
|
||||
spectre_document_get_orientation (SpectreDocument *document)
|
||||
{
|
||||
int doc_orientation;
|
||||
|
||||
_spectre_return_val_if_fail (document != NULL, SPECTRE_ORIENTATION_PORTRAIT);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return SPECTRE_ORIENTATION_PORTRAIT;
|
||||
}
|
||||
|
||||
doc_orientation = document->doc->orientation != NONE ?
|
||||
document->doc->orientation : document->doc->default_page_orientation;
|
||||
|
||||
switch (doc_orientation) {
|
||||
default:
|
||||
case PORTRAIT:
|
||||
return SPECTRE_ORIENTATION_PORTRAIT;
|
||||
case LANDSCAPE:
|
||||
return SPECTRE_ORIENTATION_LANDSCAPE;
|
||||
case SEASCAPE:
|
||||
return SPECTRE_ORIENTATION_REVERSE_LANDSCAPE;
|
||||
case UPSIDEDOWN:
|
||||
return SPECTRE_ORIENTATION_REVERSE_PORTRAIT;
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
spectre_document_get_title (SpectreDocument *document)
|
||||
{
|
||||
_spectre_return_val_if_fail (document != NULL, NULL);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return document->doc->title;
|
||||
}
|
||||
|
||||
const char *
|
||||
spectre_document_get_creator (SpectreDocument *document)
|
||||
{
|
||||
_spectre_return_val_if_fail (document != NULL, NULL);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return document->doc->creator;
|
||||
}
|
||||
|
||||
const char *
|
||||
spectre_document_get_for (SpectreDocument *document)
|
||||
{
|
||||
_spectre_return_val_if_fail (document != NULL, NULL);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return document->doc->fortext;
|
||||
}
|
||||
|
||||
const char *
|
||||
spectre_document_get_creation_date (SpectreDocument *document)
|
||||
{
|
||||
_spectre_return_val_if_fail (document != NULL, NULL);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return document->doc->date;
|
||||
}
|
||||
|
||||
const char *
|
||||
spectre_document_get_format (SpectreDocument *document)
|
||||
{
|
||||
_spectre_return_val_if_fail (document != NULL, NULL);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return document->doc->format;
|
||||
}
|
||||
|
||||
int
|
||||
spectre_document_is_eps (SpectreDocument *document)
|
||||
{
|
||||
_spectre_return_val_if_fail (document != NULL, FALSE);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return document->doc->epsf;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
spectre_document_get_language_level (SpectreDocument *document)
|
||||
{
|
||||
_spectre_return_val_if_fail (document != NULL, 0);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return document->doc->languagelevel ? atoi (document->doc->languagelevel) : 0;
|
||||
}
|
||||
|
||||
SpectrePage *
|
||||
spectre_document_get_page (SpectreDocument *document,
|
||||
unsigned int page_index)
|
||||
{
|
||||
SpectrePage *page;
|
||||
unsigned int index;
|
||||
|
||||
_spectre_return_val_if_fail (document != NULL, NULL);
|
||||
|
||||
index = (document->doc->pageorder == DESCEND) ?
|
||||
(document->doc->numpages - 1) - page_index :
|
||||
page_index;
|
||||
|
||||
if (index >= spectre_document_get_n_pages (document)) {
|
||||
document->status = SPECTRE_STATUS_INVALID_PAGE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
page = _spectre_page_new (index, document->doc);
|
||||
if (!page) {
|
||||
document->status = SPECTRE_STATUS_NO_MEMORY;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (document->status != SPECTRE_STATUS_SUCCESS)
|
||||
document->status = SPECTRE_STATUS_SUCCESS;
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
SpectrePage *
|
||||
spectre_document_get_page_by_label (SpectreDocument *document,
|
||||
const char *label)
|
||||
{
|
||||
unsigned int i;
|
||||
int page_index = -1;
|
||||
|
||||
_spectre_return_val_if_fail (document != NULL, NULL);
|
||||
|
||||
if (!label) {
|
||||
document->status = SPECTRE_STATUS_INVALID_PAGE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < document->doc->numpages; i++) {
|
||||
if (strcmp (document->doc->pages[i].label, label) == 0) {
|
||||
page_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (page_index == -1) {
|
||||
document->status = SPECTRE_STATUS_INVALID_PAGE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return spectre_document_get_page (document, page_index);
|
||||
}
|
||||
|
||||
void
|
||||
spectre_document_render_full (SpectreDocument *document,
|
||||
SpectreRenderContext *rc,
|
||||
unsigned char **page_data,
|
||||
int *row_length)
|
||||
{
|
||||
SpectrePage *page;
|
||||
|
||||
_spectre_return_if_fail (document != NULL);
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return;
|
||||
}
|
||||
|
||||
page = spectre_document_get_page (document, 0);
|
||||
if (!page || document->status != SPECTRE_STATUS_SUCCESS) {
|
||||
spectre_page_free (page);
|
||||
return;
|
||||
}
|
||||
|
||||
spectre_page_render (page, rc, page_data, row_length);
|
||||
document->status = spectre_page_status (page);
|
||||
|
||||
spectre_page_free (page);
|
||||
}
|
||||
|
||||
void
|
||||
spectre_document_render (SpectreDocument *document,
|
||||
unsigned char **page_data,
|
||||
int *row_length)
|
||||
{
|
||||
SpectreRenderContext *rc;
|
||||
|
||||
_spectre_return_if_fail (document != NULL);
|
||||
|
||||
rc = spectre_render_context_new ();
|
||||
spectre_document_render_full (document, rc, page_data, row_length);
|
||||
spectre_render_context_free (rc);
|
||||
}
|
||||
|
||||
void
|
||||
spectre_document_get_page_size (SpectreDocument *document,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
SpectrePage *page;
|
||||
int w, h;
|
||||
|
||||
_spectre_return_if_fail (document != NULL);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return;
|
||||
}
|
||||
|
||||
page = spectre_document_get_page (document, 0);
|
||||
if (!page || document->status != SPECTRE_STATUS_SUCCESS) {
|
||||
spectre_page_free (page);
|
||||
return;
|
||||
}
|
||||
|
||||
spectre_page_get_size (page, &w, &h);
|
||||
if (width)
|
||||
*width = w;
|
||||
if (height)
|
||||
*height = h;
|
||||
|
||||
spectre_page_free (page);
|
||||
}
|
||||
|
||||
void
|
||||
spectre_document_save (SpectreDocument *document,
|
||||
const char *filename)
|
||||
{
|
||||
struct stat stat_buf;
|
||||
FILE *from;
|
||||
FILE *to;
|
||||
|
||||
_spectre_return_if_fail (document != NULL);
|
||||
_spectre_return_if_fail (filename != NULL);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return;
|
||||
}
|
||||
|
||||
if (stat (document->doc->filename, &stat_buf) != 0) {
|
||||
document->status = SPECTRE_STATUS_SAVE_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
from = fopen (document->doc->filename, "rb");
|
||||
if (!from) {
|
||||
document->status = SPECTRE_STATUS_SAVE_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
to = fopen (filename, "wb");
|
||||
if (!to) {
|
||||
document->status = SPECTRE_STATUS_SAVE_ERROR;
|
||||
fclose (from);
|
||||
return;
|
||||
}
|
||||
|
||||
pscopy (from, to, document->doc, 0, stat_buf.st_size - 1);
|
||||
|
||||
fclose (from);
|
||||
fclose (to);
|
||||
|
||||
document->status = SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_document_save_to_pdf (SpectreDocument *document,
|
||||
const char *filename)
|
||||
{
|
||||
SpectreExporter *exporter;
|
||||
SpectreStatus status;
|
||||
unsigned int i;
|
||||
|
||||
_spectre_return_if_fail (document != NULL);
|
||||
_spectre_return_if_fail (filename != NULL);
|
||||
|
||||
if (!document->doc) {
|
||||
document->status = SPECTRE_STATUS_DOCUMENT_NOT_LOADED;
|
||||
return;
|
||||
}
|
||||
|
||||
exporter = spectre_exporter_new (document, SPECTRE_EXPORTER_FORMAT_PDF);
|
||||
if (!exporter) {
|
||||
document->status = SPECTRE_STATUS_NO_MEMORY;
|
||||
return;
|
||||
}
|
||||
|
||||
status = spectre_exporter_begin (exporter, filename);
|
||||
if (status) {
|
||||
document->status = status == SPECTRE_STATUS_NO_MEMORY ?
|
||||
SPECTRE_STATUS_NO_MEMORY : SPECTRE_STATUS_SAVE_ERROR;
|
||||
spectre_exporter_free (exporter);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < spectre_document_get_n_pages (document); i++) {
|
||||
status = spectre_exporter_do_page (exporter, i);
|
||||
if (status)
|
||||
break;
|
||||
}
|
||||
|
||||
if (status) {
|
||||
document->status = status == SPECTRE_STATUS_NO_MEMORY ?
|
||||
SPECTRE_STATUS_NO_MEMORY : SPECTRE_STATUS_SAVE_ERROR;
|
||||
spectre_exporter_free (exporter);
|
||||
return;
|
||||
}
|
||||
|
||||
status = spectre_exporter_end (exporter);
|
||||
spectre_exporter_free (exporter);
|
||||
|
||||
if (status) {
|
||||
document->status = status == SPECTRE_STATUS_NO_MEMORY ?
|
||||
SPECTRE_STATUS_NO_MEMORY : SPECTRE_STATUS_SAVE_ERROR;
|
||||
} else {
|
||||
document->status = SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
struct document *
|
||||
_spectre_document_get_doc (SpectreDocument *document)
|
||||
{
|
||||
return document->doc;
|
||||
}
|
|
@ -0,0 +1,186 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_DOCUMENT_H
|
||||
#define SPECTRE_DOCUMENT_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
#include <libspectre/spectre-status.h>
|
||||
#include <libspectre/spectre-page.h>
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
/*! This is the object that represents a PostScript document. */
|
||||
typedef struct SpectreDocument SpectreDocument;
|
||||
|
||||
/*! Creates a document */
|
||||
SpectreDocument *spectre_document_new (void);
|
||||
|
||||
/*! Loads a the given file into the document. This function can fail
|
||||
@param document the document where the file will be loaded
|
||||
@param filename the file to loa
|
||||
@see spectre_document_status
|
||||
*/
|
||||
void spectre_document_load (SpectreDocument *document,
|
||||
const char *filename);
|
||||
|
||||
/*! Returns the document status
|
||||
@param document the document whose status will be returned
|
||||
*/
|
||||
SpectreStatus spectre_document_status (SpectreDocument *document);
|
||||
|
||||
/*! Frees the document
|
||||
@param document the document that will be freed
|
||||
*/
|
||||
void spectre_document_free (SpectreDocument *document);
|
||||
|
||||
/*! Returns the number of pages of the document. This function can fail
|
||||
@param document the document whose pages number will be returned
|
||||
@see spectre_document_status
|
||||
*/
|
||||
unsigned int spectre_document_get_n_pages (SpectreDocument *document);
|
||||
|
||||
/*! Returns the orientation of the document. This function can fail
|
||||
@param document the document whose orientation will be returned
|
||||
@see spectre_document_status
|
||||
*/
|
||||
SpectreOrientation spectre_document_get_orientation (SpectreDocument *document);
|
||||
|
||||
/*! Returns the title of the document. It returns a null const char * if
|
||||
the document specifies no title. This function can fail
|
||||
@param document the document whose title will be returned
|
||||
@see spectre_document_status
|
||||
*/
|
||||
const char *spectre_document_get_title (SpectreDocument *document);
|
||||
|
||||
/*! Returns the creator of the document. It returns a null const char * if
|
||||
the document specifies no creator. This function can fail
|
||||
@param document the document whose creator will be returned
|
||||
@see spectre_document_status
|
||||
*/
|
||||
const char *spectre_document_get_creator (SpectreDocument *document);
|
||||
|
||||
/*! Returns the for of the document. It returns a null const char * if
|
||||
the document specifies no for. This function can fail
|
||||
@param document the document whose for will be returned
|
||||
@see spectre_document_status
|
||||
*/
|
||||
const char *spectre_document_get_for (SpectreDocument *document);
|
||||
|
||||
/*! Returns the creation date of the document. The date is copied verbatim from
|
||||
the document, so no format can be assumed on it. It returns a null const char * if
|
||||
the document specifies no creation date. This function can fail
|
||||
@param document the document whose creation date will be returned
|
||||
@see spectre_document_status
|
||||
*/
|
||||
const char *spectre_document_get_creation_date (SpectreDocument *document);
|
||||
|
||||
/*! Returns the format of the document. This function can fail
|
||||
@param document the document whose format will be returned
|
||||
@see spectre_document_status
|
||||
*/
|
||||
const char *spectre_document_get_format (SpectreDocument *document);
|
||||
|
||||
/*! Returns if the document is a Encapsulated PostScript file. This function can fail
|
||||
@param document the document to query
|
||||
@see spectre_document_status
|
||||
*/
|
||||
int spectre_document_is_eps (SpectreDocument *document);
|
||||
|
||||
/*! Returns the PostScript language level of the document. It returns 0 if no
|
||||
language level was defined on the file. This function can fail
|
||||
@param document the document whose language level will be returned
|
||||
@see spectre_document_status
|
||||
*/
|
||||
unsigned int spectre_document_get_language_level (SpectreDocument *document);
|
||||
|
||||
/*! Returns a page of the document. This function can fail
|
||||
@param document the document whose page will be returned
|
||||
@param page_index the page index to get. First page has index 0.
|
||||
@see spectre_document_status
|
||||
*/
|
||||
SpectrePage *spectre_document_get_page (SpectreDocument *document,
|
||||
unsigned int page_index);
|
||||
|
||||
/*! Returns a page of the document referenced by label. This function can fail
|
||||
@param document the document whose page will be returned
|
||||
@param label the label of the page to get.
|
||||
@see spectre_document_status
|
||||
*/
|
||||
SpectrePage *spectre_document_get_page_by_label (SpectreDocument *document,
|
||||
const char *label);
|
||||
|
||||
/*! Convenient function for rendering documents with no pages, tipically eps.
|
||||
When used with multi-page documents the first page will be rendered.
|
||||
@param document the document to render
|
||||
@rc the rendering context specifying how the document has to be rendered
|
||||
@width the page width will be returned here, or NULL
|
||||
@height the page height will be returned here, or NULL
|
||||
@page_data a pointer that will point to the image data
|
||||
@row_length the length of an image row will be returned here
|
||||
@see spectre_document_render_full
|
||||
*/
|
||||
void spectre_document_render_full (SpectreDocument *document,
|
||||
SpectreRenderContext *rc,
|
||||
unsigned char **page_data,
|
||||
int *row_length);
|
||||
|
||||
/*! Convenient function for rendering documents with no pages, tipically eps.
|
||||
Document will be rendered with the default options, use spectre_document_render_full
|
||||
if you want to change any of them.
|
||||
When used with multi-page documents the first page will be rendered.
|
||||
@param document the document to render
|
||||
@width the page width will be returned here, or NULL
|
||||
@height the page height will be returned here, or NULL
|
||||
@page_data a pointer that will point to the image data
|
||||
@row_length the length of an image row will be returned here
|
||||
@see spectre_document_render_full
|
||||
*/
|
||||
void spectre_document_render (SpectreDocument *document,
|
||||
unsigned char **page_data,
|
||||
int *row_length);
|
||||
|
||||
/* Convenient function for getting the page size of documents with no pages, tipically eps.
|
||||
When used with multi-page documents the size of the first page will be returned.
|
||||
@param document the document whose page will be returned
|
||||
@width the page width will be returned here, or NULL
|
||||
@height the page height will be returned here, or NULL
|
||||
*/
|
||||
void spectre_document_get_page_size (SpectreDocument *document,
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
/*! Save document as filename. This function can fail
|
||||
@param document the document that will be saved
|
||||
@param filename the path where document will be saved
|
||||
@see spectre_document_status
|
||||
*/
|
||||
void spectre_document_save (SpectreDocument *document,
|
||||
const char *filename);
|
||||
/* Save document as a pdf document. This function can fail
|
||||
@param document the document that will be saved
|
||||
@param filename the path where document will be saved as pdf
|
||||
@see spectre_document_status
|
||||
*/
|
||||
void spectre_document_save_to_pdf (SpectreDocument *document,
|
||||
const char *filename);
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_DOCUMENT_H */
|
|
@ -0,0 +1,150 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "spectre-private.h"
|
||||
#include "spectre-utils.h"
|
||||
|
||||
static SpectreStatus
|
||||
spectre_exporter_pdf_begin (SpectreExporter *exporter,
|
||||
const char *filename)
|
||||
{
|
||||
char *args[10];
|
||||
int arg = 0;
|
||||
char *output_file;
|
||||
struct document *doc = exporter->doc;
|
||||
|
||||
exporter->gs = spectre_gs_new ();
|
||||
if (!spectre_gs_create_instance (exporter->gs, NULL)) {
|
||||
spectre_gs_cleanup (exporter->gs, CLEANUP_DELETE_INSTANCE);
|
||||
spectre_gs_free (exporter->gs);
|
||||
exporter->gs = NULL;
|
||||
|
||||
return SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
}
|
||||
|
||||
args[arg++] = "libspectre"; /* This value doesn't really matter */
|
||||
args[arg++] = "-dMaxBitmap=10000000";
|
||||
args[arg++] = "-dBATCH";
|
||||
args[arg++] = "-dNOPAUSE";
|
||||
args[arg++] = "-dSAFER";
|
||||
args[arg++] = "-P-";
|
||||
args[arg++] = "-sDEVICE=pdfwrite";
|
||||
args[arg++] = output_file = _spectre_strdup_printf ("-sOutputFile=%s",
|
||||
filename);
|
||||
args[arg++] = "-c";
|
||||
args[arg++] = ".setpdfwrite";
|
||||
|
||||
if (!spectre_gs_run (exporter->gs, 10, args)) {
|
||||
free (output_file);
|
||||
spectre_gs_free (exporter->gs);
|
||||
exporter->gs = NULL;
|
||||
|
||||
return SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
}
|
||||
|
||||
free (output_file);
|
||||
|
||||
if (!spectre_gs_process (exporter->gs,
|
||||
doc->filename,
|
||||
0, 0,
|
||||
doc->beginprolog,
|
||||
doc->endprolog)) {
|
||||
spectre_gs_free (exporter->gs);
|
||||
exporter->gs = NULL;
|
||||
|
||||
return SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
}
|
||||
|
||||
if (!spectre_gs_process (exporter->gs,
|
||||
doc->filename,
|
||||
0, 0,
|
||||
doc->beginsetup,
|
||||
doc->endsetup)) {
|
||||
spectre_gs_free (exporter->gs);
|
||||
exporter->gs = NULL;
|
||||
|
||||
return SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
}
|
||||
|
||||
return SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static SpectreStatus
|
||||
spectre_exporter_pdf_do_page (SpectreExporter *exporter,
|
||||
unsigned int page_index)
|
||||
{
|
||||
struct document *doc = exporter->doc;
|
||||
|
||||
if (!exporter->gs)
|
||||
return SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
|
||||
if (!spectre_gs_process (exporter->gs,
|
||||
doc->filename,
|
||||
0, 0,
|
||||
doc->pages[page_index].begin,
|
||||
doc->pages[page_index].end)) {
|
||||
spectre_gs_free (exporter->gs);
|
||||
exporter->gs = NULL;
|
||||
|
||||
return SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
}
|
||||
|
||||
return SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static SpectreStatus
|
||||
spectre_exporter_pdf_end (SpectreExporter *exporter)
|
||||
{
|
||||
int ret;
|
||||
struct document *doc = exporter->doc;
|
||||
|
||||
if (!exporter->gs)
|
||||
return SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
|
||||
ret = spectre_gs_process (exporter->gs,
|
||||
doc->filename,
|
||||
0, 0,
|
||||
doc->begintrailer,
|
||||
doc->endtrailer);
|
||||
spectre_gs_free (exporter->gs);
|
||||
exporter->gs = NULL;
|
||||
|
||||
return ret ? SPECTRE_STATUS_SUCCESS : SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
}
|
||||
|
||||
SpectreExporter *
|
||||
_spectre_exporter_pdf_new (struct document *doc)
|
||||
{
|
||||
SpectreExporter *exporter;
|
||||
|
||||
exporter = calloc (1, sizeof (SpectreExporter));
|
||||
if (!exporter)
|
||||
return NULL;
|
||||
|
||||
exporter->doc = psdocreference (doc);
|
||||
|
||||
exporter->begin = spectre_exporter_pdf_begin;
|
||||
exporter->do_page = spectre_exporter_pdf_do_page;
|
||||
exporter->end = spectre_exporter_pdf_end;
|
||||
|
||||
return exporter;
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "spectre-private.h"
|
||||
|
||||
static SpectreStatus
|
||||
spectre_exporter_ps_begin (SpectreExporter *exporter,
|
||||
const char *filename)
|
||||
{
|
||||
exporter->from = fopen (exporter->doc->filename, "rb");
|
||||
if (!exporter->from)
|
||||
return SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
|
||||
exporter->to = fopen (filename, "wb");
|
||||
if (!exporter->to) {
|
||||
fclose (exporter->from);
|
||||
exporter->from = NULL;
|
||||
return SPECTRE_STATUS_EXPORTER_ERROR;
|
||||
}
|
||||
|
||||
pscopyheaders (exporter->from, exporter->to, exporter->doc);
|
||||
|
||||
return SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static SpectreStatus
|
||||
spectre_exporter_ps_do_page (SpectreExporter *exporter,
|
||||
unsigned int page_index)
|
||||
{
|
||||
if (exporter->doc->numpages <= 0)
|
||||
return SPECTRE_STATUS_SUCCESS;
|
||||
|
||||
pscopypage (exporter->from, exporter->to, exporter->doc,
|
||||
page_index, exporter->n_pages++);
|
||||
|
||||
return SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static SpectreStatus
|
||||
spectre_exporter_ps_end (SpectreExporter *exporter)
|
||||
{
|
||||
pscopytrailer (exporter->from, exporter->to, exporter->doc,
|
||||
exporter->n_pages);
|
||||
|
||||
fclose (exporter->from);
|
||||
exporter->from = NULL;
|
||||
fclose (exporter->to);
|
||||
exporter->to = NULL;
|
||||
|
||||
return SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
SpectreExporter *
|
||||
_spectre_exporter_ps_new (struct document *doc)
|
||||
{
|
||||
SpectreExporter *exporter;
|
||||
|
||||
exporter = calloc (1, sizeof (SpectreExporter));
|
||||
if (!exporter)
|
||||
return NULL;
|
||||
|
||||
exporter->doc = psdocreference (doc);
|
||||
|
||||
exporter->begin = spectre_exporter_ps_begin;
|
||||
exporter->do_page = spectre_exporter_ps_do_page;
|
||||
exporter->end = spectre_exporter_ps_end;
|
||||
|
||||
return exporter;
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "spectre-exporter.h"
|
||||
#include "spectre-private.h"
|
||||
#include "spectre-utils.h"
|
||||
|
||||
SpectreExporter *
|
||||
spectre_exporter_new (SpectreDocument *document,
|
||||
SpectreExporterFormat format)
|
||||
{
|
||||
struct document *doc;
|
||||
|
||||
_spectre_return_val_if_fail (document != NULL, NULL);
|
||||
|
||||
doc = _spectre_document_get_doc (document);
|
||||
|
||||
switch (format) {
|
||||
case SPECTRE_EXPORTER_FORMAT_PS:
|
||||
return _spectre_exporter_ps_new (doc);
|
||||
case SPECTRE_EXPORTER_FORMAT_PDF:
|
||||
return _spectre_exporter_pdf_new (doc);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_exporter_free (SpectreExporter *exporter)
|
||||
{
|
||||
if (!exporter)
|
||||
return;
|
||||
|
||||
if (exporter->doc) {
|
||||
psdocdestroy (exporter->doc);
|
||||
exporter->doc = NULL;
|
||||
}
|
||||
|
||||
if (exporter->gs) {
|
||||
spectre_gs_free (exporter->gs);
|
||||
exporter->gs = NULL;
|
||||
}
|
||||
|
||||
if (exporter->from) {
|
||||
fclose (exporter->from);
|
||||
exporter->from = NULL;
|
||||
}
|
||||
|
||||
if (exporter->to) {
|
||||
fclose (exporter->to);
|
||||
exporter->to = NULL;
|
||||
}
|
||||
|
||||
free (exporter);
|
||||
}
|
||||
|
||||
SpectreStatus
|
||||
spectre_exporter_begin (SpectreExporter *exporter,
|
||||
const char *filename)
|
||||
{
|
||||
_spectre_return_val_if_fail (exporter != NULL, SPECTRE_STATUS_EXPORTER_ERROR);
|
||||
_spectre_return_val_if_fail (filename != NULL, SPECTRE_STATUS_EXPORTER_ERROR);
|
||||
|
||||
if (exporter->begin)
|
||||
return exporter->begin (exporter, filename);
|
||||
|
||||
return SPECTRE_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
SpectreStatus
|
||||
spectre_exporter_do_page (SpectreExporter *exporter,
|
||||
unsigned int page_index)
|
||||
{
|
||||
_spectre_return_val_if_fail (exporter != NULL, SPECTRE_STATUS_EXPORTER_ERROR);
|
||||
|
||||
return exporter->do_page (exporter, page_index);
|
||||
}
|
||||
|
||||
SpectreStatus
|
||||
spectre_exporter_end (SpectreExporter *exporter)
|
||||
{
|
||||
_spectre_return_val_if_fail (exporter != NULL, SPECTRE_STATUS_EXPORTER_ERROR);
|
||||
|
||||
if (exporter->end)
|
||||
return exporter->end (exporter);
|
||||
|
||||
return SPECTRE_STATUS_SUCCESS;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_EXPORTER_H
|
||||
#define SPECTRE_EXPORTER_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
#include <libspectre/spectre-document.h>
|
||||
#include <libspectre/spectre-status.h>
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
typedef enum {
|
||||
SPECTRE_EXPORTER_FORMAT_PS,
|
||||
SPECTRE_EXPORTER_FORMAT_PDF
|
||||
} SpectreExporterFormat;
|
||||
|
||||
typedef struct SpectreExporter SpectreExporter;
|
||||
|
||||
SpectreExporter *spectre_exporter_new (SpectreDocument *document,
|
||||
SpectreExporterFormat format);
|
||||
void spectre_exporter_free (SpectreExporter *exporter);
|
||||
SpectreStatus spectre_exporter_begin (SpectreExporter *exporter,
|
||||
const char *filename);
|
||||
SpectreStatus spectre_exporter_do_page (SpectreExporter *exporter,
|
||||
unsigned int page_index);
|
||||
SpectreStatus spectre_exporter_end (SpectreExporter *exporter);
|
||||
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_EXPORTER_H */
|
|
@ -0,0 +1,340 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "spectre-gs.h"
|
||||
#include "spectre-utils.h"
|
||||
|
||||
/* ghostscript stuff */
|
||||
#include <ghostscript/iapi.h>
|
||||
#include <ghostscript/ierrors.h>
|
||||
|
||||
/* e_ macros have been removed from Ghostscript in 9.18. */
|
||||
#ifndef e_Fatal
|
||||
#define e_Fatal gs_error_Fatal
|
||||
#endif
|
||||
#ifndef e_NeedInput
|
||||
#define e_NeedInput gs_error_NeedInput
|
||||
#endif
|
||||
#ifndef e_ExecStackUnderflow
|
||||
#define e_ExecStackUnderflow gs_error_ExecStackUnderflow
|
||||
#endif
|
||||
|
||||
#define BUFFER_SIZE 32768
|
||||
|
||||
struct SpectreGS {
|
||||
void *ghostscript_instance;
|
||||
};
|
||||
|
||||
static int
|
||||
critic_error_code (int code)
|
||||
{
|
||||
if (code >= 0)
|
||||
return FALSE;
|
||||
|
||||
if (code <= -100) {
|
||||
switch (code) {
|
||||
case e_Fatal:
|
||||
fprintf (stderr, "fatal internal error %d", code);
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case e_ExecStackUnderflow:
|
||||
fprintf (stderr, "stack overflow %d", code);
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
/* no error or not important */
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
const char *errors[] = { "", ERROR_NAMES };
|
||||
int x = (-1) * code;
|
||||
|
||||
if (x < (int) (sizeof (errors) / sizeof (const char*))) {
|
||||
fprintf (stderr, "%s %d\n", errors[x], code);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
spectre_gs_stdout (void *handler, const char *out, int len)
|
||||
{
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
spectre_gs_process (SpectreGS *gs,
|
||||
const char *filename,
|
||||
int x,
|
||||
int y,
|
||||
long begin,
|
||||
long end)
|
||||
{
|
||||
FILE *fd;
|
||||
int error;
|
||||
static char buf[BUFFER_SIZE];
|
||||
unsigned int read;
|
||||
int exit_code;
|
||||
size_t left = end - begin;
|
||||
void *ghostscript_instance = gs->ghostscript_instance;
|
||||
|
||||
fd = fopen (filename, "rb");
|
||||
if (!fd) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fseek (fd, begin, SEEK_SET);
|
||||
|
||||
error = gsapi_run_string_begin (ghostscript_instance, 0, &exit_code);
|
||||
if (critic_error_code (error)) {
|
||||
fclose (fd);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (x != 0 || y != 0) {
|
||||
char *set;
|
||||
|
||||
set = _spectre_strdup_printf ("%d %d translate\n", -x, -y);
|
||||
error = gsapi_run_string_continue (ghostscript_instance, set, strlen (set),
|
||||
0, &exit_code);
|
||||
error = error == e_NeedInput ? 0 : error;
|
||||
free (set);
|
||||
if (error != e_NeedInput && critic_error_code (error)) {
|
||||
fclose (fd);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
while (left > 0 && !critic_error_code (error)) {
|
||||
size_t to_read = BUFFER_SIZE;
|
||||
|
||||
if (left < to_read)
|
||||
to_read = left;
|
||||
|
||||
read = fread (buf, sizeof (char), to_read, fd);
|
||||
error = gsapi_run_string_continue (ghostscript_instance,
|
||||
buf, read, 0, &exit_code);
|
||||
error = error == e_NeedInput ? 0 : error;
|
||||
left -= read;
|
||||
}
|
||||
|
||||
fclose (fd);
|
||||
if (critic_error_code (error))
|
||||
return FALSE;
|
||||
|
||||
error = gsapi_run_string_end (ghostscript_instance, 0, &exit_code);
|
||||
if (critic_error_code (error))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
SpectreGS *
|
||||
spectre_gs_new (void)
|
||||
{
|
||||
SpectreGS *gs;
|
||||
|
||||
gs = calloc (1, sizeof (SpectreGS));
|
||||
|
||||
return gs;
|
||||
}
|
||||
|
||||
int
|
||||
spectre_gs_create_instance (SpectreGS *gs,
|
||||
void *caller_handle)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = gsapi_new_instance (&gs->ghostscript_instance, caller_handle);
|
||||
if (!critic_error_code (error)) {
|
||||
gsapi_set_stdio (gs->ghostscript_instance,
|
||||
NULL,
|
||||
spectre_gs_stdout,
|
||||
NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
spectre_gs_set_display_callback (SpectreGS *gs,
|
||||
void *callback)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = gsapi_set_display_callback (gs->ghostscript_instance,
|
||||
callback);
|
||||
return !critic_error_code (error);
|
||||
}
|
||||
|
||||
int
|
||||
spectre_gs_run (SpectreGS *gs,
|
||||
int n_args,
|
||||
char **args)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = gsapi_init_with_args (gs->ghostscript_instance, n_args, args);
|
||||
|
||||
return !critic_error_code (error);
|
||||
}
|
||||
|
||||
int
|
||||
spectre_gs_send_string (SpectreGS *gs,
|
||||
const char *str)
|
||||
{
|
||||
int error;
|
||||
int exit_code;
|
||||
|
||||
error = gsapi_run_string_with_length (gs->ghostscript_instance,
|
||||
str, strlen (str), 0, &exit_code);
|
||||
|
||||
return !critic_error_code (error);
|
||||
}
|
||||
|
||||
int
|
||||
spectre_gs_send_page (SpectreGS *gs,
|
||||
struct document *doc,
|
||||
unsigned int page_index,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
int xoffset = 0, yoffset = 0;
|
||||
int page_urx, page_ury, page_llx, page_lly;
|
||||
int bbox_urx, bbox_ury, bbox_llx, bbox_lly;
|
||||
int doc_xoffset = 0, doc_yoffset = 0;
|
||||
int page_xoffset = 0, page_yoffset = 0;
|
||||
|
||||
if (psgetpagebbox (doc, page_index, &bbox_urx, &bbox_ury, &bbox_llx, &bbox_lly)) {
|
||||
psgetpagebox (doc, page_index,
|
||||
&page_urx, &page_ury,
|
||||
&page_llx, &page_lly);
|
||||
if ((bbox_urx - bbox_llx) == (page_urx - page_llx) ||
|
||||
(bbox_ury - bbox_lly) == (page_ury - page_lly)) {
|
||||
/* BoundingBox */
|
||||
xoffset = page_llx;
|
||||
yoffset = page_lly;
|
||||
}
|
||||
}
|
||||
|
||||
if (doc->numpages > 0) {
|
||||
page_xoffset = xoffset + x;
|
||||
page_yoffset = yoffset + y;
|
||||
} else {
|
||||
doc_xoffset = xoffset + x;
|
||||
doc_yoffset = yoffset + y;
|
||||
}
|
||||
|
||||
if (!spectre_gs_process (gs,
|
||||
doc->filename,
|
||||
doc_xoffset,
|
||||
doc_yoffset,
|
||||
doc->beginprolog,
|
||||
doc->endprolog))
|
||||
return FALSE;
|
||||
|
||||
if (!spectre_gs_process (gs,
|
||||
doc->filename,
|
||||
0, 0,
|
||||
doc->beginsetup,
|
||||
doc->endsetup))
|
||||
return FALSE;
|
||||
|
||||
if (doc->numpages > 0) {
|
||||
if (doc->pageorder == SPECIAL) {
|
||||
unsigned int i;
|
||||
/* Pages cannot be re-ordered */
|
||||
|
||||
|
||||
for (i = 0; i < page_index; i++) {
|
||||
if (!spectre_gs_process (gs,
|
||||
doc->filename,
|
||||
page_xoffset,
|
||||
page_yoffset,
|
||||
doc->pages[i].begin,
|
||||
doc->pages[i].end))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!spectre_gs_process (gs,
|
||||
doc->filename,
|
||||
page_xoffset,
|
||||
page_yoffset,
|
||||
doc->pages[page_index].begin,
|
||||
doc->pages[page_index].end))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!spectre_gs_process (gs,
|
||||
doc->filename,
|
||||
0, 0,
|
||||
doc->begintrailer,
|
||||
doc->endtrailer))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_gs_cleanup (SpectreGS *gs,
|
||||
SpectreGSCleanupFlag flag)
|
||||
{
|
||||
if (gs->ghostscript_instance == NULL)
|
||||
return;
|
||||
|
||||
if (flag & CLEANUP_EXIT)
|
||||
gsapi_exit (gs->ghostscript_instance);
|
||||
|
||||
if (flag & CLEANUP_DELETE_INSTANCE)
|
||||
gsapi_delete_instance (gs->ghostscript_instance);
|
||||
|
||||
gs->ghostscript_instance = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_gs_free (SpectreGS *gs)
|
||||
{
|
||||
if (!gs)
|
||||
return;
|
||||
|
||||
spectre_gs_cleanup (gs,
|
||||
CLEANUP_DELETE_INSTANCE |
|
||||
CLEANUP_EXIT);
|
||||
free (gs);
|
||||
}
|
||||
|
||||
long
|
||||
spectre_gs_get_version (void)
|
||||
{
|
||||
gsapi_revision_t gsrev;
|
||||
|
||||
if (gsapi_revision (&gsrev, sizeof(gsrev)) != 0)
|
||||
return 0;
|
||||
|
||||
return gsrev.revision;
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_GS_H
|
||||
#define SPECTRE_GS_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
|
||||
#include "ps.h"
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
typedef enum {
|
||||
CLEANUP_DELETE_INSTANCE = 1 << 0,
|
||||
CLEANUP_EXIT = 1 << 1
|
||||
} SpectreGSCleanupFlag;
|
||||
|
||||
typedef struct SpectreGS SpectreGS;
|
||||
|
||||
SpectreGS *spectre_gs_new (void);
|
||||
int spectre_gs_create_instance (SpectreGS *gs,
|
||||
void *caller_handle);
|
||||
int spectre_gs_set_display_callback (SpectreGS *gs,
|
||||
void *callback);
|
||||
int spectre_gs_run (SpectreGS *gs,
|
||||
int n_args,
|
||||
char **args);
|
||||
int spectre_gs_process (SpectreGS *gs,
|
||||
const char *filename,
|
||||
int x,
|
||||
int y,
|
||||
long begin,
|
||||
long end);
|
||||
int spectre_gs_send_string (SpectreGS *gs,
|
||||
const char *str);
|
||||
int spectre_gs_send_page (SpectreGS *gs,
|
||||
struct document *doc,
|
||||
unsigned int page_index,
|
||||
int x,
|
||||
int y);
|
||||
void spectre_gs_cleanup (SpectreGS *gs,
|
||||
SpectreGSCleanupFlag flag);
|
||||
void spectre_gs_free (SpectreGS *gs);
|
||||
long spectre_gs_get_version (void);
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_GS_H */
|
|
@ -0,0 +1,47 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_MACROS_H
|
||||
#define SPECTRE_MACROS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define SPECTRE_BEGIN_DECLS extern "C" {
|
||||
# define SPECTRE_END_DECLS }
|
||||
#else
|
||||
# define SPECTRE_BEGIN_DECLS
|
||||
# define SPECTRE_END_DECLS
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
# ifdef __cplusplus
|
||||
# define NULL (0L)
|
||||
# else /* !__cplusplus */
|
||||
# define NULL ((void*) 0)
|
||||
# endif /* !__cplusplus */
|
||||
#endif
|
||||
|
||||
#endif /* SPECTRE_MACROS_H */
|
|
@ -0,0 +1,194 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "spectre-page.h"
|
||||
|
||||
#include "spectre-device.h"
|
||||
#include "spectre-private.h"
|
||||
#include "spectre-utils.h"
|
||||
|
||||
struct SpectrePage
|
||||
{
|
||||
struct document *doc;
|
||||
|
||||
SpectreStatus status;
|
||||
|
||||
unsigned int index;
|
||||
int width;
|
||||
int height;
|
||||
};
|
||||
|
||||
SpectrePage *
|
||||
_spectre_page_new (unsigned int page_index,
|
||||
struct document *doc)
|
||||
{
|
||||
SpectrePage *page;
|
||||
|
||||
page = calloc (1, sizeof (SpectrePage));
|
||||
if (!page)
|
||||
return NULL;
|
||||
|
||||
page->index = page_index;
|
||||
page->width = -1;
|
||||
page->height = -1;
|
||||
page->doc = psdocreference (doc);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_page_free (SpectrePage *page)
|
||||
{
|
||||
if (!page)
|
||||
return;
|
||||
|
||||
if (page->doc) {
|
||||
psdocdestroy (page->doc);
|
||||
page->doc = NULL;
|
||||
}
|
||||
|
||||
free (page);
|
||||
}
|
||||
|
||||
SpectreStatus
|
||||
spectre_page_status (SpectrePage *page)
|
||||
{
|
||||
_spectre_return_val_if_fail (page != NULL, SPECTRE_STATUS_INVALID_PAGE);
|
||||
|
||||
return page->status;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
spectre_page_get_index (SpectrePage *page)
|
||||
{
|
||||
_spectre_return_val_if_fail (page != NULL, 0);
|
||||
|
||||
return page->index;
|
||||
}
|
||||
|
||||
const char *
|
||||
spectre_page_get_label (SpectrePage *page)
|
||||
{
|
||||
_spectre_return_val_if_fail (page != NULL, NULL);
|
||||
|
||||
return page->doc->numpages > 0 ? page->doc->pages[page->index].label : NULL;
|
||||
}
|
||||
|
||||
SpectreOrientation
|
||||
spectre_page_get_orientation (SpectrePage *page)
|
||||
{
|
||||
int page_orientation = NONE;
|
||||
|
||||
_spectre_return_val_if_fail (page != NULL, SPECTRE_ORIENTATION_PORTRAIT);
|
||||
|
||||
if (page->doc->numpages > 0) {
|
||||
page_orientation = page->doc->pages[page->index].orientation != NONE ?
|
||||
page->doc->pages[page->index].orientation :
|
||||
page->doc->default_page_orientation;
|
||||
}
|
||||
|
||||
if (page_orientation == NONE)
|
||||
page_orientation = page->doc->orientation;
|
||||
|
||||
switch (page_orientation) {
|
||||
default:
|
||||
case PORTRAIT:
|
||||
return SPECTRE_ORIENTATION_PORTRAIT;
|
||||
case LANDSCAPE:
|
||||
return SPECTRE_ORIENTATION_LANDSCAPE;
|
||||
case SEASCAPE:
|
||||
return SPECTRE_ORIENTATION_REVERSE_LANDSCAPE;
|
||||
case UPSIDEDOWN:
|
||||
return SPECTRE_ORIENTATION_REVERSE_PORTRAIT;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
spectre_page_get_size (SpectrePage *page,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
_spectre_return_if_fail (page != NULL);
|
||||
|
||||
if (page->width == -1 || page->height == -1) {
|
||||
int urx, ury, llx, lly;
|
||||
|
||||
psgetpagebox (page->doc, page->index,
|
||||
&urx, &ury, &llx, &lly);
|
||||
|
||||
page->width = urx - llx;
|
||||
page->height = ury - lly;
|
||||
}
|
||||
|
||||
if (width)
|
||||
*width = page->width;
|
||||
if (height)
|
||||
*height = page->height;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_page_render (SpectrePage *page,
|
||||
SpectreRenderContext *rc,
|
||||
unsigned char **page_data,
|
||||
int *row_length)
|
||||
{
|
||||
SpectreDevice *device;
|
||||
int width, height;
|
||||
|
||||
_spectre_return_if_fail (page != NULL);
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
spectre_page_get_size (page, &width, &height);
|
||||
|
||||
device = spectre_device_new (page->doc);
|
||||
page->status = spectre_device_render (device, page->index, rc,
|
||||
0, 0, width, height,
|
||||
page_data, row_length);
|
||||
spectre_device_free (device);
|
||||
}
|
||||
|
||||
void
|
||||
spectre_page_render_slice (SpectrePage *page,
|
||||
SpectreRenderContext *rc,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
unsigned char **page_data,
|
||||
int *row_length)
|
||||
{
|
||||
SpectreDevice *device;
|
||||
int page_height;
|
||||
|
||||
_spectre_return_if_fail (page != NULL);
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
spectre_page_get_size (page, NULL, &page_height);
|
||||
|
||||
device = spectre_device_new (page->doc);
|
||||
page->status = spectre_device_render (device, page->index, rc,
|
||||
x, page_height - (y + height),
|
||||
width, height,
|
||||
page_data, row_length);
|
||||
spectre_device_free (device);
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_PAGE_H
|
||||
#define SPECTRE_PAGE_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
#include <libspectre/spectre-status.h>
|
||||
#include <libspectre/spectre-render-context.h>
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
typedef enum {
|
||||
SPECTRE_ORIENTATION_PORTRAIT /*! Vertical orientation */,
|
||||
SPECTRE_ORIENTATION_REVERSE_LANDSCAPE /*! Inverse horizontal orientation,
|
||||
also known as Seascape */,
|
||||
SPECTRE_ORIENTATION_REVERSE_PORTRAIT /*! Inverse vertical orientation */,
|
||||
SPECTRE_ORIENTATION_LANDSCAPE /*! Horizontal orientation */
|
||||
} SpectreOrientation;
|
||||
|
||||
/*! This is the object that represents a page of a PostScript document.
|
||||
They can not be created directly and can only be obtained from
|
||||
::spectre_document_get_page */
|
||||
typedef struct SpectrePage SpectrePage;
|
||||
|
||||
/*! Returns the status of the given page
|
||||
@param page The page whose status will be returned
|
||||
*/
|
||||
SpectreStatus spectre_page_status (SpectrePage *page);
|
||||
|
||||
/*! Frees the memory of the given page
|
||||
@param page The page whose memory will be freed
|
||||
*/
|
||||
void spectre_page_free (SpectrePage *page);
|
||||
|
||||
/*! Returns the index of the page inside the document. First page has index 0
|
||||
@param page The page whose index will be returned
|
||||
*/
|
||||
unsigned int spectre_page_get_index (SpectrePage *page);
|
||||
|
||||
/*! Returns the label of the page inside the document.
|
||||
@param page The page whose label will be returned
|
||||
*/
|
||||
const char *spectre_page_get_label (SpectrePage *page);
|
||||
|
||||
/*! Returns the orientation of the page
|
||||
@param page The page whose orientation will be returned
|
||||
*/
|
||||
SpectreOrientation spectre_page_get_orientation (SpectrePage *page);
|
||||
|
||||
/*! Returns the size of the page. It always returns the page size according to
|
||||
the page bounding box without taking into account the page orientation.
|
||||
@param page The page whose size will be returned
|
||||
@param width The page width will be returned here, or NULL
|
||||
@param height The page height will be returned here, or NULL
|
||||
@see spectre_page_get_orientation
|
||||
*/
|
||||
void spectre_page_get_size (SpectrePage *page,
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
/*! Renders the page to RGB32 format. This function can fail
|
||||
@param page The page to renderer
|
||||
@param rc The rendering context specifying how the page has to be rendered
|
||||
@param page_data A pointer that will point to the image data
|
||||
if the call succeeds
|
||||
@param row_length The length of an image row will be returned here. It can
|
||||
happen that row_length is different than width * 4
|
||||
@see spectre_page_status
|
||||
*/
|
||||
void spectre_page_render (SpectrePage *page,
|
||||
SpectreRenderContext *rc,
|
||||
unsigned char **page_data,
|
||||
int *row_length);
|
||||
|
||||
/* ! Renders a rectangle of the page to RGB32 format. This function can fail
|
||||
@param page The page to renderer
|
||||
@param rc The rendering context specifying how the page has to be rendered
|
||||
@param x The X coordinate of the top left corner of the rectangle
|
||||
@param y The Y coordinate to the top left corner of the rectangle
|
||||
@param width The width of the rectangle
|
||||
@param height The height of the rectangle
|
||||
@param page_data A pointer that will point to the image data
|
||||
if the call succeeds
|
||||
@param row_length The length of an image row will be returned here. It can
|
||||
happen that row_length is different than width * 4
|
||||
@see spectre_page_status
|
||||
*/
|
||||
void spectre_page_render_slice (SpectrePage *page,
|
||||
SpectreRenderContext *rc,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
unsigned char **page_data,
|
||||
int *row_length);
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_PAGE_H */
|
|
@ -0,0 +1,74 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_PRIVATE_H
|
||||
#define SPECTRE_PRIVATE_H
|
||||
|
||||
#include "spectre-macros.h"
|
||||
#include "spectre-status.h"
|
||||
#include "spectre-document.h"
|
||||
#include "spectre-page.h"
|
||||
#include "spectre-exporter.h"
|
||||
#include "spectre-gs.h"
|
||||
#include "ps.h"
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
struct SpectreRenderContext {
|
||||
double x_scale;
|
||||
double y_scale;
|
||||
SpectreOrientation orientation;
|
||||
double x_dpi;
|
||||
double y_dpi;
|
||||
int width;
|
||||
int height;
|
||||
int text_alpha_bits;
|
||||
int graphic_alpha_bits;
|
||||
int use_platform_fonts;
|
||||
};
|
||||
|
||||
struct SpectreExporter {
|
||||
struct document *doc;
|
||||
|
||||
/* PDF specific */
|
||||
SpectreGS *gs;
|
||||
|
||||
/* PS specific */
|
||||
FILE *from;
|
||||
FILE *to;
|
||||
int n_pages;
|
||||
|
||||
|
||||
SpectreStatus (* begin) (SpectreExporter *exporter,
|
||||
const char *filename);
|
||||
SpectreStatus (* do_page) (SpectreExporter *exporter,
|
||||
unsigned int page_index);
|
||||
SpectreStatus (* end) (SpectreExporter *exporter);
|
||||
};
|
||||
|
||||
SpectrePage *_spectre_page_new (unsigned int page_index,
|
||||
struct document *doc);
|
||||
struct document *_spectre_document_get_doc (SpectreDocument *document);
|
||||
SpectreExporter *_spectre_exporter_ps_new (struct document *doc);
|
||||
SpectreExporter *_spectre_exporter_pdf_new (struct document *doc);
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_PRIVATE_H */
|
|
@ -0,0 +1,209 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2; or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful;
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not; write to the Free Software
|
||||
* Foundation; Inc.; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "spectre-render-context.h"
|
||||
#include "spectre-page.h"
|
||||
#include "spectre-private.h"
|
||||
#include "spectre-utils.h"
|
||||
|
||||
SpectreRenderContext *
|
||||
spectre_render_context_new (void)
|
||||
{
|
||||
SpectreRenderContext *rc;
|
||||
|
||||
rc = malloc (sizeof (SpectreRenderContext));
|
||||
if (!rc)
|
||||
return NULL;
|
||||
|
||||
rc->x_scale = 1.0;
|
||||
rc->y_scale = 1.0;
|
||||
rc->orientation = 0;
|
||||
rc->x_dpi = 72.0;
|
||||
rc->y_dpi = 72.0;
|
||||
rc->width = -1;
|
||||
rc->height = -1;
|
||||
rc->text_alpha_bits = 4;
|
||||
rc->graphic_alpha_bits = 2;
|
||||
rc->use_platform_fonts = TRUE;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_free (SpectreRenderContext *rc)
|
||||
{
|
||||
if (!rc)
|
||||
return;
|
||||
|
||||
free (rc);
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_set_scale (SpectreRenderContext *rc,
|
||||
double x_scale,
|
||||
double y_scale)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
rc->x_scale = x_scale;
|
||||
rc->y_scale = y_scale;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_get_scale (SpectreRenderContext *rc,
|
||||
double *x_scale,
|
||||
double *y_scale)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
if (x_scale)
|
||||
*x_scale = rc->x_scale;
|
||||
if (y_scale)
|
||||
*y_scale = rc->y_scale;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_set_rotation (SpectreRenderContext *rc,
|
||||
unsigned int rotation)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
rotation %= 360;
|
||||
|
||||
if (rotation < 90)
|
||||
rc->orientation = SPECTRE_ORIENTATION_PORTRAIT;
|
||||
else if (rotation >= 90 && rotation < 180)
|
||||
rc->orientation = SPECTRE_ORIENTATION_LANDSCAPE;
|
||||
else if (rotation >= 180 && rotation < 270)
|
||||
rc->orientation = SPECTRE_ORIENTATION_REVERSE_PORTRAIT;
|
||||
else if (rotation >= 270 && rotation < 360)
|
||||
rc->orientation = SPECTRE_ORIENTATION_REVERSE_LANDSCAPE;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
spectre_render_context_get_rotation (SpectreRenderContext *rc)
|
||||
{
|
||||
_spectre_return_val_if_fail (rc != NULL, 0);
|
||||
|
||||
switch (rc->orientation) {
|
||||
default:
|
||||
case SPECTRE_ORIENTATION_PORTRAIT:
|
||||
return 0;
|
||||
case SPECTRE_ORIENTATION_LANDSCAPE:
|
||||
return 90;
|
||||
case SPECTRE_ORIENTATION_REVERSE_PORTRAIT:
|
||||
return 180;
|
||||
case SPECTRE_ORIENTATION_REVERSE_LANDSCAPE:
|
||||
return 270;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_set_resolution (SpectreRenderContext *rc,
|
||||
double x_dpi,
|
||||
double y_dpi)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
rc->x_dpi = x_dpi;
|
||||
rc->y_dpi = y_dpi;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_get_resolution (SpectreRenderContext *rc,
|
||||
double *x_dpi,
|
||||
double *y_dpi)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
if (x_dpi)
|
||||
*x_dpi = rc->x_dpi;
|
||||
if (y_dpi)
|
||||
*y_dpi = rc->y_dpi;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_set_page_size (SpectreRenderContext *rc,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
rc->width = width;
|
||||
rc->height = height;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_get_page_size (SpectreRenderContext *rc,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
if (width)
|
||||
*width = rc->width;
|
||||
if (height)
|
||||
*height = rc->height;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_set_use_platform_fonts (SpectreRenderContext *rc,
|
||||
int use_platform_fonts)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
rc->use_platform_fonts = use_platform_fonts;
|
||||
}
|
||||
|
||||
int
|
||||
spectre_render_context_get_use_platform_fonts (SpectreRenderContext *rc)
|
||||
{
|
||||
_spectre_return_val_if_fail (rc != NULL, FALSE);
|
||||
|
||||
return rc->use_platform_fonts;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_set_antialias_bits (SpectreRenderContext *rc,
|
||||
int graphics_bits,
|
||||
int text_bits)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
rc->graphic_alpha_bits = graphics_bits;
|
||||
rc->text_alpha_bits = text_bits;
|
||||
}
|
||||
|
||||
void
|
||||
spectre_render_context_get_antialias_bits (SpectreRenderContext *rc,
|
||||
int *graphics_bits,
|
||||
int *text_bits)
|
||||
{
|
||||
_spectre_return_if_fail (rc != NULL);
|
||||
|
||||
if (graphics_bits)
|
||||
*graphics_bits = rc->graphic_alpha_bits;
|
||||
if (text_bits)
|
||||
*text_bits = rc->text_alpha_bits;
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2; or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful;
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not; write to the Free Software
|
||||
* Foundation; Inc.; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_RENDER_CONTEXT_H
|
||||
#define SPECTRE_RENDER_CONTEXT_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
/*! This object defines how a page will be rendered */
|
||||
typedef struct SpectreRenderContext SpectreRenderContext;
|
||||
|
||||
/*! Creates a rendering context */
|
||||
SpectreRenderContext *spectre_render_context_new (void);
|
||||
|
||||
/*! Frees a rendering context
|
||||
@param rc The rendering context to free
|
||||
*/
|
||||
void spectre_render_context_free (SpectreRenderContext *rc);
|
||||
|
||||
/*! Sets the scale. The default is 1
|
||||
@param rc The rendering context to modify
|
||||
@param x_scale The scale factor for the X dimension to use when rendering. 2 is twice as big
|
||||
@param y_scale The scale factor for the Y dimension to use when rendering. 2 is twice as big
|
||||
*/
|
||||
void spectre_render_context_set_scale (SpectreRenderContext *rc,
|
||||
double x_scale,
|
||||
double y_scale);
|
||||
|
||||
/*! Gets the scale
|
||||
@param rc The rendering context to query
|
||||
@param x_scale The scale factor for the X dimension will be stored here, or NULL
|
||||
@param y_scale The scale factor for the Y dimension will be stored here, or NULL
|
||||
*/
|
||||
void spectre_render_context_get_scale (SpectreRenderContext *rc,
|
||||
double *x_scale,
|
||||
double *y_scale);
|
||||
|
||||
/*! Sets the rotation. The default is 0
|
||||
@param rc The rendering context to modify
|
||||
@param rotation The rotation to use when rendering. Usually 0, 90, 180 or 270
|
||||
*/
|
||||
void spectre_render_context_set_rotation (SpectreRenderContext *rc,
|
||||
unsigned int rotation);
|
||||
|
||||
/*! Gets the rotation
|
||||
@param rc The rendering context to query
|
||||
*/
|
||||
unsigned int spectre_render_context_get_rotation (SpectreRenderContext *rc);
|
||||
|
||||
/*! Sets the resolution. The default is 72 for both directions
|
||||
@param rc The rendering context to modify
|
||||
@param x_dpi the horizontal resolution to set
|
||||
@param y_dpi the vertical resolution to set
|
||||
*/
|
||||
void spectre_render_context_set_resolution (SpectreRenderContext *rc,
|
||||
double x_dpi,
|
||||
double y_dpi);
|
||||
|
||||
/*! Gets the resolution
|
||||
@param rc The rendering context to query
|
||||
@param x_dpi the horizontal resolution will be stored here, or NULL
|
||||
@param y_dpi the vertical resolution will be stored here, or NULL
|
||||
*/
|
||||
void spectre_render_context_get_resolution (SpectreRenderContext *rc,
|
||||
double *x_dpi,
|
||||
double *y_dpi);
|
||||
|
||||
/*! Sets the page size in pixels. Rotation shouldn't be considered,
|
||||
the page size will be automatically adjusted when rendering according
|
||||
to the rotation selected. Note that the page size doesn't affect the
|
||||
scale. If no page size is given the page bounding box will be used,
|
||||
or the rectangle given when using spectre_page_render_slice
|
||||
@param rc The rendering context to modify
|
||||
@param width the width of the page
|
||||
@param height the height of the page
|
||||
*/
|
||||
void spectre_render_context_set_page_size (SpectreRenderContext *rc,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
/*! Gets the page size in pixels
|
||||
@param rc The rendering context to query
|
||||
@param width the width of the page will be stored here, or NULL
|
||||
@param height the height of the page will be stored here, or NULL
|
||||
*/
|
||||
void spectre_render_context_get_page_size (SpectreRenderContext *rc,
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
/*! Sets whether to use the platform fonts when rendering or not. The default is TRUE
|
||||
@param rc The rendering context to modify
|
||||
@param use_platform_fonts should platform fonts be used when rendering?
|
||||
*/
|
||||
void spectre_render_context_set_use_platform_fonts (SpectreRenderContext *rc,
|
||||
int use_platform_fonts);
|
||||
|
||||
/*! Gets whether to use the platform fonts when rendering or not
|
||||
@param rc The rendering context to query
|
||||
*/
|
||||
int spectre_render_context_get_use_platform_fonts (SpectreRenderContext *rc);
|
||||
|
||||
/*! Sets the antialias options for graphics and texts. The default is 4 for graphics and 2 for text
|
||||
@param rc The rendering context to modify
|
||||
@param graphics_bits The number of antialias bits to use for graphics.
|
||||
Typically 4 for antialias and 1 for no antialias
|
||||
@param text_bits The number of antialias bits to use for text.
|
||||
Typically 2 for antialias and 1 for no antialias
|
||||
*/
|
||||
void spectre_render_context_set_antialias_bits (SpectreRenderContext *rc,
|
||||
int graphics_bits,
|
||||
int text_bits);
|
||||
|
||||
/*! Gets the antialias options for graphics and texts
|
||||
@param rc The rendering context to query
|
||||
@param graphics_bits The number of antialias bits to use for graphics will be stored here
|
||||
@param text_bits The number of antialias bits to use for text will be stored here
|
||||
*/
|
||||
void spectre_render_context_get_antialias_bits (SpectreRenderContext *rc,
|
||||
int *graphics_bits,
|
||||
int *text_bits);
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_PAGE_H */
|
|
@ -0,0 +1,46 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "spectre-status.h"
|
||||
|
||||
const char *
|
||||
spectre_status_to_string (SpectreStatus status)
|
||||
{
|
||||
switch (status) {
|
||||
case SPECTRE_STATUS_SUCCESS:
|
||||
return "success";
|
||||
case SPECTRE_STATUS_NO_MEMORY:
|
||||
return "out of memory";
|
||||
case SPECTRE_STATUS_LOAD_ERROR:
|
||||
return "error loading document";
|
||||
case SPECTRE_STATUS_DOCUMENT_NOT_LOADED:
|
||||
return "document is not loaded";
|
||||
case SPECTRE_STATUS_INVALID_PAGE:
|
||||
return "page is invalid";
|
||||
case SPECTRE_STATUS_RENDER_ERROR:
|
||||
return "render error";
|
||||
case SPECTRE_STATUS_EXPORTER_ERROR:
|
||||
return "exporter error";
|
||||
case SPECTRE_STATUS_SAVE_ERROR:
|
||||
return "save error";
|
||||
}
|
||||
|
||||
return "unknown error status";
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_STATUS_H
|
||||
#define SPECTRE_STATUS_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
/*! Defines the error status of a Spectre object */
|
||||
typedef enum _SpectreStatus {
|
||||
SPECTRE_STATUS_SUCCESS /*! No error */ = 0,
|
||||
SPECTRE_STATUS_NO_MEMORY /*! There has been a problem
|
||||
allocating memory */,
|
||||
SPECTRE_STATUS_LOAD_ERROR /*! There has been a problem
|
||||
loading the postcript file */,
|
||||
SPECTRE_STATUS_DOCUMENT_NOT_LOADED /*! A function that needs the
|
||||
document to be loaded has been
|
||||
called and the document has not
|
||||
been loaded or there was an
|
||||
error when loading it */,
|
||||
SPECTRE_STATUS_INVALID_PAGE /*! The request page number
|
||||
is not in the document page
|
||||
range */,
|
||||
SPECTRE_STATUS_RENDER_ERROR /*! There has been a problem
|
||||
rendering the page */,
|
||||
SPECTRE_STATUS_EXPORTER_ERROR /*! There has been a problem
|
||||
exporting the document */,
|
||||
SPECTRE_STATUS_SAVE_ERROR /*! There has been a problem
|
||||
saving the document */
|
||||
} SpectreStatus;
|
||||
|
||||
/*! Gets a textual description of the given status
|
||||
@param status the status whose textual description will be returned
|
||||
*/
|
||||
const char *spectre_status_to_string (SpectreStatus status);
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_STATUS_H */
|
|
@ -0,0 +1,382 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include "spectre-utils.h"
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
static unsigned long
|
||||
_spectre_get_pid (void)
|
||||
{
|
||||
#if defined(HAVE_SYS_TYPES_H) && defined(HAVE_UNISTD_H)
|
||||
return getpid ();
|
||||
#elif defined(WIN32)
|
||||
return GetCurrentProcessId ();
|
||||
#endif
|
||||
}
|
||||
|
||||
static int warn_initted = FALSE;
|
||||
static int fatal_warnings = FALSE;
|
||||
static int fatal_warnings_on_check_failed = FALSE;
|
||||
|
||||
static void
|
||||
init_warnings (void)
|
||||
{
|
||||
const char *s;
|
||||
|
||||
if (warn_initted)
|
||||
return;
|
||||
|
||||
warn_initted = TRUE;
|
||||
|
||||
s = getenv ("SPECTRE_FATAL_WARNINGS");
|
||||
if (!s || !(*s))
|
||||
return;
|
||||
|
||||
if (*s == '0') {
|
||||
fatal_warnings = FALSE;
|
||||
fatal_warnings_on_check_failed = FALSE;
|
||||
} else if (*s == '1') {
|
||||
fatal_warnings = TRUE;
|
||||
fatal_warnings_on_check_failed = TRUE;
|
||||
} else {
|
||||
fprintf (stderr,
|
||||
"SPECTRE_FATAL_WARNINGS should be set to 0 or 1 if set, not '%s'",
|
||||
s);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints a warning message to stderr. Can optionally be made to exit
|
||||
* fatally by setting SPECTRE_FATAL_WARNINGS, but this is rarely
|
||||
* used. This function should be considered pretty much equivalent to
|
||||
* fprintf(stderr). _spectre_warn_check_failed() on the other hand is
|
||||
* suitable for use when a programming mistake has been made.
|
||||
*/
|
||||
void
|
||||
_spectre_warn (const char *format,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
if (!warn_initted)
|
||||
init_warnings ();
|
||||
|
||||
va_start (args, format);
|
||||
vfprintf (stderr, format, args);
|
||||
va_end (args);
|
||||
|
||||
if (fatal_warnings) {
|
||||
fflush (stderr);
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints a "critical" warning to stderr when an assertion fails;
|
||||
* differs from _spectre_warn primarily in that it prefixes the pid and
|
||||
* defaults to fatal. This should be used only when a programming
|
||||
* error has been detected. (NOT for unavoidable errors that an app
|
||||
* might handle. Calling this means "there is a bug"
|
||||
*/
|
||||
void
|
||||
_spectre_warn_check_failed (const char *format,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
if (!warn_initted)
|
||||
init_warnings ();
|
||||
|
||||
fprintf (stderr, "process %lu: ", _spectre_get_pid ());
|
||||
|
||||
va_start (args, format);
|
||||
vfprintf (stderr, format, args);
|
||||
va_end (args);
|
||||
|
||||
if (fatal_warnings_on_check_failed) {
|
||||
fflush (stderr);
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef SPECTRE_DISABLE_ASSERT
|
||||
void
|
||||
_spectre_real_assert (int condition,
|
||||
const char *condition_text,
|
||||
const char *file,
|
||||
int line,
|
||||
const char *func)
|
||||
{
|
||||
if (_SPECTRE_UNLIKELY (!condition)) {
|
||||
_spectre_warn ("%lu: assertion failed \"%s\" file \"%s\" line %d function %s\n",
|
||||
_spectre_get_pid (), condition_text, file, line, func);
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
#endif /* SPECTRE_DISABLE_ASSERT */
|
||||
|
||||
static char *
|
||||
spectre_strdup_vprintf (const char *format,
|
||||
va_list args)
|
||||
{
|
||||
char *string = NULL;
|
||||
int len;
|
||||
#if defined(HAVE_VASPRINTF)
|
||||
len = vasprintf (&string, format, args);
|
||||
|
||||
if (len < 0)
|
||||
string = NULL;
|
||||
#else /* !HAVE_VASPRINTF */
|
||||
va_list args_copy;
|
||||
int n;
|
||||
char c;
|
||||
|
||||
SPECTRE_VA_COPY (args_copy, args);
|
||||
|
||||
#if HAVE__VSCPRINTF
|
||||
n = _vscprintf (format, args);
|
||||
#else
|
||||
n = vsnprintf (&c, 1, format, args);
|
||||
#endif
|
||||
string = malloc ((n + 1) * sizeof (char));
|
||||
if (string) {
|
||||
len = vsprintf (string, format, args_copy);
|
||||
if (len < 0) {
|
||||
free (string);
|
||||
string = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
va_end (args_copy);
|
||||
#endif
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
char *
|
||||
_spectre_strdup_printf (const char *format, ...)
|
||||
{
|
||||
char *buffer;
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
buffer = spectre_strdup_vprintf (format, args);
|
||||
va_end (args);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
char *
|
||||
_spectre_strdup (const char *str)
|
||||
{
|
||||
size_t len;
|
||||
char *copy;
|
||||
|
||||
if (!str)
|
||||
return NULL;
|
||||
|
||||
len = strlen (str) + 1;
|
||||
|
||||
copy = malloc (len);
|
||||
if (!copy)
|
||||
return NULL;
|
||||
|
||||
memcpy (copy, str, len);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
#define TOLOWER(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' + 'a' : (c))
|
||||
int
|
||||
_spectre_strncasecmp (const char *s1,
|
||||
const char *s2,
|
||||
size_t n)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
while (n && *s1 && *s2) {
|
||||
n -= 1;
|
||||
c1 = (int)(unsigned char) TOLOWER (*s1);
|
||||
c2 = (int)(unsigned char) TOLOWER (*s2);
|
||||
if (c1 != c2)
|
||||
return (c1 - c2);
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
||||
return (n) ? (((int) (unsigned char) *s1) - ((int) (unsigned char) *s2)) : 0;
|
||||
}
|
||||
|
||||
int
|
||||
_spectre_strcasecmp (const char *s1,
|
||||
const char *s2)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
while (*s1 && *s2) {
|
||||
c1 = (int)(unsigned char) TOLOWER (*s1);
|
||||
c2 = (int)(unsigned char) TOLOWER (*s2);
|
||||
if (c1 != c2)
|
||||
return (c1 - c2);
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
||||
return (((int)(unsigned char) *s1) - ((int)(unsigned char) *s2));
|
||||
}
|
||||
|
||||
#define ascii_isspace(c) \
|
||||
(c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
|
||||
#define ascii_isdigit(c) \
|
||||
(c >= '0' && c <= '9')
|
||||
|
||||
/* This function behaves like the standard strtod() function
|
||||
* does in the C locale. It does this without actually changing
|
||||
* the current locale, since that would not be thread-safe.
|
||||
* A limitation of the implementation is that this function
|
||||
* will still accept localized versions of infinities and NANs.
|
||||
*/
|
||||
double
|
||||
_spectre_strtod (const char *nptr,
|
||||
char **endptr)
|
||||
{
|
||||
char *fail_pos;
|
||||
double val;
|
||||
struct lconv *locale_data;
|
||||
const char *decimal_point;
|
||||
int decimal_point_len;
|
||||
const char *p, *decimal_point_pos;
|
||||
const char *end = NULL; /* Silence gcc */
|
||||
int strtod_errno;
|
||||
|
||||
fail_pos = NULL;
|
||||
|
||||
locale_data = localeconv ();
|
||||
decimal_point = locale_data->decimal_point;
|
||||
decimal_point_len = strlen (decimal_point);
|
||||
|
||||
decimal_point_pos = NULL;
|
||||
end = NULL;
|
||||
|
||||
if (decimal_point[0] != '.' || decimal_point[1] != 0) {
|
||||
p = nptr;
|
||||
/* Skip leading space */
|
||||
while (ascii_isspace (*p))
|
||||
p++;
|
||||
|
||||
/* Skip leading optional sign */
|
||||
if (*p == '+' || *p == '-')
|
||||
p++;
|
||||
|
||||
if (ascii_isdigit (*p) || *p == '.') {
|
||||
while (ascii_isdigit (*p))
|
||||
p++;
|
||||
|
||||
if (*p == '.')
|
||||
decimal_point_pos = p++;
|
||||
|
||||
while (ascii_isdigit (*p))
|
||||
p++;
|
||||
|
||||
if (*p == 'e' || *p == 'E')
|
||||
p++;
|
||||
if (*p == '+' || *p == '-')
|
||||
p++;
|
||||
while (ascii_isdigit (*p))
|
||||
p++;
|
||||
|
||||
end = p;
|
||||
}
|
||||
/* For the other cases, we need not convert the decimal point */
|
||||
}
|
||||
|
||||
if (decimal_point_pos) {
|
||||
char *copy, *c;
|
||||
|
||||
/* We need to convert the '.' to the locale specific decimal point */
|
||||
copy = (char *) malloc (end - nptr + 1 + decimal_point_len);
|
||||
|
||||
c = copy;
|
||||
memcpy (c, nptr, decimal_point_pos - nptr);
|
||||
c += decimal_point_pos - nptr;
|
||||
memcpy (c, decimal_point, decimal_point_len);
|
||||
c += decimal_point_len;
|
||||
memcpy (c, decimal_point_pos + 1, end - (decimal_point_pos + 1));
|
||||
c += end - (decimal_point_pos + 1);
|
||||
*c = 0;
|
||||
|
||||
errno = 0;
|
||||
val = strtod (copy, &fail_pos);
|
||||
strtod_errno = errno;
|
||||
|
||||
if (fail_pos) {
|
||||
if (fail_pos - copy > decimal_point_pos - nptr)
|
||||
fail_pos = (char *)nptr + (fail_pos - copy) - (decimal_point_len - 1);
|
||||
else
|
||||
fail_pos = (char *)nptr + (fail_pos - copy);
|
||||
}
|
||||
|
||||
free (copy);
|
||||
} else if (end) {
|
||||
char *copy;
|
||||
|
||||
copy = (char *) malloc (end - (char *)nptr + 1);
|
||||
memcpy (copy, nptr, end - nptr);
|
||||
*(copy + (end - (char *)nptr)) = 0;
|
||||
|
||||
errno = 0;
|
||||
val = strtod (copy, &fail_pos);
|
||||
strtod_errno = errno;
|
||||
|
||||
if (fail_pos) {
|
||||
fail_pos = (char *)nptr + (fail_pos - copy);
|
||||
}
|
||||
|
||||
free (copy);
|
||||
} else {
|
||||
errno = 0;
|
||||
val = strtod (nptr, &fail_pos);
|
||||
strtod_errno = errno;
|
||||
}
|
||||
|
||||
if (endptr)
|
||||
*endptr = fail_pos;
|
||||
|
||||
errno = strtod_errno;
|
||||
|
||||
return val;
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_UTILS_H
|
||||
#define SPECTRE_UTILS_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
/* Checks. Based on dbus-internals */
|
||||
void _spectre_warn (const char *format,
|
||||
...);
|
||||
void _spectre_warn_check_failed (const char *format,
|
||||
...);
|
||||
|
||||
#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||
#define _SPECTRE_FUNCTION_NAME __func__
|
||||
#elif defined(__GNUC__) || defined(_MSC_VER)
|
||||
#define _SPECTRE_FUNCTION_NAME __FUNCTION__
|
||||
#else
|
||||
#define _SPECTRE_FUNCTION_NAME "unknown function"
|
||||
#endif
|
||||
|
||||
/* Define SPECTRE_VA_COPY() to do the right thing for copying va_list variables.
|
||||
* config.h may have already defined SPECTRE_VA_COPY as va_copy or __va_copy.
|
||||
*/
|
||||
#if !defined (SPECTRE_VA_COPY)
|
||||
# if defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
|
||||
# define SPECTRE_VA_COPY(ap1, ap2) (*(ap1) = *(ap2))
|
||||
# elif defined (SPECTRE_VA_COPY_AS_ARRAY)
|
||||
# define SPECTRE_VA_COPY(ap1, ap2) memcpy ((ap1), (ap2), sizeof (va_list))
|
||||
# else /* va_list is a pointer */
|
||||
# define SPECTRE_VA_COPY(ap1, ap2) ((ap1) = (ap2))
|
||||
# endif /* va_list is a pointer */
|
||||
#endif /* !SPECTRE_VA_COPY */
|
||||
|
||||
|
||||
/*
|
||||
* (code from GLib)
|
||||
*
|
||||
* The _SPECTRE_LIKELY and _SPECTRE_UNLIKELY macros let the programmer give hints to
|
||||
* the compiler about the expected result of an expression. Some compilers
|
||||
* can use this information for optimizations.
|
||||
*
|
||||
* The _SPECTRE_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
|
||||
* putting assignments in the macro arg
|
||||
*/
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
|
||||
#define _SPECTRE_BOOLEAN_EXPR(expr) \
|
||||
__extension__ ({ \
|
||||
int _spectre_boolean_var_; \
|
||||
if (expr) \
|
||||
_spectre_boolean_var_ = 1; \
|
||||
else \
|
||||
_spectre_boolean_var_ = 0; \
|
||||
_spectre_boolean_var_; \
|
||||
})
|
||||
#define _SPECTRE_LIKELY(expr) (__builtin_expect (_SPECTRE_BOOLEAN_EXPR(expr), 1))
|
||||
#define _SPECTRE_UNLIKELY(expr) (__builtin_expect (_SPECTRE_BOOLEAN_EXPR(expr), 0))
|
||||
#else
|
||||
#define _SPECTRE_LIKELY(expr) (expr)
|
||||
#define _SPECTRE_UNLIKELY(expr) (expr)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SPECTRE_DISABLE_ASSERT
|
||||
#define _spectre_assert(condition)
|
||||
#else
|
||||
void _spectre_real_assert (int condition,
|
||||
const char *condition_text,
|
||||
const char *file,
|
||||
int line,
|
||||
const char *func);
|
||||
#define _spectre_assert(condition) \
|
||||
_spectre_real_assert ((condition) != 0, #condition, __FILE__, __LINE__, _SPECTRE_FUNCTION_NAME)
|
||||
#endif /* SPECTRE_DISABLE_ASSERT */
|
||||
|
||||
#ifdef SPECTRE_DISABLE_CHECKS
|
||||
#define _spectre_return_if_fail(condition)
|
||||
#define _spectre_return_val_if_fail(condition, val)
|
||||
#else /* SPECTRE_DISABLE_CHECKS */
|
||||
#define _spectre_return_if_fail(condition) do { \
|
||||
_spectre_assert ((*(const char*)_SPECTRE_FUNCTION_NAME) != '_'); \
|
||||
if (!(condition)) { \
|
||||
_spectre_warn_check_failed ("%s: assertion `%s' failed (%s:%d)\n", \
|
||||
_SPECTRE_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
|
||||
return; \
|
||||
} } while (0)
|
||||
|
||||
#define _spectre_return_val_if_fail(condition, val) do { \
|
||||
_spectre_assert ((*(const char*)_SPECTRE_FUNCTION_NAME) != '_'); \
|
||||
if (!(condition)) { \
|
||||
_spectre_warn_check_failed ("%s: assertion `%s' failed (%s:%d)\n", \
|
||||
_SPECTRE_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
|
||||
return (val); \
|
||||
} } while (0)
|
||||
#endif /* SPECTRE_DISABLE_CHECKS */
|
||||
|
||||
/* String handling helpers */
|
||||
char *_spectre_strdup_printf (const char *format,
|
||||
...);
|
||||
char *_spectre_strdup (const char *str);
|
||||
int _spectre_strncasecmp (const char *s1,
|
||||
const char *s2,
|
||||
size_t n);
|
||||
int _spectre_strcasecmp (const char *s1,
|
||||
const char *s2);
|
||||
double _spectre_strtod (const char *nptr,
|
||||
char **endptr);
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_UTILS_H */
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_VERSION_H
|
||||
#define SPECTRE_VERSION_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
#define SPECTRE_MAJOR_VERSION 0
|
||||
#define SPECTRE_MINOR_VERSION 2
|
||||
#define SPECTRE_MICRO_VERSION 8
|
||||
|
||||
#define SPECTRE_VERSION_STRING "0.2.8"
|
||||
|
||||
#define SPECTRE_VERSION ((0 << 16) | (2 << 8) | (8))
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_VERSION_H */
|
|
@ -0,0 +1,38 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_VERSION_H
|
||||
#define SPECTRE_VERSION_H
|
||||
|
||||
#include <libspectre/spectre-macros.h>
|
||||
|
||||
SPECTRE_BEGIN_DECLS
|
||||
|
||||
#define SPECTRE_MAJOR_VERSION @SPECTRE_MAJOR_VERSION@
|
||||
#define SPECTRE_MINOR_VERSION @SPECTRE_MINOR_VERSION@
|
||||
#define SPECTRE_MICRO_VERSION @SPECTRE_MICRO_VERSION@
|
||||
|
||||
#define SPECTRE_VERSION_STRING "@SPECTRE_VERSION@"
|
||||
|
||||
#define SPECTRE_VERSION ((@SPECTRE_MAJOR_VERSION@ << 16) | (@SPECTRE_MINOR_VERSION@ << 8) | (@SPECTRE_MICRO_VERSION@))
|
||||
|
||||
SPECTRE_END_DECLS
|
||||
|
||||
#endif /* SPECTRE_VERSION_H */
|
|
@ -0,0 +1,31 @@
|
|||
/* This file is part of Libspectre.
|
||||
*
|
||||
* Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
|
||||
* Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
*
|
||||
* Libspectre is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* Libspectre is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SPECTRE_H
|
||||
#define SPECTRE_H
|
||||
|
||||
#include <libspectre/spectre-status.h>
|
||||
#include <libspectre/spectre-document.h>
|
||||
#include <libspectre/spectre-render-context.h>
|
||||
#include <libspectre/spectre-page.h>
|
||||
#include <libspectre/spectre-exporter.h>
|
||||
#include <libspectre/spectre-version.h>
|
||||
|
||||
#endif /* SPECTRE_H */
|
|
@ -0,0 +1,215 @@
|
|||
#! /bin/sh
|
||||
# Common wrapper for a few potentially missing GNU programs.
|
||||
|
||||
scriptversion=2013-10-28.13; # UTC
|
||||
|
||||
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
|
||||
--is-lightweight)
|
||||
# Used by our autoconf macros to check whether the available missing
|
||||
# script is modern enough.
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--run)
|
||||
# Back-compat with the calling convention used by older automake.
|
||||
shift
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
||||
to PROGRAM being missing or too old.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal autoconf autoheader autom4te automake makeinfo
|
||||
bison yacc flex lex help2man
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: unknown '$1' option"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Run the given program, remember its exit status.
|
||||
"$@"; st=$?
|
||||
|
||||
# If it succeeded, we are done.
|
||||
test $st -eq 0 && exit 0
|
||||
|
||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
||||
# passed; such an option is passed most likely to detect whether the
|
||||
# program is present and works.
|
||||
case $2 in --version|--help) exit $st;; esac
|
||||
|
||||
# Exit code 63 means version mismatch. This often happens when the user
|
||||
# tries to use an ancient version of a tool on a file that requires a
|
||||
# minimum version.
|
||||
if test $st -eq 63; then
|
||||
msg="probably too old"
|
||||
elif test $st -eq 127; then
|
||||
# Program was missing.
|
||||
msg="missing on your system"
|
||||
else
|
||||
# Program was found and executed, but failed. Give up.
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=http://www.perl.org/
|
||||
flex_URL=http://flex.sourceforge.net/
|
||||
gnu_software_URL=http://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
case $1 in
|
||||
aclocal|automake)
|
||||
echo "The '$1' program is part of the GNU Automake package:"
|
||||
echo "<$gnu_software_URL/automake>"
|
||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/autoconf>"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
autoconf|autom4te|autoheader)
|
||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
||||
echo "<$gnu_software_URL/autoconf/>"
|
||||
echo "It also requires GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice ()
|
||||
{
|
||||
# Normalize program name to check for.
|
||||
normalized_program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
printf '%s\n' "'$1' is $msg."
|
||||
|
||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
||||
case $normalized_program in
|
||||
autoconf*)
|
||||
echo "You should only need it if you modified 'configure.ac',"
|
||||
echo "or m4 files included by it."
|
||||
program_details 'autoconf'
|
||||
;;
|
||||
autoheader*)
|
||||
echo "You should only need it if you modified 'acconfig.h' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'autoheader'
|
||||
;;
|
||||
automake*)
|
||||
echo "You should only need it if you modified 'Makefile.am' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'automake'
|
||||
;;
|
||||
aclocal*)
|
||||
echo "You should only need it if you modified 'acinclude.m4' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'aclocal'
|
||||
;;
|
||||
autom4te*)
|
||||
echo "You might have modified some maintainer files that require"
|
||||
echo "the 'autom4te' program to be rebuilt."
|
||||
program_details 'autom4te'
|
||||
;;
|
||||
bison*|yacc*)
|
||||
echo "You should only need it if you modified a '.y' file."
|
||||
echo "You may want to install the GNU Bison package:"
|
||||
echo "<$gnu_software_URL/bison/>"
|
||||
;;
|
||||
lex*|flex*)
|
||||
echo "You should only need it if you modified a '.l' file."
|
||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
||||
echo "<$flex_URL>"
|
||||
;;
|
||||
help2man*)
|
||||
echo "You should only need it if you modified a dependency" \
|
||||
"of a man page."
|
||||
echo "You may want to install the GNU Help2man package:"
|
||||
echo "<$gnu_software_URL/help2man/>"
|
||||
;;
|
||||
makeinfo*)
|
||||
echo "You should only need it if you modified a '.texi' file, or"
|
||||
echo "any other file indirectly affecting the aspect of the manual."
|
||||
echo "You might want to install the Texinfo package:"
|
||||
echo "<$gnu_software_URL/texinfo/>"
|
||||
echo "The spurious makeinfo call might also be the consequence of"
|
||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
||||
echo "want to install GNU make:"
|
||||
echo "<$gnu_software_URL/make/>"
|
||||
;;
|
||||
*)
|
||||
echo "You might have modified some files without having the proper"
|
||||
echo "tools for further handling them. Check the 'README' file, it"
|
||||
echo "often tells you about the needed prerequisites for installing"
|
||||
echo "this package. You may also peek at any GNU archive site, in"
|
||||
echo "case some other package contains this missing '$1' program."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
-e '2,$s/^/ /' >&2
|
||||
|
||||
# Propagate the correct exit status (expected to be 127 for a program
|
||||
# not found, 63 for a program that failed due to version mismatch).
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
|
@ -0,0 +1,20 @@
|
|||
noinst_PROGRAMS = spectre-test parser-test
|
||||
|
||||
spectre_test_SOURCES = spectre-test.c
|
||||
|
||||
spectre_test_CPPFLAGS = \
|
||||
-I$(top_srcdir)/libspectre \
|
||||
$(SPECTRE_CFLAGS) \
|
||||
$(CAIRO_CFLAGS)
|
||||
|
||||
spectre_test_LDADD = \
|
||||
$(top_builddir)/libspectre/libspectre.la \
|
||||
$(CAIRO_LIBS)
|
||||
|
||||
parser_test_SOURCES = parser-test.c
|
||||
|
||||
parser_test_CPPFLAGS = \
|
||||
-I$(top_srcdir)/libspectre \
|
||||
$(SPECTRE_CFLAGS)
|
||||
|
||||
parser_test_LDADD = $(top_builddir)/libspectre/libspectre.la
|
|
@ -0,0 +1,649 @@
|
|||
# Makefile.in generated by automake 1.15 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
noinst_PROGRAMS = spectre-test$(EXEEXT) parser-test$(EXEEXT)
|
||||
subdir = test
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_parser_test_OBJECTS = parser_test-parser-test.$(OBJEXT)
|
||||
parser_test_OBJECTS = $(am_parser_test_OBJECTS)
|
||||
parser_test_DEPENDENCIES = $(top_builddir)/libspectre/libspectre.la
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
am_spectre_test_OBJECTS = spectre_test-spectre-test.$(OBJEXT)
|
||||
spectre_test_OBJECTS = $(am_spectre_test_OBJECTS)
|
||||
am__DEPENDENCIES_1 =
|
||||
spectre_test_DEPENDENCIES = $(top_builddir)/libspectre/libspectre.la \
|
||||
$(am__DEPENDENCIES_1)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(parser_test_SOURCES) $(spectre_test_SOURCES)
|
||||
DIST_SOURCES = $(parser_test_SOURCES) $(spectre_test_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIB_GS = @LIB_GS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_AGE = @LT_AGE@
|
||||
LT_CURRENT = @LT_CURRENT@
|
||||
LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@
|
||||
LT_REVISION = @LT_REVISION@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SPECTRE_CFLAGS = @SPECTRE_CFLAGS@
|
||||
SPECTRE_MAJOR_VERSION = @SPECTRE_MAJOR_VERSION@
|
||||
SPECTRE_MICRO_VERSION = @SPECTRE_MICRO_VERSION@
|
||||
SPECTRE_MINOR_VERSION = @SPECTRE_MINOR_VERSION@
|
||||
SPECTRE_VERSION = @SPECTRE_VERSION@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
VERSION_INFO = @VERSION_INFO@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
spectre_test_SOURCES = spectre-test.c
|
||||
spectre_test_CPPFLAGS = \
|
||||
-I$(top_srcdir)/libspectre \
|
||||
$(SPECTRE_CFLAGS) \
|
||||
$(CAIRO_CFLAGS)
|
||||
|
||||
spectre_test_LDADD = \
|
||||
$(top_builddir)/libspectre/libspectre.la \
|
||||
$(CAIRO_LIBS)
|
||||
|
||||
parser_test_SOURCES = parser-test.c
|
||||
parser_test_CPPFLAGS = \
|
||||
-I$(top_srcdir)/libspectre \
|
||||
$(SPECTRE_CFLAGS)
|
||||
|
||||
parser_test_LDADD = $(top_builddir)/libspectre/libspectre.la
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign test/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
|
||||
parser-test$(EXEEXT): $(parser_test_OBJECTS) $(parser_test_DEPENDENCIES) $(EXTRA_parser_test_DEPENDENCIES)
|
||||
@rm -f parser-test$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(parser_test_OBJECTS) $(parser_test_LDADD) $(LIBS)
|
||||
|
||||
spectre-test$(EXEEXT): $(spectre_test_OBJECTS) $(spectre_test_DEPENDENCIES) $(EXTRA_spectre_test_DEPENDENCIES)
|
||||
@rm -f spectre-test$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(spectre_test_OBJECTS) $(spectre_test_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser_test-parser-test.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spectre_test-spectre-test.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
parser_test-parser-test.o: parser-test.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(parser_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parser_test-parser-test.o -MD -MP -MF $(DEPDIR)/parser_test-parser-test.Tpo -c -o parser_test-parser-test.o `test -f 'parser-test.c' || echo '$(srcdir)/'`parser-test.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/parser_test-parser-test.Tpo $(DEPDIR)/parser_test-parser-test.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser-test.c' object='parser_test-parser-test.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(parser_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parser_test-parser-test.o `test -f 'parser-test.c' || echo '$(srcdir)/'`parser-test.c
|
||||
|
||||
parser_test-parser-test.obj: parser-test.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(parser_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT parser_test-parser-test.obj -MD -MP -MF $(DEPDIR)/parser_test-parser-test.Tpo -c -o parser_test-parser-test.obj `if test -f 'parser-test.c'; then $(CYGPATH_W) 'parser-test.c'; else $(CYGPATH_W) '$(srcdir)/parser-test.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/parser_test-parser-test.Tpo $(DEPDIR)/parser_test-parser-test.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser-test.c' object='parser_test-parser-test.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(parser_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o parser_test-parser-test.obj `if test -f 'parser-test.c'; then $(CYGPATH_W) 'parser-test.c'; else $(CYGPATH_W) '$(srcdir)/parser-test.c'; fi`
|
||||
|
||||
spectre_test-spectre-test.o: spectre-test.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spectre_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spectre_test-spectre-test.o -MD -MP -MF $(DEPDIR)/spectre_test-spectre-test.Tpo -c -o spectre_test-spectre-test.o `test -f 'spectre-test.c' || echo '$(srcdir)/'`spectre-test.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spectre_test-spectre-test.Tpo $(DEPDIR)/spectre_test-spectre-test.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-test.c' object='spectre_test-spectre-test.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spectre_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spectre_test-spectre-test.o `test -f 'spectre-test.c' || echo '$(srcdir)/'`spectre-test.c
|
||||
|
||||
spectre_test-spectre-test.obj: spectre-test.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spectre_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spectre_test-spectre-test.obj -MD -MP -MF $(DEPDIR)/spectre_test-spectre-test.Tpo -c -o spectre_test-spectre-test.obj `if test -f 'spectre-test.c'; then $(CYGPATH_W) 'spectre-test.c'; else $(CYGPATH_W) '$(srcdir)/spectre-test.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spectre_test-spectre-test.Tpo $(DEPDIR)/spectre_test-spectre-test.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='spectre-test.c' object='spectre_test-spectre-test.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spectre_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spectre_test-spectre-test.obj `if test -f 'spectre-test.c'; then $(CYGPATH_W) 'spectre-test.c'; else $(CYGPATH_W) '$(srcdir)/spectre-test.c'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
|
||||
ctags-am distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,84 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "../libspectre/spectre-utils.h"
|
||||
#include "../libspectre/ps.h"
|
||||
|
||||
static char *outputdir;
|
||||
|
||||
#define BUFFER_SIZE 32768
|
||||
|
||||
static void
|
||||
write_section (FILE *fd, const char *section, long begin, long end)
|
||||
{
|
||||
FILE *dst;
|
||||
char *filename;
|
||||
static char buf[BUFFER_SIZE];
|
||||
unsigned int read;
|
||||
size_t left = end - begin;
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/%s.txt", outputdir, section);
|
||||
dst = fopen (filename, "w");
|
||||
if (!dst) {
|
||||
printf ("Skipping section %s, could not open dest file %s\n",
|
||||
section, filename);
|
||||
free (filename);
|
||||
return;
|
||||
}
|
||||
free (filename);
|
||||
|
||||
fseek (fd, begin, SEEK_SET);
|
||||
|
||||
while (left > 0) {
|
||||
size_t to_read = BUFFER_SIZE;
|
||||
|
||||
if (left < to_read)
|
||||
to_read = left;
|
||||
|
||||
read = fread (buf, sizeof (char), to_read, fd);
|
||||
fwrite (buf, sizeof (char), read, dst);
|
||||
|
||||
left -= read;
|
||||
}
|
||||
|
||||
fclose (dst);
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
FILE *fd;
|
||||
struct document *doc;
|
||||
unsigned int i;
|
||||
|
||||
outputdir = argv[2];
|
||||
|
||||
fd = fopen (argv[1], "r");
|
||||
if (!fd) {
|
||||
printf ("Error opening file %s\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
doc = psscan (argv[1], SCANSTYLE_NORMAL);
|
||||
if (!doc) {
|
||||
printf ("Error parsing document\n");
|
||||
fclose (fd);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
write_section (fd, "prolog", doc->beginprolog, doc->endprolog);
|
||||
write_section (fd, "setup", doc->beginsetup, doc->endsetup);
|
||||
for (i = 0; i < doc->numpages; i++) {
|
||||
char *pagename;
|
||||
|
||||
pagename = _spectre_strdup_printf ("page-%d", i);
|
||||
write_section (fd, pagename, doc->pages[i].begin, doc->pages[i].end);
|
||||
free (pagename);
|
||||
}
|
||||
write_section (fd, "trailer", doc->begintrailer, doc->endtrailer);
|
||||
|
||||
fclose (fd);
|
||||
psdocdestroy (doc);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,455 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <cairo.h>
|
||||
|
||||
#include <libspectre/spectre.h>
|
||||
|
||||
#include "../libspectre/spectre-utils.h"
|
||||
|
||||
static const char *
|
||||
orientation_to_string (SpectreOrientation orientation)
|
||||
{
|
||||
switch (orientation) {
|
||||
case SPECTRE_ORIENTATION_PORTRAIT:
|
||||
return "Portrait";
|
||||
case SPECTRE_ORIENTATION_LANDSCAPE:
|
||||
return "Landscape";
|
||||
case SPECTRE_ORIENTATION_REVERSE_LANDSCAPE:
|
||||
return "Reverse Landscape";
|
||||
case SPECTRE_ORIENTATION_REVERSE_PORTRAIT:
|
||||
return "Reverse Portrait";
|
||||
}
|
||||
|
||||
return "Unknown Orientation";
|
||||
}
|
||||
|
||||
static void
|
||||
test_metadata (SpectreDocument *document)
|
||||
{
|
||||
const char *format;
|
||||
|
||||
format = spectre_document_get_format (document);
|
||||
printf ("Document format: %s\n",
|
||||
format ? format : "Unknown");
|
||||
printf ("Postscript language level: %d\n",
|
||||
spectre_document_get_language_level (document));
|
||||
printf ("Encapsulated PostScript: %s\n",
|
||||
spectre_document_is_eps (document) ? "Yes" : "No");
|
||||
printf ("Number of pages: %d\n",
|
||||
spectre_document_get_n_pages (document));
|
||||
printf ("Title: %s\n",
|
||||
spectre_document_get_title (document));
|
||||
printf ("Creator: %s\n",
|
||||
spectre_document_get_creator (document));
|
||||
printf ("For: %s\n",
|
||||
spectre_document_get_for (document));
|
||||
printf ("Creation date: %s\n",
|
||||
spectre_document_get_creation_date (document));
|
||||
printf ("Document Orientation: %s\n",
|
||||
orientation_to_string (spectre_document_get_orientation (document)));
|
||||
}
|
||||
|
||||
static void
|
||||
test_rotation (SpectreDocument *document,
|
||||
const char *output)
|
||||
{
|
||||
SpectrePage *page;
|
||||
SpectreRenderContext *rc;
|
||||
int i;
|
||||
int width_points;
|
||||
int height_points;
|
||||
|
||||
page = spectre_document_get_page (document, 0);
|
||||
|
||||
spectre_page_get_size (page, &width_points, &height_points);
|
||||
|
||||
rc = spectre_render_context_new ();
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
cairo_surface_t *surface;
|
||||
char *filename;
|
||||
int rotation;
|
||||
int width, height;
|
||||
unsigned char *data = NULL;
|
||||
int row_length;
|
||||
|
||||
rotation = 90 * i;
|
||||
|
||||
if (rotation == 90 || rotation == 270) {
|
||||
width = height_points;
|
||||
height = width_points;
|
||||
} else {
|
||||
width = width_points;
|
||||
height = height_points;
|
||||
}
|
||||
|
||||
spectre_render_context_set_rotation (rc, rotation);
|
||||
spectre_page_render (page, rc, &data, &row_length);
|
||||
if (spectre_page_status (page)) {
|
||||
printf ("Error rendering page %d at rotation %d: %s\n", i, rotation,
|
||||
spectre_status_to_string (spectre_page_status (page)));
|
||||
free (data);
|
||||
continue;
|
||||
}
|
||||
|
||||
surface = cairo_image_surface_create_for_data (data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
row_length);
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/page-rotated-%d.png", output, rotation);
|
||||
cairo_surface_write_to_png (surface, filename);
|
||||
free (filename);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
free (data);
|
||||
}
|
||||
|
||||
spectre_render_context_free (rc);
|
||||
spectre_page_free (page);
|
||||
}
|
||||
|
||||
static void
|
||||
test_render_slice (SpectreDocument *document,
|
||||
const char *output)
|
||||
{
|
||||
SpectrePage *page;
|
||||
SpectreRenderContext *rc;
|
||||
int x, y;
|
||||
int width, height;
|
||||
int width_points;
|
||||
int height_points;
|
||||
unsigned char *data = NULL;
|
||||
int row_length;
|
||||
|
||||
page = spectre_document_get_page (document, 0);
|
||||
|
||||
spectre_page_get_size (page, &width_points, &height_points);
|
||||
|
||||
/* Render the central slice */
|
||||
width = width_points / 3;
|
||||
height = height_points / 3;
|
||||
x = width;
|
||||
y = height;
|
||||
|
||||
printf ("Rendering page 0 slice %d, %d, %d, %d\n",
|
||||
x, y, width, height);
|
||||
|
||||
rc = spectre_render_context_new ();
|
||||
|
||||
spectre_page_render_slice (page, rc, x, y, width, height,
|
||||
&data, &row_length);
|
||||
if (!spectre_page_status (page)) {
|
||||
cairo_surface_t *surface;
|
||||
char *filename;
|
||||
|
||||
surface = cairo_image_surface_create_for_data (data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
row_length);
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/page-slice.png", output);
|
||||
cairo_surface_write_to_png (surface, filename);
|
||||
free (filename);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
} else {
|
||||
printf ("Error rendering page slice %d, %d, %d, %d: %s\n",
|
||||
x, y, width, height,
|
||||
spectre_status_to_string (spectre_page_status (page)));
|
||||
}
|
||||
|
||||
free (data);
|
||||
spectre_render_context_free (rc);
|
||||
spectre_page_free (page);
|
||||
}
|
||||
|
||||
static void
|
||||
test_page_size (SpectreDocument *document,
|
||||
const char *output)
|
||||
{
|
||||
SpectrePage *page;
|
||||
SpectreRenderContext *rc;
|
||||
unsigned char *data = NULL;
|
||||
int row_length;
|
||||
|
||||
page = spectre_document_get_page (document, 0);
|
||||
|
||||
printf ("Rendering page 0 in a4 page\n");
|
||||
|
||||
rc = spectre_render_context_new ();
|
||||
|
||||
spectre_render_context_set_page_size (rc, 595, 842);
|
||||
spectre_page_render (page, rc, &data, &row_length);
|
||||
if (!spectre_page_status (page)) {
|
||||
cairo_surface_t *surface;
|
||||
char *filename;
|
||||
|
||||
surface = cairo_image_surface_create_for_data (data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
595, 842,
|
||||
row_length);
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/page-a4.png", output);
|
||||
cairo_surface_write_to_png (surface, filename);
|
||||
free (filename);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
} else {
|
||||
printf ("Error rendering page in a4 page: %s\n",
|
||||
spectre_status_to_string (spectre_page_status (page)));
|
||||
}
|
||||
|
||||
free (data);
|
||||
spectre_render_context_free (rc);
|
||||
spectre_page_free (page);
|
||||
}
|
||||
|
||||
static void
|
||||
test_document_render (SpectreDocument *document,
|
||||
const char *output)
|
||||
{
|
||||
unsigned char *data = NULL;
|
||||
int row_length;
|
||||
|
||||
printf ("Rendering document\n");
|
||||
|
||||
spectre_document_render (document, &data, &row_length);
|
||||
if (!spectre_document_status (document)) {
|
||||
cairo_surface_t *surface;
|
||||
char *filename;
|
||||
int width, height;
|
||||
|
||||
spectre_document_get_page_size (document, &width, &height);
|
||||
|
||||
surface = cairo_image_surface_create_for_data (data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
row_length);
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/document.png", output);
|
||||
cairo_surface_write_to_png (surface, filename);
|
||||
free (filename);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
} else {
|
||||
printf ("Error rendering document: %s\n",
|
||||
spectre_status_to_string (spectre_document_status (document)));
|
||||
}
|
||||
|
||||
free (data);
|
||||
}
|
||||
|
||||
static void
|
||||
test_document_render_full (SpectreDocument *document,
|
||||
const char *output)
|
||||
{
|
||||
unsigned char *data = NULL;
|
||||
int row_length;
|
||||
SpectreRenderContext *rc;
|
||||
|
||||
printf ("Rendering document at 2x\n");
|
||||
|
||||
rc = spectre_render_context_new ();
|
||||
|
||||
spectre_render_context_set_scale (rc, 2.0, 2.0);
|
||||
spectre_document_render_full (document, rc, &data, &row_length);
|
||||
if (!spectre_document_status (document)) {
|
||||
cairo_surface_t *surface;
|
||||
char *filename;
|
||||
int width, height;
|
||||
|
||||
spectre_document_get_page_size (document, &width, &height);
|
||||
|
||||
width = (int) ((width * 2.0) + 0.5);
|
||||
height = (int) ((height * 2.0) + 0.5);
|
||||
|
||||
surface = cairo_image_surface_create_for_data (data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
row_length);
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/document-2x.png", output);
|
||||
cairo_surface_write_to_png (surface, filename);
|
||||
free (filename);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
} else {
|
||||
printf ("Error rendering document at 2x: %s\n",
|
||||
spectre_status_to_string (spectre_document_status (document)));
|
||||
}
|
||||
|
||||
spectre_render_context_free (rc);
|
||||
free (data);
|
||||
}
|
||||
|
||||
static void
|
||||
test_export (SpectreDocument *document,
|
||||
SpectreExporterFormat format,
|
||||
const char *output_dir)
|
||||
{
|
||||
SpectreExporter *exporter;
|
||||
SpectreStatus status;
|
||||
char *filename;
|
||||
const char *format_str = format == SPECTRE_EXPORTER_FORMAT_PS ? "ps" : "pdf";
|
||||
int i;
|
||||
|
||||
exporter = spectre_exporter_new (document, format);
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/output.%s", output_dir, format_str);
|
||||
status = spectre_exporter_begin (exporter, filename);
|
||||
free (filename);
|
||||
|
||||
if (status) {
|
||||
printf ("Error exporting document as %s: %s\n", format_str,
|
||||
spectre_status_to_string (status));
|
||||
spectre_exporter_free (exporter);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Export even pages in reverse order */
|
||||
for (i = spectre_document_get_n_pages (document) - 1; i >= 0; i--) {
|
||||
if (i % 2 != 0)
|
||||
continue;
|
||||
|
||||
status = spectre_exporter_do_page (exporter, i);
|
||||
if (status) {
|
||||
printf ("Error exporting page %d as %s: %s\n", i, format_str,
|
||||
spectre_status_to_string (status));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
spectre_exporter_end (exporter);
|
||||
spectre_exporter_free (exporter);
|
||||
}
|
||||
|
||||
static void
|
||||
test_save (SpectreDocument *document,
|
||||
const char *output_dir)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/document-copy.ps", output_dir);
|
||||
spectre_document_save (document, filename);
|
||||
if (spectre_document_status (document)) {
|
||||
printf ("Error saving document as %s: %s\n", filename,
|
||||
spectre_status_to_string (spectre_document_status (document)));
|
||||
}
|
||||
free (filename);
|
||||
}
|
||||
|
||||
static void
|
||||
test_save_to_pdf (SpectreDocument *document,
|
||||
const char *output_dir)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/document-copy.pdf", output_dir);
|
||||
spectre_document_save_to_pdf (document, filename);
|
||||
if (spectre_document_status (document)) {
|
||||
printf ("Error saving document as %s: %s\n", filename,
|
||||
spectre_status_to_string (spectre_document_status (document)));
|
||||
}
|
||||
free (filename);
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
SpectreDocument *document;
|
||||
SpectreRenderContext *rc;
|
||||
unsigned int i;
|
||||
|
||||
/* TODO: check argv */
|
||||
|
||||
printf ("Testing libspectre version: %s\n", SPECTRE_VERSION_STRING);
|
||||
|
||||
spectre_document_load (NULL, argv[1]);
|
||||
|
||||
document = spectre_document_new ();
|
||||
spectre_document_load (document, argv[1]);
|
||||
if (spectre_document_status (document)) {
|
||||
printf ("Error loading document %s: %s\n", argv[1],
|
||||
spectre_status_to_string (spectre_document_status (document)));
|
||||
spectre_document_free (document);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
test_document_render (document, argv[2]);
|
||||
test_document_render_full (document, argv[2]);
|
||||
test_export (document, SPECTRE_EXPORTER_FORMAT_PDF, argv[2]);
|
||||
test_export (document, SPECTRE_EXPORTER_FORMAT_PS, argv[2]);
|
||||
test_save (document, argv[2]);
|
||||
test_save_to_pdf (document, argv[2]);
|
||||
test_metadata (document);
|
||||
|
||||
rc = spectre_render_context_new ();
|
||||
|
||||
for (i = 0; i < spectre_document_get_n_pages (document); i++) {
|
||||
SpectrePage *page, *page2;
|
||||
cairo_surface_t *surface;
|
||||
char *filename;
|
||||
int width, height;
|
||||
unsigned char *data = NULL;
|
||||
int row_length;
|
||||
|
||||
page = spectre_document_get_page (document, i);
|
||||
if (spectre_document_status (document)) {
|
||||
printf ("Error getting page %d: %s\n", i,
|
||||
spectre_status_to_string (spectre_document_status (document)));
|
||||
continue;
|
||||
}
|
||||
|
||||
spectre_page_get_size (page, &width, &height);
|
||||
printf ("Page %d\n", i);
|
||||
printf ("\tPage label: %s\n", spectre_page_get_label (page));
|
||||
printf ("\tPage size: %d x %d\n", width, height);
|
||||
printf ("\tPage orientation: %s\n",
|
||||
orientation_to_string (spectre_page_get_orientation (page)));
|
||||
|
||||
page2 = spectre_document_get_page_by_label (document, spectre_page_get_label (page));
|
||||
if (!page2 || spectre_document_status (document)) {
|
||||
printf ("Error getting page %d by its label %s: %s\n", i,
|
||||
spectre_page_get_label (page),
|
||||
spectre_status_to_string (spectre_document_status (document)));
|
||||
}
|
||||
spectre_page_free (page2);
|
||||
|
||||
|
||||
spectre_render_context_set_page_size (rc, width, height);
|
||||
spectre_page_render (page, rc, &data, &row_length);
|
||||
if (spectre_page_status (page)) {
|
||||
printf ("Error rendering page %d: %s\n", i,
|
||||
spectre_status_to_string (spectre_page_status (page)));
|
||||
free (data);
|
||||
spectre_page_free (page);
|
||||
continue;
|
||||
}
|
||||
|
||||
surface = cairo_image_surface_create_for_data (data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
row_length);
|
||||
|
||||
filename = _spectre_strdup_printf ("%s/page-%d.png", argv[2], i);
|
||||
cairo_surface_write_to_png (surface, filename);
|
||||
free (filename);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
free (data);
|
||||
spectre_page_free (page);
|
||||
}
|
||||
|
||||
spectre_render_context_free (rc);
|
||||
|
||||
test_render_slice (document, argv[2]);
|
||||
test_page_size (document, argv[2]);
|
||||
test_rotation (document, argv[2]);
|
||||
|
||||
spectre_document_free (document);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue