Gammu API  1.32.90
gammu-misc.h File Reference
#include <stdio.h>
#include <gammu-file.h>
#include <gammu-config.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define MAX(a, b)   ((a)>(b) ? (a) : (b))
#define MIN(a, b)   ((a)<(b) ? (a) : (b))
#define GSM_GNUC_PREREQ(maj, min)   0
#define PRINTF_STYLE(f, a)
#define SCANF_STYLE(f, a)
#define WARNUNUSED
#define UNUSED
#define NORETURN
#define INLINE
#define __FUNCTION__WORKING

Functions

int GetLine (FILE *File, char *Line, int count)
const char * GetGammuVersion (void)
const char * GetCompiler (void)
const char * GetOS (void)
const char * GetGammuLocalePath (void)
void GSM_InitLocales (const char *path)
void EncodeHexBin (char *dest, const unsigned char *src, size_t len)
gboolean GSM_IsNewerVersion (const char *latest_version, const char *current_version)

Detailed Description

Author
Michal Čihař

Miscellaneous helper functions.

Definition in file gammu-misc.h.

Macro Definition Documentation

#define __FUNCTION__WORKING

Definition at line 131 of file gammu-misc.h.

#define GSM_GNUC_PREREQ (   maj,
  min 
)    0

Definition at line 80 of file gammu-misc.h.

#define INLINE

Definition at line 114 of file gammu-misc.h.

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

Definition at line 64 of file gammu-misc.h.

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

Definition at line 66 of file gammu-misc.h.

#define NORETURN

Definition at line 107 of file gammu-misc.h.

#define PRINTF_STYLE (   f,
 
)

Definition at line 88 of file gammu-misc.h.

#define SCANF_STYLE (   f,
 
)

Definition at line 89 of file gammu-misc.h.

#define UNUSED

Definition at line 101 of file gammu-misc.h.

#define WARNUNUSED

Definition at line 95 of file gammu-misc.h.

Function Documentation

void EncodeHexBin ( char *  dest,
const unsigned char *  src,
size_t  len 
)

Encodes text to hexadecimal binary representation.

const char* GetCompiler ( void  )

Gets compiler which was used to compile Gammu library.

const char* GetGammuLocalePath ( void  )

Returns path to Gammu locales.

const char* GetGammuVersion ( void  )

Gets Gammu library version.

int GetLine ( FILE *  File,
char *  Line,
int  count 
)

Reads single line from file.

Parameters
FileFile descriptor to read from.
LineBuffer where t ostore result.
countMaximal length of text which can be stored in buffer.
Returns
Length of read line, -1 on error.
const char* GetOS ( void  )

Gets host OS.

void GSM_InitLocales ( const char *  path)

Initializes locales. This sets up things needed for proper string conversion from local charset as well as initializes gettext based translation.

Parameters
pathPath to gettext translation. If NULL compiled in default is used.
gboolean GSM_IsNewerVersion ( const char *  latest_version,
const char *  current_version 
)

Returns TRUE if firmware version is newer.

Parameters
latest_versionString containing version (eg. latest available).
current_versionString containing version (eg. current one).
Returns
True if latest_version > current_version.