From a008b10d8488ef905a43de00ee5c8efd03b03ed6 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 9 Mar 2011 16:55:27 +0100 Subject: Support for FPGA registers --- tools.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tools.c') diff --git a/tools.c b/tools.c index 838172d..4609619 100644 --- a/tools.c +++ b/tools.c @@ -3,10 +3,26 @@ #include #include #include +#include #include #include "tools.h" +int pcilib_isnumber(const char *str) { + int i = 0; + for (i = 0; str[i]; i++) + if (!isdigit(str[i])) return 0; + return 1; +} + +int pcilib_isxnumber(const char *str) { + int i = 0; + for (i = 0; str[i]; i++) + if (!isxdigit(str[i])) return 0; + return 1; +} + + uint16_t pcilib_swap16(uint16_t x) { return (((x<<8)&0xFFFF) | ((x>>8)&0xFFFF)); } -- cgit v1.2.3