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

Detailed Description

Legacy or bad functions, usually used in the patches.

Usage: #include <swilib/legacy.h>

Warning
Don't use in ELF's.

Data Structures

struct  RAM_DATETIME
 RAM copy of the RTC calendar. More...
 

Typedefs

typedef struct RAM_DATETIME RAM_DATETIME
 

Functions

int memcmp_2 (const void *ptr1, const void *ptr2, size_t num)
 Compare two blocks of memory.
 
void * memcpy_2 (void *destination, const void *source, size_t num)
 Copy block of memory.
 
char * strrchr_2 (const char *str, int character)
 Locate last occurrence of character in string.
 
int wsprintf_2 (WSHDR *s, const char *format,...)
 Write formatted output to WSHDR.
 
WSHDR * AllocWS_2 (int size)
 Create new empty WSHDR.
 
void FreeWS_2 (WSHDR *str)
 Free WSHDR.
 
WSHDR * wstrcpy_2 (WSHDR *destination, WSHDR *source)
 Copy WSHDR.
 
void ClearMemory (void *ptr, int num)
 Fill block of memory with zero.
 
char * GetPaletteAdrByColorIndex_2 (int index)
 Get color from the phone theme.
 
int IsTimerProc_2 (GBSTMR *timer)
 Check if timer is not yet expired.
 
void LockSched_2 (void)
 Lock OS scheduler.
 
void UnlockSched_2 (void)
 Unlock OS scheduler.
 
void DrawImg_2 (int x, int y, int picture)
 Draw image from the PIT table.
 
void DrawRoundedFrame_2 (int x1, int y1, int x2, int y2, int x_round, int y_round, int flags, const char *pen, const char *brush)
 Draw a rounded rectangle.
 
void DrawRectangle_2 (int x1, int y1, int x2, int y2, int flags, const char *pen, const char *brush)
 Draw a rectangle.
 
void DrwObj_SetColor_2 (DRWOBJ *drwobj, const char *pen, const char *brush)
 Set color to the DRWOBJ.
 
void GeneralFuncF1_2 (int cmd)
 Request closing of the focused GUI.
 
int GetTimeFormat ()
 Get date&time format from settings.
 
short GetWavLenByContent (const uint8_t **data, uint32_t riff_size, void *info)
 Parse the header of an IMA ADPCM .wav file (mono, 4 bits, 8000 or 16000 Hz).
 
void * RamCurrentTrack ()
 Pointer to the current track in MediaPlayer.
 
void * RamAudioParamsAddr (void)
 Pointer to the audio params (unknown).
 
RAM_DATETIME * RamDateTime ()
 Pointer to the current date and time.
 
char * RamKeyBuffer (void)
 Pointer to the current pressed key.
 
char * RamIsNumberTyping (void)
 Check if user typing phone number.
 
void * RamShutdownMode ()
 Pointer to the state of the power on/off process (MSMONOFF).
 
void * RamSizeOfPart ()
 Unknown.
 
int * RamSizeOfReceivedOrSentFile ()
 Get size of the recevied or sent file.
 
const char * RamNameOfReceivedOrSentFile ()
 Get size of the recevied or sent file.
 
int * RamIsSendingOrReceivingFileByBT ()
 Check if currently sending or receiving file by BT.
 
int * RamIsNotOnMainscreen ()
 Check if the IDLE is NOT currently displayed.
 
void editOrNewTXTModule (const char *file)
 Unknown.
 
void SwitchVibraOnOff (void)
 Toggle vibration for the current profile.
 
int GetProfileFilter (int profile_id)
 Unknown.
 

Nucleus

void NU_Restore_Interrupts_2 (void)
 
void NU_Unprotect_2 (void)
 
void NU_Disable_History_Saving_2 (void)
 
void NU_Enable_History_Saving_2 (void)
 
char * RamInputLanguage ()
 Input language flags byte (historical address, not the language ID).
 

Data Structure Documentation

◆ RAM_DATETIME

struct RAM_DATETIME

Typedef Documentation

◆ RAM_DATETIME

typedef struct RAM_DATETIME RAM_DATETIME

Definition at line 23 of file legacy.h.

Function Documentation

◆ memcmp_2()

int memcmp_2 ( const void * ptr1,
const void * ptr2,
size_t num )

Compare two blocks of memory.

Parameters
ptr1Pointer to block of memory.
ptr2Pointer to block of memory.
numNumber of bytes to compare.
Returns
<0 the first byte that does not match in both memory blocks has a lower value in ptr1 than in ptr2 (if evaluated as unsigned char values)
0 the contents of both memory blocks are equal
>0 the first byte that does not match in both memory blocks has a greater value in ptr1 than in ptr2 (if evaluated as unsigned char values)
Deprecated
use memcmp

