"Open Macro Library"

Syntax quick tour

vstack (vector-based stack implementation)

  #include "oml_debug.h"
  #include "oml_vstack.h"
  typedef ... myType, *pMyType;
  oml_define_vstack(pMyType);

  ...

  myType myObj1;
  pMyType pObj;

  oml_vstack(pMyType) v; // template-like syntax
  oml_assert_ok(oml_vstack_init(&v, 16)); // Provide maximum size

  oml_assert_ok(oml_vstack_push(&v, pObj));
  oml_assert_ok(oml_vstack_push(&v, pObj));

  oml_assert_ok(oml_vstack_pop(&v, &pObj));
  // Use pObj
  oml_assert_ok(oml_vstack_pop(&v, &pObj));
  // Use pObj

  oml_vstack_iterator(pMyType) it;

  for (oml_vstack_begin(&v, &it); oml_vstack_has_next(&v, &it); oml_vstack_next(&v, &it)) {
    oml_assert_ok(oml_vstack_get_next(&v, &it, &pObj));
    // Use pObj
  }

Latest news

2009-01-25
Deadline exception

2009-01-24
Exceptions for C Package

2009-01-16
Exceptions for the C language

2007-03-06
Syntax quick tour update.





Last update:
March 2, 2010