NCBI C++ ToolKit
Functions
Money functions

Functions to manipulate the MONEY datatype. More...

+ Collaboration diagram for Money functions:

Functions

int dbmnycmp (DBPROCESS *dbproc, DBMONEY *m1, DBMONEY *m2)
 Compare two DBMONEY values. More...
 
RETCODE dbmnyzero (DBPROCESS *dbproc, DBMONEY *dest)
 Set a DBMONEY value to zero. More...
 
RETCODE dbmnymaxpos (DBPROCESS *dbproc, DBMONEY *amount)
 Get maximum positive DBMONEY value supported. More...
 
RETCODE dbmnymaxneg (DBPROCESS *dbproc, DBMONEY *amount)
 Get maximum negative DBMONEY value supported. More...
 
RETCODE dbmnyinc (DBPROCESS *dbproc, DBMONEY *amount)
 Add $0.0001 to a DBMONEY value. More...
 
RETCODE dbmnydec (DBPROCESS *dbproc, DBMONEY *amount)
 Subtract $0.0001 from a DBMONEY value. More...
 
RETCODE dbmnyminus (DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
 Negate a DBMONEY value. More...
 
RETCODE dbmny4minus (DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
 Negate a DBMONEY4 value. More...
 
RETCODE dbmny4zero (DBPROCESS *dbproc, DBMONEY4 *dest)
 Zero a DBMONEY4 value. More...
 
RETCODE dbmny4add (DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *sum)
 Add two DBMONEY4 values. More...
 
RETCODE dbmny4sub (DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2, DBMONEY4 *diff)
 Subtract two DBMONEY4 values. More...
 
int dbmny4cmp (DBPROCESS *dbproc, DBMONEY4 *m1, DBMONEY4 *m2)
 Compare two DBMONEY4 values. More...
 
RETCODE dbmny4copy (DBPROCESS *dbproc, DBMONEY4 *src, DBMONEY4 *dest)
 Copy a DBMONEY4 value. More...
 
RETCODE dbmnycopy (DBPROCESS *dbproc, DBMONEY *src, DBMONEY *dest)
 Copy a DBMONEY value. More...
 

Detailed Description

Functions to manipulate the MONEY datatype.

Function Documentation

◆ dbmny4add()

RETCODE dbmny4add ( DBPROCESS dbproc,
DBMONEY4 m1,
DBMONEY4 m2,
DBMONEY4 sum 
)

Add two DBMONEY4 values.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
m1first operand.
m2other operand.
sumoutput: result of computation.
Return values
SUCCEEDusually.
FAILon overflow.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5502 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY4::mny4, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmny4cmp()

int dbmny4cmp ( DBPROCESS dbproc,
DBMONEY4 m1,
DBMONEY4 m2 
)

Compare two DBMONEY4 values.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
m1some money.
m2some other money.
Return values
0m1 == m2.
-1m1 < m2.
1m1 > m2.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5621 of file dblib.c.

References CHECK_NULP, CHECK_PARAMETER, dbproc, DBMONEY4::mny4, SYBENULL, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmny4copy()

RETCODE dbmny4copy ( DBPROCESS dbproc,
DBMONEY4 src,
DBMONEY4 dest 
)

Copy a DBMONEY4 value.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
srcaddress of a DBMONEY4 structure.
destoutput: new money.
Return values
SUCCEEDor FAIL if src/dest NULL.
See also
dbmnycopy(), dbmnyminus(), dbmny4minus().

Definition at line 5649 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY4::mny4, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmny4minus()

RETCODE dbmny4minus ( DBPROCESS dbproc,
DBMONEY4 src,
DBMONEY4 dest 
)

Negate a DBMONEY4 value.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
srcaddress of a DBMONEY4 structure.
destoutput: result of negation.
Return values
SUCCEEDusually.
FAILon overflow.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5455 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbmny4sub(), dbmny4zero(), dbproc, FAIL, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmny4sub()

RETCODE dbmny4sub ( DBPROCESS dbproc,
DBMONEY4 m1,
DBMONEY4 m2,
DBMONEY4 diff 
)

Subtract two DBMONEY4 values.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
m1first operand.
m2other operand, subtracted from m1.
diffoutput: result of computation.
Return values
SUCCEEDusually.
FAILon overflow.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5533 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY4::mny4, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

Referenced by dbmny4minus().

◆ dbmny4zero()

RETCODE dbmny4zero ( DBPROCESS dbproc,
DBMONEY4 dest 
)

Zero a DBMONEY4 value.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
destaddress of a DBMONEY structure.
Return values
SUCCEEDusually.
FAILdest is NULL.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5479 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY4::mny4, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

Referenced by dbmny4minus().

◆ dbmnycmp()

int dbmnycmp ( DBPROCESS dbproc,
DBMONEY m1,
DBMONEY m2 
)

Compare two DBMONEY values.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
m1some money.
m2some other money.
Return values
0m1 == m2.
-1m1 < m2.
1m1 > m2.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5175 of file dblib.c.

References CHECK_NULP, CHECK_PARAMETER, dbproc, DBMONEY::mnyhigh, DBMONEY::mnylow, SYBENULL, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmnycopy()

RETCODE dbmnycopy ( DBPROCESS dbproc,
DBMONEY src,
DBMONEY dest 
)

Copy a DBMONEY value.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
srcaddress of a DBMONEY structure.
destoutput: new money.
Return values
SUCCEEDalways, unless src or dest is NULL.
See also

Definition at line 5920 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY::mnyhigh, DBMONEY::mnylow, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmnydec()

RETCODE dbmnydec ( DBPROCESS dbproc,
DBMONEY amount 
)

Subtract $0.0001 from a DBMONEY value.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
amountaddress of a DBMONEY structure.
Return values
SUCCEEDor FAIL if overflow or amount NULL.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5400 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY::mnyhigh, DBMONEY::mnylow, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmnyinc()

RETCODE dbmnyinc ( DBPROCESS dbproc,
DBMONEY amount 
)

Add $0.0001 to a DBMONEY value.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
amountaddress of a DBMONEY structure.
Return values
SUCCEEDor FAIL if overflow or amount NULL.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5372 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY::mnyhigh, DBMONEY::mnylow, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmnymaxneg()

RETCODE dbmnymaxneg ( DBPROCESS dbproc,
DBMONEY amount 
)

Get maximum negative DBMONEY value supported.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
amountaddress of a DBMONEY structure.
Return values
SUCCEEDAlways.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5275 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY::mnyhigh, DBMONEY::mnylow, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmnymaxpos()

RETCODE dbmnymaxpos ( DBPROCESS dbproc,
DBMONEY amount 
)

Get maximum positive DBMONEY value supported.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
amountaddress of a DBMONEY structure.
Return values
SUCCEEDAlways.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5254 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY::mnyhigh, DBMONEY::mnylow, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmnyminus()

RETCODE dbmnyminus ( DBPROCESS dbproc,
DBMONEY src,
DBMONEY dest 
)

Negate a DBMONEY value.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
srcaddress of a DBMONEY structure.
destoutput: result of negation.
Return values
SUCCEEDor FAIL if overflow or src/dest NULL.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5428 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY::mnyhigh, DBMONEY::mnylow, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

◆ dbmnyzero()

RETCODE dbmnyzero ( DBPROCESS dbproc,
DBMONEY dest 
)

Set a DBMONEY value to zero.

Parameters
dbproccontains all information needed by db-lib to manage communications with the server.
destaddress of a DBMONEY structure.
Return values
SUCCEEDunless amount is NULL.
See also
dbmnyadd(), dbmnysub(), dbmnymul(), dbmnydivide(), dbmnyminus(), dbmny4add(), dbmny4sub(), dbmny4mul(), dbmny4divide(), dbmny4minus().

Definition at line 5233 of file dblib.c.

References CHECK_CONN, CHECK_NULP, dbproc, FAIL, DBMONEY::mnyhigh, DBMONEY::mnylow, SUCCEED, TDS_DBG_FUNC, and tdsdump_log.

Modified on Sat Jun 08 14:24:15 2024 by modify_doxy.py rev. 669887