aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_strings_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-09-25 22:10:51 +0000
committerChristian Grothoff <christian@grothoff.org>2009-09-25 22:10:51 +0000
commitf1b9c5c115139b02cac1cae4f053792e1e5b1ccb (patch)
treecd9047d73ba498d05f67c7e06ae4bd5ed89511e7 /src/include/gnunet_strings_lib.h
parentc2d3d24cd9b4f552d7ca8ad6283f9819c1cfefc7 (diff)
downloadgnunet-f1b9c5c115139b02cac1cae4f053792e1e5b1ccb.tar.gz
gnunet-f1b9c5c115139b02cac1cae4f053792e1e5b1ccb.zip
improving style and docs
Diffstat (limited to 'src/include/gnunet_strings_lib.h')
-rw-r--r--src/include/gnunet_strings_lib.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h
index ab0f1ad7c..a466074a3 100644
--- a/src/include/gnunet_strings_lib.h
+++ b/src/include/gnunet_strings_lib.h
@@ -52,25 +52,33 @@ extern "C"
52 52
53/** 53/**
54 * Convert a given filesize into a fancy human-readable format. 54 * Convert a given filesize into a fancy human-readable format.
55 *
56 * @param size number of bytes
57 * @return fancy representation of the size (possibly rounded) for humans
55 */ 58 */
56char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size); 59char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size);
57 60
61
58/** 62/**
59 * Convert the len characters long character sequence 63 * Convert the len characters long character sequence
60 * given in input that is in the given charset 64 * given in input that is in the given charset
61 * to UTF-8. 65 * to UTF-8.
62 * 66 *
67 * @param input the input string (not necessarily 0-terminated)
68 * @param len the number of bytes in the input
69 * @param charset character set to convert from
63 * @return the converted string (0-terminated) 70 * @return the converted string (0-terminated)
64 */ 71 */
65char *GNUNET_STRINGS_to_utf8 (const char *input, 72char *GNUNET_STRINGS_to_utf8 (const char *input,
66 size_t len, const char *charset); 73 size_t len, const char *charset);
67 74
75
68/** 76/**
69 * Complete filename (a la shell) from abbrevition. 77 * Complete filename (a la shell) from abbrevition.
70 * 78 *
71 * @param fil the name of the file, may contain ~/ or 79 * @param fil the name of the file, may contain ~/ or
72 * be relative to the current directory 80 * be relative to the current directory
73 * @returns the full file name, 81 * @return the full file name,
74 * NULL is returned on error 82 * NULL is returned on error
75 */ 83 */
76char *GNUNET_STRINGS_filename_expand (const char *fil); 84char *GNUNET_STRINGS_filename_expand (const char *fil);
@@ -87,12 +95,19 @@ char *GNUNET_STRINGS_filename_expand (const char *fil);
87 * used to parse the buffer back into individual 95 * used to parse the buffer back into individual
88 * strings. 96 * strings.
89 * 97 *
98 * @param buffer the buffer to fill with strings, can
99 * be NULL in which case only the necessary
100 * amount of space will be calculated
101 * @param size number of bytes available in buffer
102 * @param count number of strings that follow
103 * @param ... count 0-terminated strings to copy to buffer
90 * @return number of bytes written to the buffer 104 * @return number of bytes written to the buffer
91 * (or number of bytes that would have been written) 105 * (or number of bytes that would have been written)
92 */ 106 */
93unsigned int GNUNET_STRINGS_buffer_fill (char *buffer, 107size_t GNUNET_STRINGS_buffer_fill (char *buffer,
94 unsigned int size, 108 size_t size,
95 unsigned int count, ...); 109 unsigned int count, ...);
110
96 111
97/** 112/**
98 * Given a buffer of a given size, find "count" 113 * Given a buffer of a given size, find "count"
@@ -104,11 +119,12 @@ unsigned int GNUNET_STRINGS_buffer_fill (char *buffer,
104 * @param buffer the buffer to parse 119 * @param buffer the buffer to parse
105 * @param size size of the buffer 120 * @param size size of the buffer
106 * @param count number of strings to locate 121 * @param count number of strings to locate
122 * @param ... pointers to where to store the strings
107 * @return offset of the character after the last 0-termination 123 * @return offset of the character after the last 0-termination
108 * in the buffer, or 0 on error. 124 * in the buffer, or 0 on error.
109 */ 125 */
110unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, 126unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer,
111 unsigned int size, 127 size_t size,
112 unsigned int count, ...); 128 unsigned int count, ...);
113 129
114 130
@@ -131,6 +147,7 @@ char *GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t);
131 */ 147 */
132char *GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative 148char *GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative
133 delta); 149 delta);
150
134#if 0 /* keep Emacsens' auto-indent happy */ 151#if 0 /* keep Emacsens' auto-indent happy */
135{ 152{
136#endif 153#endif