kmediad 0.5.0a
A cross-platform Web-based audio player
Data Structures | Typedefs | Functions
klib_integer.h File Reference

Interface of the klib_Integer class; a subclass of klib_Object. More...

#include <klib_defines.h>

Go to the source code of this file.

Data Structures

struct  _klib_Integer
 An object which wraps a simple integer, so it can be used in a klib_List or klib_Array. More...

Typedefs

typedef struct _klib_Integer klib_Integer

Functions

void klib_integer_construct (klib_Integer *self, int i)
void klib_integer_dispose (klib_Integer *self)
klib_Integerklib_integer_new (int i)
 Create a new klib_Integer with the specified value.

Detailed Description

Interface of the klib_Integer class; a subclass of klib_Object.


Typedef Documentation

typedef struct _klib_Integer klib_Integer

Function Documentation

void klib_integer_construct ( klib_Integer self,
int  i 
)
  {
  if (klib_object_trace_flags & KLIB_OBJECT_TRACE_CONSTRUCTION)
    klib_log (KLIB_LOG_TRACE, "Called constructor for Integer\n");

  klib_object_construct ((klib_Object *)self, "Integer");
  ((klib_Object *)self)->dispose_func = (klib_Object_DisposeFunc) 
     klib_integer_dispose;
  ((klib_Object *)self)->tostring_func = (klib_Object_TostringFunc) 
     klib_integer_tostring;

  self->i = i;
  }
void klib_integer_dispose ( klib_Integer self)
klib_Integer* klib_integer_new ( int  i)

Create a new klib_Integer with the specified value.

  {
  if (klib_object_trace_flags & KLIB_OBJECT_TRACE_CONSTRUCTION)
    klib_log (KLIB_LOG_TRACE, "Called new for Integer\n");

  klib_Integer *self = (klib_Integer *) malloc (sizeof (klib_Integer));
  memset (self, 0, sizeof (klib_Integer));
  klib_integer_construct (self, i); 

  return self;
  }