Basic Types

Basic Types — Standard MLib types, defined for ease-of-use and portability from Glib types.

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <mlib.h>

typedef             mchar;
typedef             mshort;
typedef             mlong;
typedef             mint;
typedef             mboolean;
typedef             muchar;
typedef             mushort;
typedef             mulong;
typedef             muint;
typedef             mfloat;
typedef             mdouble;
typedef             mpointer;
typedef             mconstpointer;
typedef             msize;
typedef             mssize;
typedef             mint8;
typedef             muint8;
typedef             mint16;
typedef             muint16;
typedef             mint32;
typedef             muint32;
typedef             mint64;
typedef             muint64;
typedef             MObject;
typedef             MError;
typedef             mchars;
typedef             muchars;
typedef             mconstchars;
typedef             mconstuchars;
typedef             mflag;
typedef             MPublic;
typedef             MPrivate;
typedef             MStatus;
typedef             MId;
typedef             MIdOffSet;
typedef             MDefine;
#define             MCHARINIT
#define             mchar_new                           (name)
#define             MSHORTINIT
#define             mshort_new                          (name)
#define             MLONGINIT
#define             mlong_new                           (name)
#define             MINTINIT
#define             mint_new                            (name)
#define             MBOOLEANINIT
#define             mboolean_new                        (name)
#define             MUCHARINIT
#define             muchar_new                          (name)
#define             MUSHORTINIT
#define             mushort_new                         (name)
#define             MULONGINIT
#define             mulong_new                          (name)
#define             MUINTINIT
#define             muint_new                           (name)
#define             MFLOATINIT
#define             mfloat_new                          (name)
#define             MDOUBLEINIT
#define             mdouble_new                         (name)
#define             MPOINTERINIT
#define             mpointer_new                        (name)
#define             MSIZEINIT
#define             msize_new                           (name)
#define             MSSIZEINIT
#define             mssize_new                          (name)
#define             MCHARSINIT
#define             mchars_new                          (name)
#define             MUCHARSINIT
#define             muchars_new                         (name)
#define             MSTATUSINIT
#define             MStatus_new                         (name)
#define             MIDINIT
#define             MID_MAX
#define             MId_new                             (name)
#define             MNOID
#define             MIDOFFSETINIT
#define             MIdOffSet_new                       (name)
#define             MLIB_VAR

Description

MLib defines any new types and a number of commonly used types from GLib.

Details

mchar

    typedef gchar       mchar;

Corresponds to the standard C char type.

see also: gchar


mshort

    typedef gshort      mshort;

Corresponds to the standard C short type. Values of this type can range from G_MINSHORT to G_MAXSHORT.

see also: gshort


mlong

    typedef glong       mlong;

Corresponds to the standard C long type. Values of this type can range from G_MINLONG to G_MAXLONG.

see also: glong


mint

    typedef gint        mint;

Corresponds to the standard C int type. Values of this type can range from G_MININT to G_MAXINT.

see also: gint


mboolean

    typedef gboolean    mboolean;

A standard boolean type. Variables of this type should only contain the value TRUE or FALSE.

see also: gboolean


muchar

    typedef guchar      muchar;

Corresponds to the standard C unsigned char type.

see also: guchar


mushort

    typedef gushort     mushort;

Corresponds to the standard C unsigned short type. Values of this type can range from 0 to G_MAXUSHORT.

see also: gushort


mulong

    typedef gulong   	mulong;

Corresponds to the standard C unsigned long type. Values of this type can range from 0 to G_MAXULONG.

see also: gulong


muint

    typedef guint    	muint;

Corresponds to the standard C unsigned int type. Values of this type can range from 0 to G_MAXUINT.

see also: guint


mfloat

    typedef gfloat      mfloat;

Corresponds to the standard C float type. Values of this type can range from -G_MAXFLOAT to G_MAXFLOAT.

see also: gfloat


mdouble

    typedef gdouble     mdouble;

Corresponds to the standard C double type. Values of this type can range from -G_MAXDOUBLE to G_MAXDOUBLE.

see also: gdouble


mpointer

    typedef gpointer    mpointer;

An untyped pointer. mpointer looks better and is easier to use than void*.

see also: gpointer


mconstpointer

    typedef gconstpointer   mconstpointer;

An untyped pointer to constant data. The data pointed to should not be changed.

This is typically used in function prototypes to indicate that the data pointed to will not be altered by the function.

see also: gconstpointer


msize

    typedef gsize       msize;

An unsigned integer type of the result of the sizeof operator, corresponding to the size_t type defined in C99. This type is wide enough to hold the numeric value of a pointer, so it is usually 32bit wide on a 32bit platform and 64bit wide on a 64bit platform. Values of this type can range from 0 to G_MAXSIZE.

