Update copyright year.
[umurmur.git] / src / pds.c
index 7db1e7a5090cfee291f0184908ee6c52de88ece5..ec28928ba4ead6a6b10df61ce0885e8741494451 100644 (file)
--- a/src/pds.c
+++ b/src/pds.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 2009, Martin Johansson <martin@fatbob.nu>
-   Copyright (C) 2005-2009, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-2012, Martin Johansson <martin@fatbob.nu>
+   Copyright (C) 2005-2012, Thorvald Natvig <thorvald@natvig.com>
 
    All rights reserved.
 
@@ -83,6 +83,28 @@ void Pds_append_data_nosize(pds_t *pds, const uint8_t *data, uint32_t len)
        }
 }
 
+uint8_t Pds_next8(pds_t *pds)
+{
+       if (pds->offset < pds->maxsize)
+               return pds->data[pds->offset++];
+       else {
+               pds->bOk = false;
+               return 0;
+       }
+}
+
+int Pds_skip(pds_t *pds, int offset)
+{
+       if (pds->offset + offset <= pds->maxsize) {
+               pds->offset += offset;
+               return offset;
+       } else {
+               pds->bOk = false;
+               return 0;
+       }
+       
+}
+
 static inline uint64_t next(pds_t *pds)
 {
        if (pds->offset < pds->maxsize)