From d4fd3f85abe76f10e8553d2d0d6bf0e279baab92 Mon Sep 17 00:00:00 2001 From: brad Date: Sat, 13 Nov 2004 01:07:09 +0000 Subject: [PATCH] added GPL headers to source files --- msvc/exivsimple/exivsimple.cpp | 54 ++++++++++++++++++++++++---------- msvc/exivsimple/exivsimple.h | 47 ++++++++++++++++++++++++----- msvc/exivsimple/stdafx.cpp | 33 +++++++++++++++++---- msvc/exivsimple/stdafx.h | 39 ++++++++++++++++++------ 4 files changed, 136 insertions(+), 37 deletions(-) diff --git a/msvc/exivsimple/exivsimple.cpp b/msvc/exivsimple/exivsimple.cpp index 12ef5117..06d588ec 100644 --- a/msvc/exivsimple/exivsimple.cpp +++ b/msvc/exivsimple/exivsimple.cpp @@ -1,5 +1,30 @@ -// exivsimple.cpp : Defines the entry point for the DLL application. -// +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2004 Andreas Huggel + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +/* + File: exivsimple.cpp + Version: $Rev$ + Author(s): Brad Schick + History: 12-Nov-04, brad: created + */ +// ***************************************************************************** #include "stdafx.h" #include "exivsimple.h" @@ -58,7 +83,7 @@ EXIVSIMPLE_API int SaveImage(HIMAGE img) // This is weird because iptc and exif have not been "unified". Once // the API is turned inside out, this DLL should not have to know // about either... just generic images, keys, values, etc. -// buffsize should be the total size of *buff (including space full null) +// buffsize should be the total size of *buff (including space for null) // Note that if there is more than one entry (for some IPTC datasets) this // returns the first one found. Currently no way to get the others. EXIVSIMPLE_API int ReadMeta(HIMAGE img, const char *key, char *buff, int buffsize) @@ -100,9 +125,9 @@ EXIVSIMPLE_API int ReadMeta(HIMAGE img, const char *key, char *buff, int buffsiz return rc; } -// Overwrites existing value if found, otherwise creates a new one +// Overwrites existing value if found, otherwise creates a new one. // Passing invalidTypeId causes the type to be guessed. -// Guessing types is accurate for IPTC but not for EXIF. +// Guessing types is accurate for IPTC, but not for EXIF. EXIVSIMPLE_API int ModifyMeta(HIMAGE img, const char *key, const char *val, DllTypeId type) { assert(img && key && val); @@ -168,7 +193,7 @@ EXIVSIMPLE_API int ModifyMeta(HIMAGE img, const char *key, const char *val, DllT // Always creates a new metadata entry. // Passing invalidTypeId causes the type to be guessed. -// Guessing types is accurate for IPTC but not for EXIF. +// Guessing types is accurate for IPTC, but not for EXIF. EXIVSIMPLE_API int AddMeta(HIMAGE img, const char *key, const char *val, DllTypeId type) { assert(img && key && val); @@ -283,16 +308,15 @@ EXIVSIMPLE_API int EnumMeta(HIMAGE img, METAENUMPROC proc, void *user) BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved - ) + ) { - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } + switch (ul_reason_for_call) { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } return TRUE; } diff --git a/msvc/exivsimple/exivsimple.h b/msvc/exivsimple/exivsimple.h index a2ac2429..cb85e3c1 100644 --- a/msvc/exivsimple/exivsimple.h +++ b/msvc/exivsimple/exivsimple.h @@ -1,9 +1,37 @@ -// The following ifdef block is the standard way of creating macros which make exporting -// from a DLL simpler. All files within this DLL are compiled with the EXIVSIMPLE_EXPORTS -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see -// EXIVSIMPLE_API functions as being imported from a DLL, whereas this DLL sees symbols -// defined with this macro as being exported. +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2004 Andreas Huggel + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +/*! + @file exivsimple.h + @brief Limited metadata dll for win32 + @version $Rev$ + @author Brad Schick (brad) + brad@robotbattle.com + @date 12-Nov-04, brad: created + */ +#ifndef EXIVSIMPLE_H_ +#define EXIVSIMPLE_H_ + +// ***************************************************************************** + + #ifdef EXIVSIMPLE_EXPORTS #define EXIVSIMPLE_API __declspec(dllexport) #else @@ -17,7 +45,9 @@ extern "C" { #endif -// These types should match those in types.hpp. For all of the functions +// These types should match those in types.hpp. Copied here so that +// exiv2 headers are not needed. +// For all of the functions // that take a type, passing invalidTypeId causes the type to be guessed. // Guessing types is accurate for IPTC but not for EXIF. enum DllTypeId { invalidTypeId, unsignedByte, asciiString, unsignedShort, @@ -40,3 +70,6 @@ EXIVSIMPLE_API int RemoveMeta(HIMAGE img, const char *key); #ifdef __cplusplus } #endif + +#endif // #ifndef EXIVSIMPLE_H_ + diff --git a/msvc/exivsimple/stdafx.cpp b/msvc/exivsimple/stdafx.cpp index ce3748c6..d032d3a6 100644 --- a/msvc/exivsimple/stdafx.cpp +++ b/msvc/exivsimple/stdafx.cpp @@ -1,8 +1,29 @@ -// stdafx.cpp : source file that includes just the standard includes -// exivsimple.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2004 Andreas Huggel + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +/* + File: stdafx.cpp + Version: $Rev$ + Author(s): Brad Schick + History: 12-Nov-04, brad: created + */ +// ***************************************************************************** #include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/msvc/exivsimple/stdafx.h b/msvc/exivsimple/stdafx.h index 1ad3b783..63a8c333 100644 --- a/msvc/exivsimple/stdafx.h +++ b/msvc/exivsimple/stdafx.h @@ -1,13 +1,34 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// +// ***************************************************************** -*- C++ -*- +/* + * Copyright (C) 2004 Andreas Huggel + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +/*! + @file stdafx.h + @brief Precompiled header file support + @version $Rev$ + @author Brad Schick (brad) + brad@robotbattle.com + @date 12-Nov-04, brad: created + */ +// ***************************************************************************** #pragma once - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -// Windows Header Files: +#define WIN32_LEAN_AND_MEAN #include - -// TODO: reference additional headers your program requires here