core/string: Convert file to C

And convert the unit test while we're at it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-09-08 09:39:35 -04:00
parent 1a3735251d
commit 60678d1ddb
11 changed files with 16 additions and 4 deletions

View File

@ -3,5 +3,5 @@ Import("env")
env.UsePackage("taglib") env.UsePackage("taglib")
res = Glob("*.cpp") + SConscript("tags/Sconscript") res = Glob("*.cpp") + Glob("*.c") + SConscript("tags/Sconscript")
Return("res") Return("res")

View File

@ -4,7 +4,10 @@
#include <core/filter.h> #include <core/filter.h>
#include <core/index.h> #include <core/index.h>
extern "C" {
#include <core/string.h> #include <core/string.h>
}
#include <algorithm> #include <algorithm>

View File

@ -2,7 +2,6 @@
* Copyright 2015 (c) Anna Schumaker. * Copyright 2015 (c) Anna Schumaker.
*/ */
#include <core/string.h> #include <core/string.h>
#include <string.h>
#define O_SECONDS (1) #define O_SECONDS (1)
#define O_MINUTES (60) #define O_MINUTES (60)

View File

@ -1,7 +1,9 @@
/** /**
* Copyright 2014 (c) Anna Schumaker. * Copyright 2014 (c) Anna Schumaker.
*/ */
extern "C" {
#include <core/string.h> #include <core/string.h>
}
#include <core/tags/generic.h> #include <core/tags/generic.h>
GenericTag :: GenericTag() {} GenericTag :: GenericTag() {}

View File

@ -6,7 +6,9 @@
* what options are supported. * what options are supported.
*/ */
#include <core/audio.h> #include <core/audio.h>
extern "C" {
#include <core/string.h> #include <core/string.h>
}
#include <gui/ocarina.h> #include <gui/ocarina.h>
#include <gst/gst.h> #include <gst/gst.h>

View File

@ -5,7 +5,9 @@
* https://git.gnome.org/browse/gtkmm-documentation/tree/examples/others/treemodelcustom * https://git.gnome.org/browse/gtkmm-documentation/tree/examples/others/treemodelcustom
*/ */
#include <core/audio.h> #include <core/audio.h>
extern "C" {
#include <core/string.h> #include <core/string.h>
}
#include <gui/queue/model.h> #include <gui/queue/model.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -3,7 +3,9 @@
*/ */
#include <core/deck.h> #include <core/deck.h>
#include <core/playlist.h> #include <core/playlist.h>
extern "C" {
#include <core/string.h> #include <core/string.h>
}
#include <gui/tabs.h> #include <gui/tabs.h>
#include <map> #include <map>

View File

@ -7,6 +7,7 @@
#include <core/file.h> #include <core/file.h>
#include <map> #include <map>
#include <string>
#include <vector> #include <vector>
template<class T> class Database; template<class T> class Database;

View File

@ -8,6 +8,7 @@
#define OCARINA_CORE_STRING_H #define OCARINA_CORE_STRING_H
#include <glib.h> #include <glib.h>
#include <string.h>
/* Convert number of seconds into a string with format mm:ss. */ /* Convert number of seconds into a string with format mm:ss. */

View File

@ -14,7 +14,7 @@ Export("core_objs")
res = [ CoreTest("version", "version.c") ] res = [ CoreTest("version", "version.c") ]
res += [ CoreTest("string", "string.cpp") ] res += [ CoreTest("string", "string.c") ]
res += [ CoreTest("random", "random.cpp") ] res += [ CoreTest("random", "random.cpp") ]
res += [ CoreTest("file", "file.cpp") ] res += [ CoreTest("file", "file.cpp") ]
res += [ CoreTest("database", "database.cpp") ] res += [ CoreTest("database", "database.cpp") ]

View File

@ -3,7 +3,7 @@
* Test the string formatting functions. * Test the string formatting functions.
*/ */
#include <core/string.h> #include <core/string.h>
#include "test.h" #include <tests/test.h>
static char buf[25]; static char buf[25];