spBase
読み取り中…
検索中…
一致する文字列を見つけられません
基本マクロ

マクロ定義

#define SPB_CHECK_VERSION(version, revision, update)
 
#define spLONG   long
 
#define spULONG   unsigned long
 
#define spDWORD   spULONG
 
#define spINT8   signed char
 
#define spINT16   short
 
#define spBYTE   unsigned char
 
#define spWORD   unsigned short
 
#define SP_TRUE   1
 
#define SP_FALSE   0
 
#define SP_TRUE_STRING   "1"
 
#define SP_FALSE_STRING   "0"
 
#define SP_SUCCESS   1
 
#define SP_FAILURE   0
 
#define SP_PATHLIST_SEPARATOR   ':'
 
#define spMax(a, b)   ((a) > (b) ? (a) : (b))
 
#define spMin(a, b)   ((a) < (b) ? (a) : (b))
 
#define spAbs(x)   ((x) >= 0 ? (x) : -(x))
 
#define spCAbs(xr, xi)   sqrt((double)(xr)*(double)(xr)+(double)(xi)*(double)(xi))
 
#define spCAbsf(xr, xi)   sqrtf((float)((xr)*(xr)+(xi)*(xi)))
 
#define spSquare(x)   ((x) * (x))
 
#define spCSquare(xr, xi)   ((xr)*(xr)+(xi)*(xi))
 
#define spPow2(p)   (1 << (long)(p))
 
#define spArraySize(array)   ((unsigned int)(sizeof(array) / sizeof(array[0])))
 
#define spStrEq(s1, s2)   ((s1 != NULL) && (s2 != NULL) && (strcmp((s1), (s2)) == 0) ? 1 : 0)
 
#define spStrNEq(s1, s2, n)   ((s1 != NULL) && (s2 != NULL) && (strncmp((s1), (s2), n) == 0) ? 1 : 0)
 
#define spStrVEq(s1, s2)   ((s1 != NULL) && (s2 != NULL) && (strncmp((s1), (s2), strlen(s2)) == 0) ? 1 : 0)
 
#define spStrNone(string)   (((string) == NULL || *(string) == NUL) ? 1 : 0)
 
#define spIsTrue(flag)   ((flag) != SP_FALSE ? SP_TRUE : SP_FALSE)
 
#define spIsFalse(flag)   ((flag) == SP_FALSE ? SP_TRUE : SP_FALSE)
 
#define spdBf(x)   (20.0f * log10f((float)((x) <= 0.0f ? SP_TINY_NUMBER : (x))))
 
#define spdB(x)   (20.0 * log10((double)((x) <= 0.0 ? SP_TINY_NUMBER : (x))))
 
#define spdBpowf(x)   (10.0f * log10f((float)((x) <= 0.0f ? SP_TINY_NUMBER : (x))))
 
#define spdBpow(x)   (10.0 * log10((double)((x) <= 0.0 ? SP_TINY_NUMBER : (x))))
 
#define spOffset(typep, field)    ((int) (((char *) (&(((typep)0)->field))) - ((char *)0)))
 
#define spOffsetOf(type, field)   spOffset(type*, field)
 
#define SP_NUL   '\0'
 

型定義

typedef int spBool
 

詳解

マクロ定義詳解

◆ SPB_CHECK_VERSION

#define SPB_CHECK_VERSION ( version,
revision,
update )
値:
(SPB_VERSION > (version) || \
(SPB_VERSION == (version) && SPB_REVISION > (revision)) || \
(SPB_VERSION == (version) && SPB_REVISION == (revision) && SPB_UPDATE_LEVEL >= (update)))

spBaseのヘッダファイルにおけるバージョンが,指定したバージョン以上であるかをチェックします.

引数
[in]versionバージョン番号を指定します.
[in]revisionリビション番号を指定します.
[in]updateアップデート番号を指定します.

◆ spLONG

#define spLONG   long

Native type whose size is the same as that of LONG on Windows.

◆ spULONG

#define spULONG   unsigned long

Native type whose size is the same as that of ULONG on Windows.

◆ spDWORD

#define spDWORD   spULONG

Native type whose size is the same as that of DWORD on Windows.

◆ spINT8

#define spINT8   signed char

Native type whose size is the same as that of INT8 on Windows.

◆ spINT16

#define spINT16   short

Native type whose size is the same as that of INT16 on Windows.

◆ spBYTE

#define spBYTE   unsigned char

Native type whose size is the same as that of BYTE on Windows.

◆ spWORD

#define spWORD   unsigned short

Native type whose size is the same as that of WORD on Windows.