To print or scan values of this type, use G_GSIZE_MODIFIER and/or G_GSIZE_FORMAT.

see also: gsize


mssize

    typedef gssize      mssize;

A signed variant of msize, corresponding to the ssize_t defined on most platforms. Values of this type can range from G_MINSSIZE to G_MAXSSIZE.

To print or scan values of this type, use G_GSIZE_MODIFIER and/or G_GSSIZE_FORMAT.

see also: gssize


mint8

    typedef gint8       mint8;

A signed integer guaranteed to be 8 bits on all platforms. Values of this type can range from G_MININT8 (= -128) to G_MAXINT8 (= 127).

see also: gint8


muint8

    typedef guint8      muint8;

An unsigned integer guaranteed to be 8 bits on all platforms. Values of this type can range from 0 to G_MAXUINT8 (= 255).

see also: guint8


mint16

    typedef gint16      mint16;

A signed integer guaranteed to be 16 bits on all platforms. Values of this type can range from G_MININT16 (= -32,768) to G_MAXINT16 (= 32,767).

To print or scan values of this type, use G_GINT16_MODIFIER and/or G_GINT16_FORMAT.

see also: gint16


muint16

    typedef guint16     muint16;

An unsigned integer guaranteed to be 16 bits on all platforms. Values of this type can range from 0 to G_MAXUINT16 (= 65,535).

To print or scan values of this type, use G_GINT16_MODIFIER and/or G_GUINT16_FORMAT.

see also: guint16


mint32

    typedef gint32      mint32;

A signed integer guaranteed to be 32 bits on all platforms. Values of this type can range from G_MININT32 (= -2,147,483,648) to G_MAXINT32 (= 2,147,483,647).

To print or scan values of this type, use G_GINT32_MODIFIER and/or G_GINT32_FORMAT.

see also: gint32


muint32

    typedef guint32     muint32;

An unsigned integer guaranteed to be 32 bits on all platforms. Values of this type can range from 0 to G_MAXUINT32 (= 4,294,967,295).

To print or scan values of this type, use G_GINT32_MODIFIER and/or G_GUINT32_FORMAT.

see also: guint32


mint64

    typedef gint64      mint64;

A signed integer guaranteed to be 64 bits on all platforms. Values of this type can range from G_MININT64 (= -9,223,372,036,854,775,808) to G_MAXINT64 (= 9,223,372,036,854,775,807).

To print or scan values of this type, use G_GINT64_MODIFIER and/or G_GINT64_FORMAT.

see also: gint64


muint64

    typedef guint64     muint64;

An unsigned integer guaranteed to be 64 bits on all platforms. Values of this type can range from 0 to G_MAXUINT64 (= 18,446,744,073,709,551,615).

To print or scan values of this type, use G_GINT64_MODIFIER and/or G_GUINT64_FORMAT.

see also: guint64


MObject

    typedef GObject     MObject;

GObject is the fundamental type providing the common attributes and methods for all object types in GTK+, Pango and other libraries based on GObject.

All the fields in the GObject structure are private to the GObject implementation and should never be accessed directly.

see also: GObject


MError

    typedef GError      MError;

The MError structure contains information about an error that has occurred.

see also: GError


mchars

    typedef gchar*      mchars;

Corresponds to the standard C char* type.

see also: gchar


muchars

    typedef guchar*     muchars;

Corresponds to the standard C unsigned char* type.

see also: guchar


mconstchars

    typedef const gchar*    mconstchars;

Corresponds to the standard C const char* type.

see also: gchar


mconstuchars

    typedef const guchar*       mconstuchars;

Corresponds to the standard C const unsigned char* type.

see also: guchar


mflag

    typedef gboolean    mflag;

A standard boolean type. Variables of this type should only contain the value TRUE or FALSE.

see also: mboolean


MPublic

    typedef dsPublic    MPublic;

see: dsPublic

Puntatore generico a dati pubblici.


MPrivate

    typedef dsPrivate   MPrivate;

see: dsPrivate

Puntatore generico a dati privati.


MStatus

    typedef dsStatus    MStatus;

see_also: dsStatus

Numero intero con segno che identifica lo stato di una condizione corretta o errata.


MId

	typedef mint        MId;

Numero intero con segno utilizzato come identificatore univoco di un elemento in un gruppo.


MIdOffSet

    typedef muint       MIdOffSet;

Numero intero senza segno utilizzato per indicare un limite offset raggiungibile da una variabile MId.


