summaryrefslogtreecommitdiffstats
path: root/firmware/export/general.h
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-02-10 23:43:37 +0000
committerJens Arnold <amiconn@rockbox.org>2009-02-10 23:43:37 +0000
commit11ad7b4bc8bcb049040c02fae04074faf5dfaf27 (patch)
treece92c57120cb9b019743a863083f654e8d80f95f /firmware/export/general.h
parenteddb5680f9aefecdaccf24279cff2d3cf4fd5d86 (diff)
downloadrockbox-11ad7b4bc8bcb049040c02fae04074faf5dfaf27.tar.gz
rockbox-11ad7b4bc8bcb049040c02fae04074faf5dfaf27.zip
Move screendump from apps to firmware, solving two nasty firmware-to-apps calls. This required to move the filename creation functions as well. * Fix bug in the BMP header of Clip screendumps. * Add remote screendump for targets with an LCD remote. * Simplify some ifdefs and rename a macro in the sim.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19967 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/general.h')
-rw-r--r--firmware/export/general.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/firmware/export/general.h b/firmware/export/general.h
index d1bd14558c..8da4a0ad59 100644
--- a/firmware/export/general.h
+++ b/firmware/export/general.h
@@ -24,7 +24,9 @@
#include <stdbool.h>
#include <stddef.h>
+#include "config.h"
+#if CONFIG_CODEC == SWCODEC
/* round a signed/unsigned 32bit value to the closest of a list of values */
/* returns the index of the closest value */
int round_value_to_list32(unsigned long value,
@@ -36,5 +38,38 @@ int make_list_from_caps32(unsigned long src_mask,
const unsigned long *src_list,
unsigned long caps_mask,
unsigned long *caps_list);
+#endif /* CONFIG_CODEC == SWCODEC */
+
+/* Create a filename with a number part in a way that the number is 1
+ * higher than the highest numbered file matching the same pattern.
+ * It is allowed that buffer and path point to the same memory location,
+ * saving a strcpy(). Path must always be given without trailing slash.
+ *
+ * "num" can point to an int specifying the number to use or NULL or a value
+ * less than zero to number automatically. The final number used will also
+ * be returned in *num. If *num is >= 0 then *num will be incremented by
+ * one. */
+#if defined(HAVE_RECORDING) && (CONFIG_RTC == 0)
+/* this feature is needed by recording without a RTC to prevent disk access
+ when changing files */
+#define IF_CNFN_NUM_(...) __VA_ARGS__
+#define IF_CNFN_NUM
+#else
+#define IF_CNFN_NUM_(...)
+#endif
+char *create_numbered_filename(char *buffer, const char *path,
+ const char *prefix, const char *suffix,
+ int numberlen IF_CNFN_NUM_(, int *num));
+
+#if CONFIG_RTC
+/* Create a filename with a date+time part.
+ It is allowed that buffer and path point to the same memory location,
+ saving a strcpy(). Path must always be given without trailing slash.
+ unique_time as true makes the function wait until the current time has
+ changed. */
+char *create_datetime_filename(char *buffer, const char *path,
+ const char *prefix, const char *suffix,
+ bool unique_time);
+#endif /* CONFIG_RTC */
#endif /* GENERAL_H */