"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/udunits2.h" between
udunits-2.2.26.tar.gz and udunits-2.2.28.tar.gz

About: UDUNITS supports units of physical quantities. Its C library provides for arithmetic manipulation of units and for conversion of numeric values between compatible units.

udunits2.h  (udunits-2.2.26):udunits2.h  (udunits-2.2.28)
/* /*
* Copyright 2013 University Corporation for Atmospheric Research * Copyright 2020 University Corporation for Atmospheric Research
* *
* This file is part of the UDUNITS-2 package. See the file COPYRIGHT * This file is part of the UDUNITS-2 package. See the file COPYRIGHT
* in the top-level source-directory of the package for copying and * in the top-level source-directory of the package for copying and
* redistribution conditions. * redistribution conditions.
*/ */
#ifndef UT_UNITS2_H_INCLUDED #ifndef UT_UNITS2_H_INCLUDED
#define UT_UNITS2_H_INCLUDED #define UT_UNITS2_H_INCLUDED
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h> #include <stddef.h>
skipping to change at line 32 skipping to change at line 32
/* Define a bunch of variables to use the ISO C++ conformant name instead /* Define a bunch of variables to use the ISO C++ conformant name instead
of the POSIX name. This quiets a lot of the warnings thrown by MSVC. */ of the POSIX name. This quiets a lot of the warnings thrown by MSVC. */
#define read _read #define read _read
#define open _open #define open _open
#define close _close #define close _close
#define strdup _strdup #define strdup _strdup
#define strcasecmp stricmp #define strcasecmp stricmp
#define stricmp _stricmp #define stricmp _stricmp
#define isatty _isatty #define isatty _isatty
//We must accomodate the lack of snprintf in MSVC. //We must accommodate the lack of snprintf in versions of MSVC less than 1900.
//c99_snprintf is defined in c99_snprintf.c, in lib/. //udunits_snprintf is defined in udunits_snprintf.c, in lib/.
#define snprintf c99_snprintf #define snprintf udunits_snprintf
int c99_snprintf( int udunits_snprintf(
char* str, char* str,
size_t size, size_t size,
const char* format, const char* format,
...); ...);
int c99_vsnprintf( int udunits_vsnprintf(
char* str, char* str,
size_t size, size_t size,
const char* format, const char* format,
va_list ap); va_list ap);
#endif #endif
/* If we are working in Visual Studio and have a /* If we are working in Visual Studio and have a
shared library, we will need to do some slight-of-hand shared library, we will need to do some slight-of-hand
in order to make it generate a proper export library. in order to make it generate a proper export library.
skipping to change at line 65 skipping to change at line 65
#if defined(DLL_UDUNITS2) /* define when library is a DLL */ #if defined(DLL_UDUNITS2) /* define when library is a DLL */
# if defined(DLL_EXPORT) /* defined when building the library */ # if defined(DLL_EXPORT) /* defined when building the library */
# define MSC_EXTRA __declspec(dllexport) # define MSC_EXTRA __declspec(dllexport)
# else # else
# define MSC_EXTRA __declspec(dllimport) # define MSC_EXTRA __declspec(dllimport)
# endif # endif
#else #else
# define MSC_EXTRA # define MSC_EXTRA
#endif /* defined(DLL_UDUNITS2) */ #endif /* defined(DLL_UDUNITS2) */
#define EXTERNL MSC_EXTRA extern /*
* Results in
* udunits2.c.obj : error LNK2019: unresolved external symbol cv_free referenced
in function handleRequest
* udunits2.c.obj : error LNK2019: unresolved external symbol cv_convert_double
referenced in function handleRequest
* udunits2.c.obj : error LNK2019: unresolved external symbol cv_get_expression
referenced in function handleRequest
*/
#ifndef EXTERNL
# define EXTERNL MSC_EXTRA extern
#endif
/*
* Results in "NMAKE : fatal error U1073: don't know how to make 'lib\udunits2.l
ib'"
#undef EXTERNL
#define EXTERNL extern
*/
#include "converter.h" #include "converter.h"
typedef struct ut_system ut_system; typedef struct ut_system ut_system;
typedef union ut_unit ut_unit; typedef union ut_unit ut_unit;
enum utStatus { enum utStatus {
UT_SUCCESS = 0, /* Success */ UT_SUCCESS = 0, /* Success */
UT_BAD_ARG, /* An argument violates the function's contract * / UT_BAD_ARG, /* An argument violates the function's contract * /
UT_EXISTS, /* Unit, prefix, or identifier already exists */ UT_EXISTS, /* Unit, prefix, or identifier already exists */
skipping to change at line 1044 skipping to change at line 1058
* UT_UNKNOWN "string" contained an unknown * UT_UNKNOWN "string" contained an unknown
* identifier. * identifier.
* UT_OS Operating-system failure. See * UT_OS Operating-system failure. See
* "errno". * "errno".
* else Pointer to the unit corresponding to "string". * else Pointer to the unit corresponding to "string".
*/ */
EXTERNL ut_unit* EXTERNL ut_unit*
ut_parse( ut_parse(
const ut_system* const system, const ut_system* const system,
const char* const string, const char* const string,
const ut_encoding encoding); ut_encoding encoding);
/* /*
* Removes leading and trailing whitespace from a string. * Removes leading and trailing whitespace from a string.
* *
* Arguments: * Arguments:
* string NUL-terminated string. Will be modified if it contains * string NUL-terminated string. Will be modified if it contains
* whitespace.. * whitespace..
* encoding The character-encoding of "string". * encoding The character-encoding of "string".
* Returns: * Returns:
* "string", with all leading and trailing whitespace removed. * "string", with all leading and trailing whitespace removed.
skipping to change at line 1143 skipping to change at line 1157
* Returns: * Returns:
* The date encoded as a scalar value. * The date encoded as a scalar value.
*/ */
EXTERNL double EXTERNL double
ut_encode_date( ut_encode_date(
int year, int year,
int month, int month,
int day); int day);
/* /*
* Encodes a time as a double-precision value. * Encodes a time as a double-precision value. If an input value isn't within
* * its allowed range, then zero is returned and `ut_get_status()` will return
* Arguments: * `UT_BAD_ARG`.
* hours The number of hours (0 = midnight). *
* minutes The number of minutes. * @param[in] hours The number of hours (0 = midnight). `abs(hours)` must be
* seconds The number of seconds. * less than 24.
* Returns: * @param[in] minutes The number of minutes. `abs(minutes)` must be less than
* The clock-time encoded as a scalar value. * 60.
* @param[in] seconds The number of seconds. `fabs(seconds)` must be less than
* or equal to 62.
* @return The clock-time encoded as a scalar value.
*/ */
EXTERNL double EXTERNL double
ut_encode_clock( ut_encode_clock(
int hours, int hours,
int minutes, int minutes,
double seconds); double seconds);
/* /*
* Encodes a time as a double-precision value. The convenience function is * Encodes a time as a double-precision value. The convenience function is
* equivalent to "ut_encode_date(year,month,day) + * equivalent to "ut_encode_date(year,month,day) +
* ut_encode_clock(hour,minute,second)" * ut_encode_clock(hour,minute,second)"
* *
* Arguments: * Arguments:
* year The year. * year The year.
* month The month. * month The month.
* day The day. * day The day.
 End of changes. 8 change blocks. 
19 lines changed or deleted 40 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)