summaryrefslogtreecommitdiff
path: root/firmware/export
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
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')
-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 @@
24 24
25#include <stdbool.h> 25#include <stdbool.h>
26#include <stddef.h> 26#include <stddef.h>
27#include "config.h"
27 28
29#if CONFIG_CODEC == SWCODEC
28/* round a signed/unsigned 32bit value to the closest of a list of values */ 30/* round a signed/unsigned 32bit value to the closest of a list of values */
29/* returns the index of the closest value */ 31/* returns the index of the closest value */
30int round_value_to_list32(unsigned long value, 32int round_value_to_list32(unsigned long value,
@@ -36,5 +38,38 @@ int make_list_from_caps32(unsigned long src_mask,
36 const unsigned long *src_list, 38 const unsigned long *src_list,
37 unsigned long caps_mask, 39 unsigned long caps_mask,
38 unsigned long *caps_list); 40 unsigned long *caps_list);
41#endif /* CONFIG_CODEC == SWCODEC */
42
43/* Create a filename with a number part in a way that the number is 1
44 * higher than the highest numbered file matching the same pattern.
45 * It is allowed that buffer and path point to the same memory location,
46 * saving a strcpy(). Path must always be given without trailing slash.
47 *
48 * "num" can point to an int specifying the number to use or NULL or a value
49 * less than zero to number automatically. The final number used will also
50 * be returned in *num. If *num is >= 0 then *num will be incremented by
51 * one. */
52#if defined(HAVE_RECORDING) && (CONFIG_RTC == 0)
53/* this feature is needed by recording without a RTC to prevent disk access
54 when changing files */
55#define IF_CNFN_NUM_(...) __VA_ARGS__
56#define IF_CNFN_NUM
57#else
58#define IF_CNFN_NUM_(...)
59#endif
60char *create_numbered_filename(char *buffer, const char *path,
61 const char *prefix, const char *suffix,
62 int numberlen IF_CNFN_NUM_(, int *num));
63
64#if CONFIG_RTC
65/* Create a filename with a date+time part.
66 It is allowed that buffer and path point to the same memory location,
67 saving a strcpy(). Path must always be given without trailing slash.
68 unique_time as true makes the function wait until the current time has
69 changed. */
70char *create_datetime_filename(char *buffer, const char *path,
71 const char *prefix, const char *suffix,
72 bool unique_time);
73#endif /* CONFIG_RTC */
39 74
40#endif /* GENERAL_H */ 75#endif /* GENERAL_H */