Moved internal headers into the src/ directory. Only published headers remain in include/exiv2/.

This commit is contained in:
Andreas Huggel 2015-05-10 09:31:19 +00:00
parent 0f01822264
commit bfddfcbc17
6 changed files with 0 additions and 1048 deletions

View File

@ -1,417 +0,0 @@
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2015 Andreas Huggel <ahuggel@gmx.net>
*
* This program is part of the Exiv2 distribution.
*
* 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, 5th Floor, Boston, MA 02110-1301 USA.
*/
/*!
@file actions.hpp
@brief Implements base class Task, TaskFactory and the various supported
actions (derived from Task).
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 11-Dec-03, ahu: created
*/
#ifndef ACTIONS_HPP_
#define ACTIONS_HPP_
// *****************************************************************************
// included header files
// + standard includes
#include <string>
#include <map>
#include "exiv2app.hpp"
#include "image.hpp"
#include "exif.hpp"
#include "iptc.hpp"
// *****************************************************************************
// class declarations
namespace Exiv2 {
class ExifData;
class Image;
class Metadatum;
class PreviewImage;
}
// *****************************************************************************
// namespace extensions
/*!
@brief Contains all action classes (task subclasses).
*/
namespace Action {
//! Enumerates all tasks
enum TaskType { none, adjust, print, rename, erase, extract, insert,
modify, fixiso, fixcom };
// *****************************************************************************
// class definitions
/*!
@brief Abstract base class for all concrete actions.
Task provides a simple interface that actions must implement and a few
commonly used helpers.
*/
class Task {
public:
//! Shortcut for an auto pointer.
typedef std::auto_ptr<Task> AutoPtr;
//! Virtual destructor.
virtual ~Task();
//! Virtual copy construction.
AutoPtr clone() const;
/*!
@brief Application interface to perform a task.
@param path Path of the file to process.
@return 0 if successful.
*/
virtual int run(const std::string& path) =0;
private:
//! Internal virtual copy constructor.
virtual Task* clone_() const =0;
}; // class Task
/*!
@brief Task factory.
Creates an instance of the task of the requested type. The factory is
implemented as a singleton, which can be accessed only through the static
member function instance().
*/
class TaskFactory {
public:
/*!
@brief Get access to the task factory.
Clients access the task factory exclusively through
this method.
*/
static TaskFactory& instance();
//! Destructor
void cleanup();
/*!
@brief Create a task.
@param type Identifies the type of task to create.
@return An auto pointer that owns a task of the requested type. If
the task type is not supported, the pointer is 0.
@remark The caller of the function should check the content of the
returned auto pointer and take appropriate action (e.g., throw
an exception) if it is 0.
*/
Task::AutoPtr create(TaskType type);
/*!
@brief Register a task prototype together with its type.
The task factory creates new tasks of a given type by cloning its
associated prototype. Additional tasks can be registered. If called
for a type which already exists in the list, the corresponding
prototype is replaced.
@param type Task type.
@param task Pointer to the prototype. Ownership is transferred to the
task factory. That's what the auto pointer indicates.
*/
void registerTask(TaskType type, Task::AutoPtr task);
private:
//! Prevent construction other than through instance().
TaskFactory();
//! Prevent copy construction: not implemented.
TaskFactory(const TaskFactory& rhs);
//! Pointer to the one and only instance of this class.
static TaskFactory* instance_;
//! Type used to store Task prototype classes
typedef std::map<TaskType, Task*> Registry;
//! List of task types and corresponding prototypes.
Registry registry_;
}; // class TaskFactory
//! %Print the Exif (or other metadata) of a file to stdout
class Print : public Task {
public:
virtual ~Print();
virtual int run(const std::string& path);
typedef std::auto_ptr<Print> AutoPtr;
AutoPtr clone() const;
//! Print the Jpeg comment
int printComment();
//! Print list of available preview images
int printPreviewList();
//! Print Exif summary information
int printSummary();
//! Print Exif, IPTC and XMP metadata in user defined format
int printList();
//! Return true if key should be printed, else false
bool grepTag(const std::string& key);
//! Return true if key should be printed, else false
bool keyTag(const std::string& key);
//! Print all metadata in a user defined format
int printMetadata(const Exiv2::Image* image);
//! Print a metadatum in a user defined format
void printMetadatum(const Exiv2::Metadatum& md, const Exiv2::Image* image);
//! Print the label for a summary line
void printLabel(const std::string& label) const;
//! Print image Structure information
int printStructure(std::ostream& out,Exiv2::printStructureOption_e option);
/*!
@brief Print one summary line with a label (if provided) and requested
data. A line break is printed only if a label is provided.
@return 1 if a line was written, 0 if the key was not found.
*/
int printTag(const Exiv2::ExifData& exifData,
const std::string& key,
const std::string& label ="") const;
//! Type for an Exiv2 Easy access function
typedef Exiv2::ExifData::const_iterator (*EasyAccessFct)(const Exiv2::ExifData& ed);
/*!
@brief Print one summary line with a label (if provided) and requested
data. A line break is printed only if a label is provided.
@return 1 if a line was written, 0 if the information was not found.
*/
int printTag(const Exiv2::ExifData& exifData,
EasyAccessFct easyAccessFct,
const std::string& label) const;
private:
virtual Print* clone_() const;
std::string path_;
int align_; // for the alignment of the summary output
}; // class Print
/*!
@brief %Rename a file to its metadate creation timestamp,
in the specified format.
*/
class Rename : public Task {
public:
virtual ~Rename();
virtual int run(const std::string& path);
typedef std::auto_ptr<Rename> AutoPtr;
AutoPtr clone() const;
private:
virtual Rename* clone_() const;
}; // class Rename
//! %Adjust the Exif (or other metadata) timestamps
class Adjust : public Task {
public:
virtual ~Adjust();
virtual int run(const std::string& path);
typedef std::auto_ptr<Adjust> AutoPtr;
AutoPtr clone() const;
private:
virtual Adjust* clone_() const;
int adjustDateTime(Exiv2::ExifData& exifData,
const std::string& key,
const std::string& path) const;
long adjustment_;
long yearAdjustment_;
long monthAdjustment_;
long dayAdjustment_;
}; // class Adjust
/*!
@brief %Erase the entire exif data or only the thumbnail section.
*/
class Erase : public Task {
public:
virtual ~Erase();
virtual int run(const std::string& path);
typedef std::auto_ptr<Erase> AutoPtr;
AutoPtr clone() const;
/*!
@brief Delete the thumbnail image, incl IFD1 metadata from the file.
*/
int eraseThumbnail(Exiv2::Image* image) const;
/*!
@brief Erase the complete Exif data block from the file.
*/
int eraseExifData(Exiv2::Image* image) const;
/*!
@brief Erase all Iptc data from the file.
*/
int eraseIptcData(Exiv2::Image* image) const;
/*!
@brief Erase Jpeg comment from the file.
*/
int eraseComment(Exiv2::Image* image) const;
/*!
@brief Erase XMP packet from the file.
*/
int eraseXmpData(Exiv2::Image* image) const;
private:
virtual Erase* clone_() const;
std::string path_;
}; // class Erase
/*!
@brief %Extract the entire exif data or only the thumbnail section.
*/
class Extract : public Task {
public:
virtual ~Extract();
virtual int run(const std::string& path);
typedef std::auto_ptr<Extract> AutoPtr;
AutoPtr clone() const;
/*!
@brief Write the thumbnail image to a file. The filename is composed by
removing the suffix from the image filename and appending
"-thumb" and the appropriate suffix (".jpg" or ".tif"), depending
on the format of the Exif thumbnail image.
*/
int writeThumbnail() const;
/*!
@brief Write preview images to files.
*/
int writePreviews() const;
/*!
@brief Write one preview image to a file. The filename is composed by
removing the suffix from the image filename and appending
"-preview<num>" and the appropriate suffix (".jpg" or ".tif"),
depending on the format of the Exif thumbnail image.
*/
void writePreviewFile(const Exiv2::PreviewImage& pvImg, int num) const;
private:
virtual Extract* clone_() const;
std::string path_;
}; // class Extract
/*!
@brief %Insert the Exif data from corresponding *.exv files.
*/
class Insert : public Task {
public:
virtual ~Insert();
virtual int run(const std::string& path);
typedef std::auto_ptr<Insert> AutoPtr;
AutoPtr clone() const;
/*!
@brief Insert a Jpeg thumbnail image from a file into file \em path.
The filename of the thumbnail is expected to be the image
filename (\em path) minus its suffix plus "-thumb.jpg".
*/
int insertThumbnail(const std::string& path) const;
/*!
@brief Insert an XMP packet from a file into file \em path.
The filename of the XMP packet is expected to be the image
filename (\em path) minus its suffix plus ".xmp".
*/
int insertXmpPacket(const std::string& path) const;
private:
virtual Insert* clone_() const;
}; // class Insert
/*!
@brief %Modify the Exif data according to the commands in the
modification table.
*/
class Modify : public Task {
public:
virtual ~Modify();
virtual int run(const std::string& path);
typedef std::auto_ptr<Modify> AutoPtr;
AutoPtr clone() const;
Modify() {}
//! Apply modification commands to the \em pImage, return 0 if successful.
static int applyCommands(Exiv2::Image* pImage);
private:
virtual Modify* clone_() const;
//! Copy constructor needed because of AutoPtr member
Modify(const Modify& /*src*/) : Task() {}
//! Add a metadatum to \em pImage according to \em modifyCmd
static int addMetadatum(Exiv2::Image* pImage,
const ModifyCmd& modifyCmd);
//! Set a metadatum in \em pImage according to \em modifyCmd
static int setMetadatum(Exiv2::Image* pImage,
const ModifyCmd& modifyCmd);
//! Delete a metadatum from \em pImage according to \em modifyCmd
static void delMetadatum(Exiv2::Image* pImage,
const ModifyCmd& modifyCmd);
//! Register an XMP namespace according to \em modifyCmd
static void regNamespace(const ModifyCmd& modifyCmd);
}; // class Modify
/*!
@brief %Copy ISO settings from any of the Nikon makernotes to the
regular Exif tag, Exif.Photo.ISOSpeedRatings.
*/
class FixIso : public Task {
public:
virtual ~FixIso();
virtual int run(const std::string& path);
typedef std::auto_ptr<FixIso> AutoPtr;
AutoPtr clone() const;
private:
virtual FixIso* clone_() const;
std::string path_;
}; // class FixIso
/*!
@brief Fix the character encoding of Exif UNICODE user comments.
Decodes the comment using the auto-detected or specified
character encoding and writes it back in UCS-2.
*/
class FixCom : public Task {
public:
virtual ~FixCom();
virtual int run(const std::string& path);
typedef std::auto_ptr<FixCom> AutoPtr;
AutoPtr clone() const;
private:
virtual FixCom* clone_() const;
std::string path_;
}; // class FixCom
} // namespace Action
#endif // #ifndef ACTIONS_HPP_

