added GPL headers to source files

v0.27.3
brad 21 years ago
parent b90eec9a50
commit d4fd3f85ab

@ -1,5 +1,30 @@
// exivsimple.cpp : Defines the entry point for the DLL application. // ***************************************************************** -*- C++ -*-
// /*
* Copyright (C) 2004 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
File: exivsimple.cpp
Version: $Rev$
Author(s): Brad Schick <brad@robotbattle.com>
History: 12-Nov-04, brad: created
*/
// *****************************************************************************
#include "stdafx.h" #include "stdafx.h"
#include "exivsimple.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 // 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 // the API is turned inside out, this DLL should not have to know
// about either... just generic images, keys, values, etc. // 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 // 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. // 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) 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; 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. // 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) EXIVSIMPLE_API int ModifyMeta(HIMAGE img, const char *key, const char *val, DllTypeId type)
{ {
assert(img && key && val); 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. // Always creates a new metadata entry.
// Passing invalidTypeId causes the type to be guessed. // 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) EXIVSIMPLE_API int AddMeta(HIMAGE img, const char *key, const char *val, DllTypeId type)
{ {
assert(img && key && val); assert(img && key && val);
@ -283,16 +308,15 @@ EXIVSIMPLE_API int EnumMeta(HIMAGE img, METAENUMPROC proc, void *user)
BOOL APIENTRY DllMain( HANDLE hModule, BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call, DWORD ul_reason_for_call,
LPVOID lpReserved LPVOID lpReserved
) )
{ {
switch (ul_reason_for_call) switch (ul_reason_for_call) {
{ case DLL_PROCESS_ATTACH:
case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH:
case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH:
case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH:
case DLL_PROCESS_DETACH: break;
break; }
}
return TRUE; return TRUE;
} }

@ -1,9 +1,37 @@
// The following ifdef block is the standard way of creating macros which make exporting // ***************************************************************** -*- C++ -*-
// 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 * Copyright (C) 2004 Andreas Huggel <ahuggel@gmx.net>
// 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 * This program is part of the Exiv2 distribution.
// defined with this macro as being exported. *
* 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)
<a href="mailto:brad@robotbattle.com">brad@robotbattle.com</a>
@date 12-Nov-04, brad: created
*/
#ifndef EXIVSIMPLE_H_
#define EXIVSIMPLE_H_
// *****************************************************************************
#ifdef EXIVSIMPLE_EXPORTS #ifdef EXIVSIMPLE_EXPORTS
#define EXIVSIMPLE_API __declspec(dllexport) #define EXIVSIMPLE_API __declspec(dllexport)
#else #else
@ -17,7 +45,9 @@ extern "C"
{ {
#endif #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. // that take a type, 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.
enum DllTypeId { invalidTypeId, unsignedByte, asciiString, unsignedShort, enum DllTypeId { invalidTypeId, unsignedByte, asciiString, unsignedShort,
@ -40,3 +70,6 @@ EXIVSIMPLE_API int RemoveMeta(HIMAGE img, const char *key);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // #ifndef EXIVSIMPLE_H_

@ -1,8 +1,29 @@
// stdafx.cpp : source file that includes just the standard includes // ***************************************************************** -*- C++ -*-
// exivsimple.pch will be the pre-compiled header /*
// stdafx.obj will contain the pre-compiled type information * Copyright (C) 2004 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
File: stdafx.cpp
Version: $Rev$
Author(s): Brad Schick <brad@robotbattle.com>
History: 12-Nov-04, brad: created
*/
// *****************************************************************************
#include "stdafx.h" #include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

@ -1,13 +1,34 @@
// stdafx.h : include file for standard system include files, // ***************************************************************** -*- C++ -*-
// or project specific include files that are used frequently, but /*
// are changed infrequently * Copyright (C) 2004 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*!
@file stdafx.h
@brief Precompiled header file support
@version $Rev$
@author Brad Schick (brad)
<a href="mailto:brad@robotbattle.com">brad@robotbattle.com</a>
@date 12-Nov-04, brad: created
*/
// *****************************************************************************
#pragma once #pragma once
#define WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h> #include <windows.h>
// TODO: reference additional headers your program requires here

Loading…
Cancel
Save