2015-09-08 09:14:39 -04:00
|
|
|
/*
|
2015-01-26 09:40:48 -05:00
|
|
|
* Copyright 2015 (c) Anna Schumaker.
|
2015-09-08 09:14:39 -04:00
|
|
|
*
|
|
|
|
* NOTE: All of these functions allocate and return a new string. It is the
|
|
|
|
* caller's responsibility to free these strings by calling g_free().
|
2015-01-26 09:40:48 -05:00
|
|
|
*/
|
|
|
|
#ifndef OCARINA_CORE_STRING_H
|
|
|
|
#define OCARINA_CORE_STRING_H
|
|
|
|
|
2015-09-02 08:02:41 -04:00
|
|
|
#include <glib.h>
|
2015-09-08 09:39:35 -04:00
|
|
|
#include <string.h>
|
2015-01-26 09:40:48 -05:00
|
|
|
|
|
|
|
|
2015-09-08 09:14:39 -04:00
|
|
|
/* Convert number of seconds into a string with format mm:ss. */
|
2015-09-02 08:02:41 -04:00
|
|
|
gchar *string_sec2str(unsigned int);
|
|
|
|
|
2015-09-08 09:14:39 -04:00
|
|
|
/* Convert number of seconds into a long-form time string. */
|
2015-09-03 09:31:48 -04:00
|
|
|
gchar *string_sec2str_long(unsigned int);
|
|
|
|
|
2015-09-08 09:14:39 -04:00
|
|
|
/* Convert the input string to lowercase, dropping special characters. */
|
|
|
|
gchar *string_lowercase(const gchar *);
|
|
|
|
|
2015-09-24 13:57:42 -04:00
|
|
|
/*
|
|
|
|
* Compare two strings.
|
|
|
|
*
|
|
|
|
* if ret < 0: lhs < rhs, or rhs is empty.
|
|
|
|
* if ret = 0: lhs == rhs.
|
|
|
|
* if ret > 0: lhs > rhs, or lhs is empty.
|
|
|
|
*/
|
|
|
|
int string_compare(const gchar *, const gchar *);
|
|
|
|
|
2015-01-26 09:40:48 -05:00
|
|
|
#endif /* OCARINA_CORE_STRING_H */
|