/usr/include/aqbanking5/aqbanking/value.h is in libaqbanking34-dev 5.4.3beta-2+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | /***************************************************************************
$RCSfile$
-------------------
cvs : $Id$
begin : Mon Apr 05 2004
copyright : (C) 2004 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* This file is part of the project "AqBanking". *
* Please see toplevel file COPYING of that project for license details. *
***************************************************************************/
#ifndef AB_VALUE_H
#define AB_VALUE_H
#include <gwenhywfar/buffer.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/list.h>
#include <gwenhywfar/types.h>
#include <aqbanking/error.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct AB_VALUE AB_VALUE;
GWEN_LIST_FUNCTION_LIB_DEFS(AB_VALUE, AB_Value, AQBANKING_API)
/** Creates a deep copy of an AB_VALUE_LIST object
*
*/
AQBANKING_API AB_VALUE_LIST *AB_Value_List_dup(const AB_VALUE_LIST *vl);
AQBANKING_API AB_VALUE *AB_Value_new(void);
AQBANKING_API AB_VALUE *AB_Value_dup(const AB_VALUE *ov);
AQBANKING_API void AB_Value_free(AB_VALUE *v);
/**
* This function reads a AB_VALUE from a string. Strings suitable as
* arguments are those created by @ref AB_Value_toString or simple
* floating point string (as in "123.45" or "-123.45").
*/
AQBANKING_API AB_VALUE *AB_Value_fromString(const char *s);
/**
* This function exports the value in a format which can be recognized
* by the function @ref AB_Value_fromString. You should not make any
* assumption about the format of the string created here.
*/
AQBANKING_API void AB_Value_toString(const AB_VALUE *v, GWEN_BUFFER *buf);
AQBANKING_API void AB_Value_toHumanReadableString(const AB_VALUE *v,
GWEN_BUFFER *buf,
int prec);
AQBANKING_API void AB_Value_toHumanReadableString2(const AB_VALUE *v,
GWEN_BUFFER *buf,
int prec,
int withCurrency);
AQBANKING_API AB_VALUE *AB_Value_fromDouble(double i);
/** Returns a newly allocated rational number, initialized to
* num/denom. */
AQBANKING_API AB_VALUE *AB_Value_fromInt(long int num, long int denom);
/** Create a value from the given GWEN_DB. */
AQBANKING_API AB_VALUE *AB_Value_fromDb(GWEN_DB_NODE *db);
/** Write the given value into the given GWEN_DB. */
AQBANKING_API int AB_Value_toDb(const AB_VALUE *v, GWEN_DB_NODE *db);
/** Write the given value into the given GWEN_DB (uses float instead of rational). */
AQBANKING_API int AB_Value_toDbFloat(const AB_VALUE *v, GWEN_DB_NODE *db);
/**
* This function returns the value as a double.
* You should not feed another AB_VALUE from this double, because the
* conversion from an AB_VALUE to a double might be lossy!
*/
AQBANKING_API double AB_Value_GetValueAsDouble(const AB_VALUE *v);
/**
* You should not use a double retrieved via
* @ref AB_Value_GetValueAsDouble as an argument to this function, because
* the conversion from AB_VALUE to double to AB_VALUE might change the
* real value.
*/
AQBANKING_API void AB_Value_SetValueFromDouble(AB_VALUE *v, double i);
/**
* Write the value (without the currency) in nominator/denominator
* form into the given buffer if possibly.
* This form looks like "12345/6789" (nominator/denominator).
*/
AQBANKING_API int AB_Value_GetNumDenomString(const AB_VALUE *v,
char *buffer,
uint32_t buflen);
AQBANKING_API void AB_Value_SetZero(AB_VALUE *v);
AQBANKING_API int AB_Value_IsZero(const AB_VALUE *v);
AQBANKING_API int AB_Value_IsNegative(const AB_VALUE *v);
AQBANKING_API int AB_Value_IsPositive(const AB_VALUE *v);
AQBANKING_API int AB_Value_Compare(const AB_VALUE *v1, const AB_VALUE *v2);
/** Returns non-zero if v1 and v2 are equal, zero if they are
* non-equal. Although AB_Value_Compare() can be used for the same
* purpose, this function is much faster.
*/
AQBANKING_API int AB_Value_Equal(const AB_VALUE *v1, const AB_VALUE *v2);
AQBANKING_API int AB_Value_AddValue(AB_VALUE *v1, const AB_VALUE *v2);
AQBANKING_API int AB_Value_SubValue(AB_VALUE *v1, const AB_VALUE *v2);
AQBANKING_API int AB_Value_MultValue(AB_VALUE *v1, const AB_VALUE *v2);
AQBANKING_API int AB_Value_DivValue(AB_VALUE *v1, const AB_VALUE *v2);
AQBANKING_API int AB_Value_Negate(AB_VALUE *v);
AQBANKING_API const char *AB_Value_GetCurrency(const AB_VALUE *v);
AQBANKING_API void AB_Value_SetCurrency(AB_VALUE *v, const char *s);
AQBANKING_API void AB_Value_Dump(const AB_VALUE *v, FILE *f, unsigned int indent);
/** Returns the numerator of the given rational number. */
AQBANKING_API long int AB_Value_Num(const AB_VALUE *v);
/** Returns the denominator of the given rational number. */
AQBANKING_API long int AB_Value_Denom(const AB_VALUE *v);
/** Write value to HBCI string (e.g. "11,90" is written as "11,9") */
AQBANKING_API void AB_Value_toHbciString(const AB_VALUE *v, GWEN_BUFFER *buf);
#ifdef __cplusplus
}
#endif
#endif /* AB_VALUE_H */
|