◆ memcpy_2()

void * memcpy_2 ( void * destination,
const void * source,
size_t num )

Copy block of memory.

Parameters
destinationPointer to the destination array where the content is to be copied, type-casted to a pointer of type void*.
sourcePointer to the source of data to be copied, type-casted to a pointer of type const void*.
numNumber of bytes to copy.
Returns
destination is returned.
Deprecated
use memcpy

◆ strrchr_2()

char * strrchr_2 ( const char * str,
int character )

Locate last occurrence of character in string.

Parameters
strC string.
characterCharacter to be located. It is passed as its int promotion, but it is internally converted back to char.
Returns
A pointer to the last occurrence of character in str. If the character is not found, the function returns a null pointer.
Deprecated
use strrchr

◆ wsprintf_2()

int wsprintf_2 ( WSHDR * s,
const char * format,
... )

Write formatted output to WSHDR.

Additional placeholders:

  • %t - CP1251 string (cyrillic)
  • %s - CP1252 string (latin)
  • %w - UTF-16 string (WSHDR)
Parameters
[out]spointer to a WSHDR where the resulting string is stored, the buffer should be large enough to contain the resulting string
formatC-string that contains a format string that follows the same specifications as standart format in any sprintf/printf (CP1252, latin)
Returns
The number of characters that would have been written if n had been sufficiently large, not counting the terminating null character.
If an encoding error occurs, a negative number is returned.
Notice that only when this returned value is non-negative and less than n, the string has been completely written.
Deprecated
use wsprintf

◆ AllocWS_2()

WSHDR * AllocWS_2 ( int size)

Create new empty WSHDR.

Parameters
sizemaximum length of the WSHDR
Returns
pointer to the new allocated WSHDR
Deprecated
use AllocWS

◆ FreeWS_2()

void FreeWS_2 ( WSHDR * str)

Free WSHDR.

Parameters
strpointer to the WSHDR allocated by AllocWS
Deprecated
use FreeWS

◆ wstrcpy_2()

WSHDR * wstrcpy_2 ( WSHDR * destination,
WSHDR * source )

Copy WSHDR.

Parameters
destinationpointer to the destination WSHDR where the content is to be copied
sourcestring to be copied
Returns
destination is returned.
Deprecated
use wstrcpy

◆ ClearMemory()

void ClearMemory ( void * ptr,
int num )

Fill block of memory with zero.

Parameters
ptrPointer to the block of memory to fill.
numNumber of bytes to be set to the zero.
Deprecated
use memset

◆ GetPaletteAdrByColorIndex_2()

char * GetPaletteAdrByColorIndex_2 ( int index)

Get color from the phone theme.

Parameters
indexcolor index in .col, see ThemePeletteColorID
Returns
pointer to the char[4] array (RR, GG, BB, AA)
Deprecated
use GetPaletteAdrByColorIndex

◆ IsTimerProc_2()

int IsTimerProc_2 ( GBSTMR * timer)

Check if timer is not yet expired.

Parameters
timerpointer to the GBS timer
Returns
1: not expired, 0: expired
Deprecated
use IsTimerProc

◆ LockSched_2()

void LockSched_2 ( void )

Lock OS scheduler.

Deprecated
use LockSched

◆ UnlockSched_2()

void UnlockSched_2 ( void )

Unlock OS scheduler.

Deprecated
use UnlockSched

◆ DrawImg_2()

void DrawImg_2 ( int x,
int y,
int picture )

Draw image from the PIT table.

Parameters
x,yimage coordinates
pictureimage number
Deprecated
use DrawImg

◆ DrawRoundedFrame_2()

void DrawRoundedFrame_2 ( int x1,
int y1,
int x2,
int y2,
int x_round,
int y_round,
int flags,
const char * pen,
const char * brush )

Draw a rounded rectangle.

Parameters
x1,y1left+top coordinates
x2,y2right+bottom coordinates
x_roundhorizontal round
y_roundvertical round
flagsdrawing flags bitmask, see RectDrawingFlags
penstroke color
brushfill color
Deprecated
use DrawRoundedFrame

◆ DrawRectangle_2()

void DrawRectangle_2 ( int x1,
int y1,
int x2,
int y2,
int flags,
const char * pen,
const char * brush )

Draw a rectangle.

Parameters
x1,y1left+top coordinates
x2,y2right+bottom coordinates
flagsdrawing flags bitmask, see RectDrawingFlags
penstroke color
brushfill color
Deprecated
use DrawRectangle

