summaryrefslogtreecommitdiffstats
path: root/membuffer.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-09-02 20:52:34 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-30 10:36:48 -0700
commit4c0156e3d51b389db8eccc3fa3da4b8f248f9b13 (patch)
tree966868d29150fdba13a5a56fb4305bc432ec7a72 /membuffer.h
parenta0798214231c652ac6142228f5ddfc4b65c921f8 (diff)
downloadsubsurface-4c0156e3d51b389db8eccc3fa3da4b8f248f9b13.tar.gz
Move all core-functionality to subsurface-core
And adapt a new CMakeLists.txt file for it. On the way I've also found out that we where double-compilling a few files. I've also set the subsurface-core as a include_path but that was just to reduce the noise on this commit, since I plan to remove it from the include path to make it obligatory to specify something like include "subsurface-core/dive.h" for the header files. Since the app is growing quite a bit we ended up having a few different files with almost same name that did similar things, I want to kill that (for instance Dive.h, dive.h, PrintDive.h and such). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'membuffer.h')
-rw-r--r--membuffer.h74
1 files changed, 0 insertions, 74 deletions
diff --git a/membuffer.h b/membuffer.h
deleted file mode 100644
index 434b34c71..000000000
--- a/membuffer.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef MEMBUFFER_H
-#define MEMBUFFER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <ctype.h>
-
-struct membuffer {
- unsigned int len, alloc;
- char *buffer;
-};
-
-#ifdef __GNUC__
-#define __printf(x, y) __attribute__((__format__(__printf__, x, y)))
-#else
-#define __printf(x, y)
-#endif
-
-extern char *detach_buffer(struct membuffer *b);
-extern void free_buffer(struct membuffer *);
-extern void flush_buffer(struct membuffer *, FILE *);
-extern void put_bytes(struct membuffer *, const char *, int);
-extern void put_string(struct membuffer *, const char *);
-extern void put_quoted(struct membuffer *, const char *, int, int);
-extern void strip_mb(struct membuffer *);
-extern const char *mb_cstring(struct membuffer *);
-extern __printf(2, 0) void put_vformat(struct membuffer *, const char *, va_list);
-extern __printf(2, 3) void put_format(struct membuffer *, const char *fmt, ...);
-extern __printf(2, 0) char *add_to_string_va(const char *old, const char *fmt, va_list args);
-extern __printf(2, 3) char *add_to_string(const char *old, const char *fmt, ...);
-
-/* Helpers that use membuffers internally */
-extern __printf(1, 0) char *vformat_string(const char *, va_list);
-extern __printf(1, 2) char *format_string(const char *, ...);
-
-
-/* Output one of our "milli" values with type and pre/post data */
-extern void put_milli(struct membuffer *, const char *, int, const char *);
-
-/*
- * Helper functions for showing particular types. If the type
- * is empty, nothing is done, and the function returns false.
- * Otherwise, it returns true.
- *
- * The two "const char *" at the end are pre/post data.
- *
- * The reason for the pre/post data is so that you can easily
- * prepend and append a string without having to test whether the
- * type is empty. So
- *
- * put_temperature(b, temp, "Temp=", " C\n");
- *
- * writes nothing to the buffer if there is no temperature data,
- * but otherwise would a string that looks something like
- *
- * "Temp=28.1 C\n"
- *
- * to the memory buffer (typically the post/pre will be some XML
- * pattern and unit string or whatever).
- */
-extern void put_temperature(struct membuffer *, temperature_t, const char *, const char *);
-extern void put_depth(struct membuffer *, depth_t, const char *, const char *);
-extern void put_duration(struct membuffer *, duration_t, const char *, const char *);
-extern void put_pressure(struct membuffer *, pressure_t, const char *, const char *);
-extern void put_salinity(struct membuffer *, int, const char *, const char *);
-extern void put_degrees(struct membuffer *b, degrees_t value, const char *, const char *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif