]> git.sur5r.net Git - openocd/blobdiff - src/helper/binarybuffer.h
small line ending cleanup.
[openocd] / src / helper / binarybuffer.h
index 0a688945002a39f9509be5d186a38fa8454c7c94..34a167d4402049bb64244cca9538562374d32764 100644 (file)
@@ -38,11 +38,22 @@ extern u8* buf_cpy(u8 *from, u8 *to, int size);
 extern u8* buf_set_ones(u8 *buf, int count);
 extern u8* buf_set_buf(u8 *src, int src_start, u8 *dst, int dst_start, int len);
 
-extern char* buf_to_char(u8 *buf, int size);
-extern int char_to_buf(char *buf, int len, u8 *bin_buf, int buf_size);
+extern int str_to_buf(char* str, int len, u8 *bin_buf, int buf_size, int radix);
+extern char* buf_to_str(u8 *buf, int size, int radix);
 
-extern int buf_to_u32_handler(u8 *in_buf, void *priv);
+struct scan_field_s;
+extern int buf_to_u32_handler(u8 *in_buf, void *priv, struct scan_field_s *field);
 
 #define CEIL(m, n)     ((m + n - 1) / n)
 
+/* read a u32 from a buffer in target memory endianness */
+static __inline u32 fast_target_buffer_get_u32(u8 *buffer, int little)
+{
+       if (little)
+               return le_to_h_u32(buffer);
+       else
+               return be_to_h_u32(buffer);
+}
+
+
 #endif /* BINARYBUFFER_H */