SWILIB API (X75)    
Loading...
Searching...
No Matches
Addressbook

Detailed Description

Functions for working with addressbook.

Usage: #include <swilib.h> or #include <swilib/addressbook.h>

Data Structures

struct  AB_UNPRES_ITEM
 Item of the AB_UNPRES. More...
 
struct  AB_UNPRES
 Uncompressed APO entry. More...
 
struct  PKT_NUM
 Value of the adressbook list item. More...
 
struct  AbNumList
 Item of the adressbook list. More...
 
struct  NativeAbData
 Native address book data. More...
 

Typedefs

typedef struct NativeAbData NativeAbData
 
typedef struct AbNumList AbNumList
 
typedef struct PKT_NUM PKT_NUM
 
typedef struct AB_UNPRES AB_UNPRES
 
typedef struct AB_UNPRES_ITEM AB_UNPRES_ITEM
 

Functions

int OpenNativeAddressbook (int type, int unk1, int unk2, NativeAbData *data)
 Open native address book.
 
NativeAbData * AllocNativeAbData (void)
 Allocate native addressbook data.
 
int FreeNativeAbData (NativeAbData *data)
 Free allocated native addressbook data.
 
int GetFilledNAbDataCount (NativeAbData *data)
 Get count of the items in NativeAbData.
 
PKT_NUM * GetDataFromNAbData (NativeAbData *data, int index)
 Get item data from the NativeAbData by index.
 
int GetNativeAbDataStatus (NativeAbData *data, int index)
 Get item status from the NativeAbData by index.
 
int GetNativeAbDataType (NativeAbData *data, int index)
 Get item type from the NativeAbData by index.
 
WSHDR * GetNumFromNativeAbData (NativeAbData *data, int type, int index)
 Get number from the NativeAbData.
 
int SetNumToNativeAbData (NativeAbData *data, int type, const WSHDR *num)
 Set number to the NativeAbData.
 
void UnpackNumPkt (const PKT_NUM *pkt, char *buf, int maxlen)
 Decode PKT_NUM for the phone number.
 

Functions for read files in <tt>0:\\\\System\\\\apo\\\\addr\\\\</tt>

int UnpackABentry (AB_UNPRES *entry, const void *data, int size, int flags)
 Unpack entry.
 
int FreeUnpackABentry (AB_UNPRES *entry, void *mfree_fn)
 Free unpacked entry.
 
int GetTypeOfAB_UNPRES_ITEM (int item_type)
 Convert AB_UNPRES.item_type to the NativeAbData item type.
 

Data Structure Documentation

◆ AB_UNPRES_ITEM

struct AB_UNPRES_ITEM

◆ AB_UNPRES

struct AB_UNPRES

◆ PKT_NUM

struct PKT_NUM

◆ AbNumList

struct AbNumList

◆ NativeAbData

struct NativeAbData

Typedef Documentation

◆ NativeAbData

typedef struct NativeAbData NativeAbData

Definition at line 18 of file addressbook.h.

◆ AbNumList

typedef struct AbNumList AbNumList

Definition at line 19 of file addressbook.h.

◆ PKT_NUM

typedef struct PKT_NUM PKT_NUM

Definition at line 20 of file addressbook.h.

◆ AB_UNPRES

typedef struct AB_UNPRES AB_UNPRES

Definition at line 21 of file addressbook.h.

◆ AB_UNPRES_ITEM

typedef struct AB_UNPRES_ITEM AB_UNPRES_ITEM

Definition at line 22 of file addressbook.h.

Function Documentation

◆ OpenNativeAddressbook()

int OpenNativeAddressbook ( int type,
int unk1,
int unk2,
NativeAbData * data )

Open native address book.

Parameters
typetype of address-book UI
unk1unknown
unk2unknown
datapointer to the NativeAbData or NULL
Returns
CSM ID

◆ AllocNativeAbData()

NativeAbData * AllocNativeAbData ( void )

Allocate native addressbook data.

Returns
pointer to the allocated data

◆ FreeNativeAbData()

int FreeNativeAbData ( NativeAbData * data)

Free allocated native addressbook data.

Parameters
datapointer to the allocated data
Returns
1: success, 0: error

◆ GetFilledNAbDataCount()

int GetFilledNAbDataCount ( NativeAbData * data)

Get count of the items in NativeAbData.

Parameters
datapointer to the native addressbook data
Returns
count

◆ GetDataFromNAbData()

PKT_NUM * GetDataFromNAbData ( NativeAbData * data,
int index )

Get item data from the NativeAbData by index.

Parameters
datapointer to the native addressbook data
indexindex of the item
Returns
pointer to the PKT_NUM

◆ GetNativeAbDataStatus()

int GetNativeAbDataStatus ( NativeAbData * data,
int index )

Get item status from the NativeAbData by index.

Parameters
datapointer to the native addressbook data
indexindex of the item
Returns
item status

◆ GetNativeAbDataType()

int GetNativeAbDataType ( NativeAbData * data,
int index )

Get item type from the NativeAbData by index.

Parameters
datapointer to the native addressbook data
indexindex of the item
Returns
item type

◆ GetNumFromNativeAbData()

WSHDR * GetNumFromNativeAbData ( NativeAbData * data,
int type,
int index )

Get number from the NativeAbData.

Parameters
datapointer to the native addressbook data
typeitem type
indexzero-based item index
Returns
newly allocated string, or NULL if the item was not found; free with FreeWS

◆ SetNumToNativeAbData()

int SetNumToNativeAbData ( NativeAbData * data,
int type,
const WSHDR * num )

Set number to the NativeAbData.

Parameters
datapointer to the native addressbook data
typeitem type
numphone number
Returns
1: success, 0: error

◆ UnpackNumPkt()

void UnpackNumPkt ( const PKT_NUM * pkt,
char * buf,
int maxlen )

Decode PKT_NUM for the phone number.

Parameters
pktpointer to the PKT_NUM
[out]bufoutput buffer for the phone number
maxlenmaximum size of output buffer

◆ UnpackABentry()

int UnpackABentry ( AB_UNPRES * entry,
const void * data,
int size,
int flags )

Unpack entry.

Parameters
[out]entryunpacked entry
dataencoded entry data
sizesize of the entry data
flagsunknown flags
Returns
0 or error

◆ FreeUnpackABentry()

int FreeUnpackABentry ( AB_UNPRES * entry,
void * mfree_fn )

Free unpacked entry.

Parameters
entrypointer to the AB_UNPRES
mfree_fnresult of the mfree_adr()
Returns
0 or error

◆ GetTypeOfAB_UNPRES_ITEM()

int GetTypeOfAB_UNPRES_ITEM ( int item_type)

Convert AB_UNPRES.item_type to the NativeAbData item type.

Parameters
item_typeinput type
Returns
converted type