MDefine

    typedef ndsDefine       MDefine;

Utilizzata per indicare l'avvenuta inizializzazione di una struttura attraverso la macro costante dsDEFINE.


MCHARINIT

#define MCHARINIT				'\0'


mchar_new()

    #define mchar_new(name)			mchar		name = MCHARINIT

Declare and define a new mchar variable.

name :

name of a new mchar variable

MSHORTINIT

#define MSHORTINIT				0


mshort_new()

    #define mshort_new(name)		mshort		name = MSHORTINIT

Declare and define a new mshort variable.

name :

name of a new mshort variable

MLONGINIT

#define MLONGINIT				0L


mlong_new()

    #define mlong_new(name)			mlong		name = MLONGINIT

Declare and define a new mlong variable.

name :

name of a new mlong variable

MINTINIT

#define MINTINIT				0


mint_new()

    #define mint_new(name)			mint		name = MINTINIT

Declare and define a new mint variable.

name :

name of a new mint variable

MBOOLEANINIT

#define MBOOLEANINIT			FALSE


mboolean_new()

    #define mboolean_new(name)		mboolean name = MBOOLEANINIT

Declare and define a new mboolean variable.

name :

name of a new mboolean variable

MUCHARINIT

#define MUCHARINIT				'\0'


muchar_new()

    #define muchar_new(name)		muchar		name = MUCHARINIT

Declare and define a new muchar variable.

name :

name of a new muchar variable

MUSHORTINIT

#define MUSHORTINIT				0


mushort_new()

    #define mushort_new(name)		mushort		name = MUSHORTINIT

Declare and define a new mushort variable.

name :

name of a new mushort variable

MULONGINIT

#define MULONGINIT				0L


mulong_new()

    #define mulong_new(name)		mulong		name = MULONGINIT

Declare and define a new mulong variable.

name :

name of a new mulong variable

MUINTINIT

#define MUINTINIT				0


muint_new()

    #define muint_new(name)			muint		name = MUINTINIT

Declare and define a new muint variable.

name :

name of a new muint variable

MFLOATINIT

#define MFLOATINIT				0.0


mfloat_new()

    #define mfloat_new(name)		mfloat		name = MFLOATINIT

Declare and define a new mfloat variable.

name :

name of a new mfloat variable

MDOUBLEINIT

#define MDOUBLEINIT				0.0


mdouble_new()

    #define mdouble_new(name)		mdouble		name = MDOUBLEINIT

Declare and define a new mdouble variable.

name :

name of a new mdouble variable

MPOINTERINIT

#define MPOINTERINIT			NULL


mpointer_new()

    #define mpointer_new(name)		mpointer name = MPOINTERINIT

Declare and define a new mpointer variable.

name :

name of a new mpointer variable

MSIZEINIT

#define MSIZEINIT				0


msize_new()

    #define msize_new(name)			msize		name = MSIZEINIT

Declare and define a new msize variable.

name :

name of a new msize variable

MSSIZEINIT

#define MSSIZEINIT				0


mssize_new()

    #define mssize_new(name)		mssize		name = MSSIZEINIT

Declare and define a new mssize variable.

name :

name of a new mssize variable

MCHARSINIT

#define MCHARSINIT				NULL


mchars_new()

    #define mchars_new(name)			mchars		name = MCHARSINIT

Declare and define a new mchars variable.

name :

name of a new mchars variable

MUCHARSINIT

#define MUCHARSINIT				NULL


muchars_new()

    #define muchars_new(name)			muchars		name = MUCHARSINIT

Declare and define a new muchars variable.

name :

name of a new muchars variable

MSTATUSINIT

#define MSTATUSINIT				MERROR


MStatus_new()

    #define MStatus_new(name)		MStatus name = MSTATUSINIT

Declare and define a new MStatus variable.

name :

name of a new MStatus variable

MIDINIT

#define MIDINIT					MNOID


MID_MAX

#define MID_MAX		INT_MAX

Massimo valore assunto da una variabile di tipo MId.


MId_new()

    #define MId_new(name)			MId name = MIDINIT

Declare and define a new MId variable.

name :

name of a new MId variable

MNOID

    #define MNOID		(-1)

Valore assunto da una variabile MId quando la variabile non contiene alcun valore identificativo.


MIDOFFSETINIT

#define MIDOFFSETINIT			0


MIdOffSet_new()

    #define MIdOffSet_new(name)		MIdOffSet name = MIDOFFSETINIT

Declare and define a new MIdOffSet variable.

name :

name of a new MIdOffSet variable

MLIB_VAR

#    define MLIB_VAR extern

See Also

GLib Basic Types