-/*
- * Copyright (C) 1995-2007, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2010 Index Data
* See the file LICENSE for details.
- *
- * $Id: odr_mem.c,v 1.11 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file odr_mem.c
return r;
}
-void *odr_malloc(ODR o, int size)
+void *odr_malloc(ODR o, size_t size)
{
return nmem_malloc(o->mem, size);
}
return nmem_strdup(o->mem, str);
}
+char *odr_strdup_null(ODR o, const char *str)
+{
+ return nmem_strdup_null(o->mem, str);
+}
+
char *odr_strdupn(ODR o, const char *str, size_t n)
{
return nmem_strdupn(o->mem, str, n);
}
-int *odr_intdup(ODR o, int v)
+Odr_int *odr_intdup(ODR o, Odr_int v)
{
return nmem_intdup(o->mem, v);
}
-int odr_total(ODR o)
+Odr_bool *odr_booldup(ODR o, Odr_bool v)
+{
+ return nmem_booldup(o->mem, v);
+}
+
+size_t odr_total(ODR o)
{
return nmem_total(o->mem);
}
o->pos = offset;
return 0;
}
+
+Odr_int odr_atoi(const char *s)
+{
+#if NMEM_64
+ char *endptr;
+#if WIN32
+ return _strtoui64(s, &endptr, 10);
+#else
+ return strtoll(s, &endptr, 10);
+#endif
+
+#else
+ return atoi(s);
+#endif
+}
+
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab