00001 /* 00002 Copyright 2008 Larry Gritz and the other authors and contributors. 00003 All Rights Reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions are 00007 met: 00008 * Redistributions of source code must retain the above copyright 00009 notice, this list of conditions and the following disclaimer. 00010 * Redistributions in binary form must reproduce the above copyright 00011 notice, this list of conditions and the following disclaimer in the 00012 documentation and/or other materials provided with the distribution. 00013 * Neither the name of the software's owners nor the names of its 00014 contributors may be used to endorse or promote products derived from 00015 this software without specific prior written permission. 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00017 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00018 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00019 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00020 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00021 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00022 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00024 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00025 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00026 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 00028 (This is the Modified BSD License) 00029 */ 00030 00031 00038 00039 00040 #ifndef OPENIMAGEIO_SYSUTIL_H 00041 #define OPENIMAGEIO_SYSUTIL_H 00042 00043 #include "export.h" 00044 00046 #define ALLOCA(type, size) ((type*)alloca((size) * sizeof (type))) 00047 00048 #ifdef OPENIMAGEIO_NAMESPACE 00049 namespace OPENIMAGEIO_NAMESPACE { 00050 #endif 00051 00056 namespace Sysutil { 00057 00061 DLLPUBLIC size_t memory_used (bool resident=false); 00062 00063 00066 DLLPUBLIC void get_local_time (const time_t *time, struct tm *converted_time); 00067 00070 DLLPUBLIC std::string this_program_path (); 00071 00072 }; // namespace Sysutils 00073 00074 #ifdef OPENIMAGEIO_NAMESPACE 00075 }; // end namespace OPENIMAGEIO_NAMESPACE 00076 using namespace OPENIMAGEIO_NAMESPACE; 00077 #endif 00078 00079 #endif // OPENIMAGEIO_SYSUTIL_H