java: new helper library for the Android port

This commit is contained in:
Max Kellermann
2014-03-01 09:19:32 +01:00
parent c73771e3ce
commit 1e06c66c77
15 changed files with 735 additions and 1 deletions

View File

@@ -22,6 +22,8 @@
#include "Compiler.h"
#include <stddef.h>
/**
* Returns a pointer to the first non-whitespace character in the
* string, or to the end of the string.
@@ -55,6 +57,18 @@ gcc_pure
bool
StringEndsWith(const char *haystack, const char *needle);
/**
* Copy a string. If the buffer is too small, then the string is
* truncated. This is a safer version of strncpy().
*
* @param size the size of the destination buffer (including the null
* terminator)
* @return a pointer to the null terminator
*/
gcc_nonnull_all
char *
CopyString(char *dest, const char *src, size_t size);
/**
* Checks whether a string array contains the specified string.
*