Version 3.0.49. Update news.
[yaz-moved-to-github.git] / src / ber_int.c
index f0680fb..ef185aa 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data
+ * Copyright (C) 1995-2009 Index Data
  * See the file LICENSE for details.
  */
 
 
 #ifdef WIN32
 #include <winsock.h>
-#else
+#endif
+#if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
 
 #include "odr-priv.h"
 
-static int ber_encinteger(ODR o, int val);
-static int ber_decinteger(const unsigned char *buf, int *val, int max);
+static int ber_encinteger(ODR o, Odr_int val);
+static int ber_decinteger(const unsigned char *buf, Odr_int *val, int max);
 
-int ber_integer(ODR o, int *val)
+int ber_integer(ODR o, Odr_int *val)
 {
     int res;
 
@@ -60,7 +61,7 @@ int ber_integer(ODR o, int *val)
 /*
  * Returns: number of bytes written or -1 for error (out of bounds).
  */
-int ber_encinteger(ODR o, int val)
+int ber_encinteger(ODR o, Odr_int val)
 {
     int a, len;
     union { int i; unsigned char c[sizeof(int)]; } tmp;
@@ -81,7 +82,7 @@ int ber_encinteger(ODR o, int val)
 /*
  * Returns: Number of bytes read or 0 if no match, -1 if error.
  */
-int ber_decinteger(const unsigned char *buf, int *val, int max)
+int ber_decinteger(const unsigned char *buf, Odr_int *val, int max)
 {
     const unsigned char *b = buf;
     unsigned char fill;
@@ -111,6 +112,7 @@ int ber_decinteger(const unsigned char *buf, int *val, int max)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab