projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
One COMSTACK test program
[yaz-moved-to-github.git]
/
src
/
odr_mem.c
diff --git
a/src/odr_mem.c
b/src/odr_mem.c
index
55478c0
..
88f012c
100644
(file)
--- a/
src/odr_mem.c
+++ b/
src/odr_mem.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2009 Index Data
+ * Copyright (C) 1995-2010 Index Data
* See the file LICENSE for details.
*/
/**
* See the file LICENSE for details.
*/
/**
@@
-27,7
+27,7
@@
NMEM odr_extract_mem(ODR o)
return r;
}
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_malloc(o->mem, size);
}
@@
-47,12
+47,17
@@
char *odr_strdupn(ODR o, const char *str, size_t n)
return nmem_strdupn(o->mem, str, 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);
}
{
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);
}
{
return nmem_total(o->mem);
}
@@
-119,6
+124,22
@@
int odr_seek(ODR o, int whence, int offset)
o->pos = offset;
return 0;
}
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
/*
* Local variables:
* c-basic-offset: 4