View File

@ -1,84 +0,0 @@
/*
* Copyright (c) 1987, 1993, 1994, 1996
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef __GETOPT_H__
#define __GETOPT_H__
#ifdef __cplusplus
extern "C" {
#endif
extern int opterr; /* if error message should be printed */
extern int optind; /* index into parent argv vector */
extern int optopt; /* character checked for validity */
extern int optreset; /* reset getopt */
extern char *optarg; /* argument associated with option */
int getopt (int, char * const *, const char *);
#ifdef __cplusplus
}
#endif
#endif /* __GETOPT_H__ */
#ifndef __UNISTD_GETOPT__
#ifndef __GETOPT_LONG_H__
#define __GETOPT_LONG_H__
#ifdef __cplusplus
extern "C" {
#endif
struct option {
const char *name;
int has_arg;
int *flag;
int val;
};
int getopt_long (int, char *const *, const char *, const struct option *, int *);
#ifndef HAVE_DECL_GETOPT
#define HAVE_DECL_GETOPT 1
#endif
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#ifdef __cplusplus
}
#endif
#endif /* __GETOPT_LONG_H__ */
#endif /* __UNISTD_GETOPT__ */

View File

@ -1,50 +0,0 @@
/* **************************************************************** -*- C -*- */
/*
* Copyright (C) 2004-2015 Andreas Huggel <ahuggel@gmx.net>
*
* This program is part of the Exiv2 distribution.
*
* 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, 5th Floor, Boston, MA 02110-1301 USA.
*/
/*
File: i18n.h
Brief: i18n definitions. Do not use. This is an Exiv2 internal header.
Version: $Rev: 2681 $
Author(s): Gilles Caulier (gc) <caulier.gilles@kdemail.net>
History: 01-Nov-06, gc: created
*/
#ifndef I18N_H_
#define I18N_H_
#include "config.h"
/* NLS can be disabled through the configure --disable-nls option. */
#ifdef EXV_ENABLE_NLS
# include <libintl.h>
// Definition is in types.cpp
EXIV2API const char* _exvGettext(const char* str);
# define _(String) _exvGettext(String)
# define N_(String) String
#else /* NLS is disabled */
# define _(String) (String)
# define N_(String) String
#endif /* EXV_ENABLE_NLS */
#endif /* I18N_H_ */

View File

@ -1,210 +0,0 @@
/*!
@file private.h
@brief This file is from the tz distribution at ftp://elsie.nci.nih.gov/pub/
@version $Rev: 1358 $
*/
#ifndef PRIVATE_H
#define PRIVATE_H
/*
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
*/
/*
** This header is for use ONLY with the time conversion code.
** There is no guarantee that it will remain unchanged,
** or that it will remain at all.
** Do NOT copy it to any system include directory.
** Thank you!
*/
/*
** ID
*/
#ifndef lint
#ifndef NOID
static char privatehid[] = "@(#)private.h 7.53";
#endif /* !defined NOID */
#endif /* !defined lint */
/* ahu: moved required preprocessor symbols to config.h */
/* ahu: disable warnings */
#ifdef _MSC_VER
// disable warning 'uses old-style declarator' C4131
#pragma warning (disable: 4131)
#endif
/*
** Nested includes
*/
#include "sys/types.h" /* for time_t */
#include "stdio.h"
#include "errno.h"
#include "string.h"
#include "limits.h" /* for CHAR_BIT */
#include "time.h"
#include "stdlib.h"
/* ahu: added io.h for MSVC */
#ifdef _MSC_VER
# include "io.h"
#endif
/* ahu: deleted include libintl.h */
/* ahu: deleted include sys/wait.h and WIFEXITED, WEXITSTATUS macros */
#if EXV_HAVE_UNISTD_H - 0
#include "unistd.h" /* for F_OK and R_OK */
#endif /* EXV_HAVE_UNISTD_H - 0 */
#if !(EXV_HAVE_UNISTD_H - 0)
#ifndef F_OK
#define F_OK 0
#endif /* !defined F_OK */
#ifndef R_OK
#define R_OK 4
#endif /* !defined R_OK */
#endif /* !(EXV_HAVE_UNISTD_H - 0) */
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
/*
** Workarounds for compilers/systems.
*/
/*
** SunOS 4.1.1 cc lacks prototypes.
*/
#ifndef P
#ifdef __STDC__
#define P(x) x
#endif /* defined __STDC__ */
#ifndef __STDC__
#define P(x) ()
#endif /* !defined __STDC__ */
#endif /* !defined P */
/*
** SunOS 4.1.1 headers lack EXIT_SUCCESS.
*/
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif /* !defined EXIT_SUCCESS */
/*
** SunOS 4.1.1 headers lack EXIT_FAILURE.
*/
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif /* !defined EXIT_FAILURE */
/*
** SunOS 4.1.1 headers lack FILENAME_MAX.
*/
#ifndef FILENAME_MAX
#ifndef MAXPATHLEN
#ifdef unix
#include "sys/param.h"
#endif /* defined unix */
#endif /* !defined MAXPATHLEN */
#ifdef MAXPATHLEN
#define FILENAME_MAX MAXPATHLEN
#endif /* defined MAXPATHLEN */
#ifndef MAXPATHLEN
#define FILENAME_MAX 1024 /* Pure guesswork */
#endif /* !defined MAXPATHLEN */
#endif /* !defined FILENAME_MAX */
/* ahu: deleted unlink declaration and remove define */
/* ahu: deleted errno declaration */
/* ahu: deleted private function declarations */
/*
** Finally, some convenience items.
*/
#ifndef TRUE
#define TRUE 1
#endif /* !defined TRUE */
#ifndef FALSE
#define FALSE 0
#endif /* !defined FALSE */
#ifndef TYPE_BIT
#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
#endif /* !defined TYPE_BIT */
#ifndef TYPE_SIGNED
#define TYPE_SIGNED(type) (((type) -1) < 0)
#endif /* !defined TYPE_SIGNED */
#ifndef INT_STRLEN_MAXIMUM
/*
** 302 / 1000 is log10(2.0) rounded up.
** Subtract one for the sign bit if the type is signed;
** add one for integer division truncation;
** add one more for a minus sign if the type is signed.
*/
#define INT_STRLEN_MAXIMUM(type) \
((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
#endif /* !defined INT_STRLEN_MAXIMUM */
/*
** INITIALIZE(x)
*/
#ifndef GNUC_or_lint
#ifdef lint
#define GNUC_or_lint
#endif /* defined lint */
#ifndef lint
#ifdef __GNUC__
#define GNUC_or_lint
#endif /* defined __GNUC__ */
#endif /* !defined lint */
#endif /* !defined GNUC_or_lint */
#ifndef INITIALIZE
#ifdef GNUC_or_lint
#define INITIALIZE(x) ((x) = 0)
#endif /* defined GNUC_or_lint */
#ifndef GNUC_or_lint
#define INITIALIZE(x)
#endif /* !defined GNUC_or_lint */
#endif /* !defined INITIALIZE */
/* ahu: deleted definition of _(msgid) macro */
#ifndef TZ_DOMAIN
#define TZ_DOMAIN "tz"
#endif /* !defined TZ_DOMAIN */
#if HAVE_INCOMPATIBLE_CTIME_R
#undef asctime_r
#undef ctime_r
char *asctime_r P((struct tm const *, char *));
char *ctime_r P((time_t const *, char *));
#endif /* HAVE_INCOMPATIBLE_CTIME_R */
/*
** UNIX was a registered trademark of The Open Group in 2003.
*/
#endif /* !defined PRIVATE_H */

View File

@ -1,94 +0,0 @@
/*!
@file timegm.h
@brief Declaration of timegm(). The implementation is in localtime.c
@version $Rev: 1800 $
*/
#ifndef TIMEGM_H_
#define TIMEGM_H_
#include <time.h>
/*
The following comments are copied from the Makefile of the tz distribution,
available at ftp://elsie.nci.nih.gov/pub/:
NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
out by the National Institute of Standards and Technology
which claims to test C and Posix conformance. If you want to pass PCTS, add
-DPCTS
to the end of the "CFLAGS=" line.
If your system has a "zone abbreviation" field in its "struct tm"s
(or if you decide to add such a field in your system's "time.h" file),
add the name to a define such as
-DTM_ZONE=tm_zone
or
-DTM_ZONE=_tm_zone
to the end of the "CFLAGS=" line.
If you want functions that were inspired by early versions of X3J11's work,
add
-DSTD_INSPIRED
to the end of the "CFLAGS=" line.
If you want to allocate state structures in localtime, add
-DALL_STATE
to the end of the "CFLAGS=" line. Storage is obtained by calling malloc.
If you want Source Code Control System ID's left out of object modules, add
-DNOID
Add the following to the end of the "CFLAGS=" line as needed.
-DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
DST transitions if the time zone files cannot be accessed
If you want to use System V compatibility code, add
-DUSG_COMPAT
to the end of the "CFLAGS=" line. This arrange for "timezone" and "daylight"
variables to be kept up-to-date by the time conversion functions. Neither
"timezone" nor "daylight" is described in X3J11's work.
If you want an "altzone" variable (a la System V Release 3.1), add
-DALTZONE
to the end of the "CFLAGS=" line.
This variable is not described in X3J11's work.
If your system has a "GMT offset" field in its "struct tm"s
(or if you decide to add such a field in your system's "time.h" file),
add the name to a define such as
-DTM_GMTOFF=tm_gmtoff
or
-DTM_GMTOFF=_tm_gmtoff
to the end of the "CFLAGS=" line.
Neither tm_gmtoff nor _tm_gmtoff is described in X3J11's work;
in its work, use of "tm_gmtoff" is described as non-conforming.
Both Linux and BSD have done the equivalent of defining TM_GMTOFF in
their recent releases.
If you want a "gtime" function (a la MACH), add
-DCMUCS
to the end of the "CFLAGS=" line
This function is not described in X3J11's work.
*/
#define STD_INSPIRED
#define NOID
#ifdef __cplusplus
extern "C" {
#endif
// The UTC version of mktime
/* rmills - timegm is replaced with _mkgmtime on VC 2005 and up */
/* - see localtime.c */
#if !defined(_MSC_VER) || (_MSC_VER < 1400)
time_t timegm(struct tm * const tmp);
#else
#define timegm _mkgmtime
#endif
#ifdef __cplusplus
}
#endif
#endif // #ifndef TIMEGM_H_

View File

@ -1,193 +0,0 @@
/*!
@file tzfile.h
@brief This file is from the tz distribution at ftp://elsie.nci.nih.gov/pub/
@version $Rev: 392 $
*/
#ifndef TZFILE_H
#define TZFILE_H
/*
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
*/
/*
** This header is for use ONLY with the time conversion code.
** There is no guarantee that it will remain unchanged,
** or that it will remain at all.
** Do NOT copy it to any system include directory.
** Thank you!
*/
/*
** ID
*/
#ifndef lint
#ifndef NOID
static char tzfilehid[] = "@(#)tzfile.h 7.14";
#endif /* !defined NOID */
#endif /* !defined lint */
/*
** Information about time zone files.
*/
#ifndef TZDIR
#define TZDIR "/usr/local/etc/zoneinfo" /* Time zone object file directory */
#endif /* !defined TZDIR */
#ifndef TZDEFAULT
#define TZDEFAULT "localtime"
#endif /* !defined TZDEFAULT */
#ifndef TZDEFRULES
#define TZDEFRULES "posixrules"
#endif /* !defined TZDEFRULES */
/*
** Each file begins with. . .
*/
#define TZ_MAGIC "TZif"
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_reserved[16]; /* reserved for future use */
char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
};
/*
** . . .followed by. . .
**
** tzh_timecnt (char [4])s coded transition times a la time(2)
** tzh_timecnt (unsigned char)s types of local time starting at above
** tzh_typecnt repetitions of
** one (char [4]) coded UTC offset in seconds
** one (unsigned char) used to set tm_isdst
** one (unsigned char) that's an abbreviation list index
** tzh_charcnt (char)s '\0'-terminated zone abbreviations
** tzh_leapcnt repetitions of
** one (char [4]) coded leap second transition times
** one (char [4]) total correction after above
** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
** time is standard time, if FALSE,
** transition time is wall clock time
** if absent, transition times are
** assumed to be wall clock time
** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition
** time is UTC, if FALSE,
** transition time is local time
** if absent, transition times are
** assumed to be local time
*/
/*
** In the current implementation, "tzset()" refuses to deal with files that
** exceed any of the limits below.
*/
#ifndef TZ_MAX_TIMES
/*
** The TZ_MAX_TIMES value below is enough to handle a bit more than a
** year's worth of solar time (corrected daily to the nearest second) or
** 138 years of Pacific Presidential Election time
** (where there are three time zone transitions every fourth year).
*/
#define TZ_MAX_TIMES 370
#endif /* !defined TZ_MAX_TIMES */
#ifndef TZ_MAX_TYPES
#ifndef NOSOLAR
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
#endif /* !defined NOSOLAR */
#ifdef NOSOLAR
/*
** Must be at least 14 for Europe/Riga as of Jan 12 1995,
** as noted by Earl Chew <earl@hpato.aus.hp.com>.
*/
#define TZ_MAX_TYPES 20 /* Maximum number of local time types */
#endif /* !defined NOSOLAR */
#endif /* !defined TZ_MAX_TYPES */
#ifndef TZ_MAX_CHARS
#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
/* (limited by what unsigned chars can hold) */
#endif /* !defined TZ_MAX_CHARS */
#ifndef TZ_MAX_LEAPS
#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
#endif /* !defined TZ_MAX_LEAPS */
#define SECSPERMIN 60
#define MINSPERHOUR 60
#define HOURSPERDAY 24
#define DAYSPERWEEK 7
#define DAYSPERNYEAR 365
#define DAYSPERLYEAR 366
#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY)
#define MONSPERYEAR 12
#define TM_SUNDAY 0
#define TM_MONDAY 1
#define TM_TUESDAY 2
#define TM_WEDNESDAY 3
#define TM_THURSDAY 4
#define TM_FRIDAY 5
#define TM_SATURDAY 6
#define TM_JANUARY 0
#define TM_FEBRUARY 1
#define TM_MARCH 2
#define TM_APRIL 3
#define TM_MAY 4
#define TM_JUNE 5
#define TM_JULY 6
#define TM_AUGUST 7
#define TM_SEPTEMBER 8
#define TM_OCTOBER 9
#define TM_NOVEMBER 10
#define TM_DECEMBER 11
#define TM_YEAR_BASE 1900
#define EPOCH_YEAR 1970
#define EPOCH_WDAY TM_THURSDAY
/*
** Accurate only for the past couple of centuries;
** that will probably do.
*/
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
#ifndef USG
/*
** Use of the underscored variants may cause problems if you move your code to
** certain System-V-based systems; for maximum portability, use the
** underscore-free variants. The underscored variants are provided for
** backward compatibility only; they may disappear from future versions of
** this file.
*/
#define SECS_PER_MIN SECSPERMIN
#define MINS_PER_HOUR MINSPERHOUR
#define HOURS_PER_DAY HOURSPERDAY
#define DAYS_PER_WEEK DAYSPERWEEK
#define DAYS_PER_NYEAR DAYSPERNYEAR
#define DAYS_PER_LYEAR DAYSPERLYEAR
#define SECS_PER_HOUR SECSPERHOUR
#define SECS_PER_DAY SECSPERDAY
#define MONS_PER_YEAR MONSPERYEAR
#endif /* !defined USG */
#endif /* !defined TZFILE_H */