◆ DrwObj_SetColor_2()

void DrwObj_SetColor_2 ( DRWOBJ * drwobj,
const char * pen,
const char * brush )

Set color to the DRWOBJ.

Parameters
drwobjdraw object
penstroke color
brushfill color
Deprecated
use DrwObj_SetColor

◆ GeneralFuncF1_2()

void GeneralFuncF1_2 ( int cmd)

Request closing of the focused GUI.

Parameters
cmdcode which bypassed the MSG_GUI_DESTROYED event
Deprecated
use GeneralFuncF1

◆ GetTimeFormat()

int GetTimeFormat ( )

Get date&time format from settings.

Deprecated
use RamDateTimeSettings

◆ GetWavLenByContent()

short GetWavLenByContent ( const uint8_t ** data,
uint32_t riff_size,
void * info )

Parse the header of an IMA ADPCM .wav file (mono, 4 bits, 8000 or 16000 Hz).

Parameters
datapointer to the pointer to the .wav file bytes, starting with "RIFF"
riff_sizeRIFF chunk size (32-bit value at offset 4 of the file)
[out]infobuffer of 0xD8 bytes
Returns
0x11 on success, other values on error
Note
info: +0x00 status (uint16_t), +0x14 audio data offset (uint32_t), +0x18 duration in ms (uint32_t).
Available on platforms:
NSG, ELKA
Deprecated
Always use: GetFileProp

◆ RamCurrentTrack()

void * RamCurrentTrack ( )

Pointer to the current track in MediaPlayer.

Returns
unknown

◆ RamAudioParamsAddr()

void * RamAudioParamsAddr ( void )

Pointer to the audio params (unknown).

Returns
unknown
Available on platforms:
X75, SG

◆ RamDateTime()

RAM_DATETIME * RamDateTime ( )

Pointer to the current date and time.

Returns
pointer to the RAM copy of the RTC calendar
Note
The time fields may not be updated on every platform, use GetDateTime.

◆ RamKeyBuffer()

char * RamKeyBuffer ( void )

Pointer to the current pressed key.

Returns
pointer to the keycode
Deprecated
use RamPressedKey

◆ RamIsNumberTyping()

char * RamIsNumberTyping ( void )

Check if user typing phone number.

Returns
pointer to a byte that is 1 while a phone number is being entered and 0 otherwise
Available on platforms:
NSG, ELKA

◆ RamShutdownMode()

void * RamShutdownMode ( )

Pointer to the state of the power on/off process (MSMONOFF).

Returns
pointer to the uint16 bitmask of completed power-off stages

◆ RamSizeOfPart()

void * RamSizeOfPart ( )

Unknown.

Returns
unknown

◆ RamSizeOfReceivedOrSentFile()

int * RamSizeOfReceivedOrSentFile ( )

Get size of the recevied or sent file.

Returns
size

◆ RamNameOfReceivedOrSentFile()

const char * RamNameOfReceivedOrSentFile ( )

Get size of the recevied or sent file.

Returns
size

◆ RamIsSendingOrReceivingFileByBT()

int * RamIsSendingOrReceivingFileByBT ( )

Check if currently sending or receiving file by BT.

Returns
unknown

◆ RamIsNotOnMainscreen()

int * RamIsNotOnMainscreen ( )

Check if the IDLE is NOT currently displayed.

Returns
pointer to 1 or 0
Deprecated
strange function, use IsIdleUiOnTop

◆ editOrNewTXTModule()

void editOrNewTXTModule ( const char * file)

Unknown.

◆ SwitchVibraOnOff()

void SwitchVibraOnOff ( void )

Toggle vibration for the current profile.

Available on platforms:
X75, SG

◆ GetProfileFilter()

int GetProfileFilter ( int profile_id)

Unknown.

Parameters
profile_idprofile ID
Returns
unknown
Available on platforms:
X75, SG

◆ NU_Restore_Interrupts_2()

void NU_Restore_Interrupts_2 ( void )

◆ NU_Unprotect_2()

void NU_Unprotect_2 ( void )

◆ NU_Disable_History_Saving_2()

void NU_Disable_History_Saving_2 ( void )

◆ NU_Enable_History_Saving_2()

void NU_Enable_History_Saving_2 ( void )

◆ RamInputLanguage()

char * RamInputLanguage ( )

Input language flags byte (historical address, not the language ID).

Returns
pointer to the flags byte: bit 1 = first input language is automatic, bit 4 = second one is automatic
Note
The first input language follows this byte: index in the T9 language table (0-35).
Deprecated
Not the input language.