◆ SP_TRUE

#define SP_TRUE   1

True for spBool.

各種例
command_thread.c, dirtest.c, pstest.c, spcat.c.

◆ SP_FALSE

#define SP_FALSE   0

False for spBool.

各種例
command_thread.c, dirtest.c, spcat.c.

◆ SP_TRUE_STRING

#define SP_TRUE_STRING   "1"

String representation of SP_TRUE .

◆ SP_FALSE_STRING

#define SP_FALSE_STRING   "0"

String representation of SP_FALSE .

各種例
spcat.c.

◆ SP_SUCCESS

#define SP_SUCCESS   1

Status indicating success.

◆ SP_FAILURE

#define SP_FAILURE   0

Status indicating failure.

◆ SP_PATHLIST_SEPARATOR

#define SP_PATHLIST_SEPARATOR   ':'

Separator for the path list string which is a string containing multiple paths. The separator is ';' on Windows and Mac, or ':' on others.

◆ spMax

#define spMax ( a,
b )   ((a) > (b) ? (a) : (b))

The largest of a and b .

◆ spMin

#define spMin ( a,
b )   ((a) < (b) ? (a) : (b))

The smallest of a and b .

◆ spAbs

#define spAbs ( x)    ((x) >= 0 ? (x) : -(x))

The absolute value of x .

◆ spCAbs

#define spCAbs ( xr,
xi )   sqrt((double)(xr)*(double)(xr)+(double)(xi)*(double)(xi))

The absolute value of the complex number.

◆ spCAbsf

#define spCAbsf ( xr,
xi )   sqrtf((float)((xr)*(xr)+(xi)*(xi)))

The absolute value of the complex number for float type.

◆ spSquare

#define spSquare ( x)    ((x) * (x))

The square of x .

◆ spCSquare

#define spCSquare ( xr,
xi )   ((xr)*(xr)+(xi)*(xi))

The absolute square of the complex number.

◆ spPow2

#define spPow2 ( p)    (1 << (long)(p))

2 to the p th power.

◆ spArraySize

#define spArraySize ( array)    ((unsigned int)(sizeof(array) / sizeof(array[0])))

Gets size of the array.

◆ spStrEq

#define spStrEq ( s1,
s2 )   ((s1 != NULL) && (s2 != NULL) && (strcmp((s1), (s2)) == 0) ? 1 : 0)

True if two strings are the same.

◆ spStrNEq

#define spStrNEq ( s1,
s2,
n )   ((s1 != NULL) && (s2 != NULL) && (strncmp((s1), (s2), n) == 0) ? 1 : 0)

True if two strings until n the element are the same.

◆ spStrVEq

#define spStrVEq ( s1,
s2 )   ((s1 != NULL) && (s2 != NULL) && (strncmp((s1), (s2), strlen(s2)) == 0) ? 1 : 0)

True if two strings until the length of s2 are the same.

◆ spStrNone

#define spStrNone ( string)    (((string) == NULL || *(string) == NUL) ? 1 : 0)

The string has no data.

◆ spIsTrue

#define spIsTrue ( flag)    ((flag) != SP_FALSE ? SP_TRUE : SP_FALSE)

True if flag is not 0.

◆ spIsFalse

#define spIsFalse ( flag)    ((flag) == SP_FALSE ? SP_TRUE : SP_FALSE)

True if flag is 0.

◆ spdBf

#define spdBf ( x)    (20.0f * log10f((float)((x) <= 0.0f ? SP_TINY_NUMBER : (x))))

Decibel of amplitude x for float type.

◆ spdB

#define spdB ( x)    (20.0 * log10((double)((x) <= 0.0 ? SP_TINY_NUMBER : (x))))

Decibel of amplitude x .

◆ spdBpowf

#define spdBpowf ( x)    (10.0f * log10f((float)((x) <= 0.0f ? SP_TINY_NUMBER : (x))))

Decibel of power x for float type.

◆ spdBpow

#define spdBpow ( x)    (10.0 * log10((double)((x) <= 0.0 ? SP_TINY_NUMBER : (x))))

Decibel of power x.

◆ spOffset

#define spOffset ( typep,
field )    ((int) (((char *) (&(((typep)0)->field))) - ((char *)0)))

Returns the offset of the specified field member within the pointer to struct.

◆ spOffsetOf

#define spOffsetOf ( type,
field )   spOffset(type*, field)

Returns the offset of the specified field member within the struct.

◆ SP_NUL

#define SP_NUL   '\0'

The null character.

型定義詳解

◆ spBool

typedef int spBool

Boolean for spLibs.