mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
ee5dd2cf32
As inauguration, move G_AddGroup, G_AddPath and struct strllist there. The header is located in build/include, because in the future, code that resides closer to (but is not strictly part of) the engine might need to be factored into here. The source file, however, is in the source/ directory. git-svn-id: https://svn.eduke32.com/eduke32@2542 1a8010ca-5511-0410-912e-c29ae57300e0
48 lines
874 B
C
48 lines
874 B
C
//
|
|
// Common non-engine code/data for EDuke32 and Mapster32
|
|
//
|
|
|
|
#include "compat.h"
|
|
|
|
#include "common.h"
|
|
|
|
|
|
struct strllist *CommandPaths, *CommandGrps;
|
|
|
|
void G_AddGroup(const char *buffer)
|
|
{
|
|
char buf[BMAX_PATH];
|
|
|
|
struct strllist *s = Bcalloc(1,sizeof(struct strllist));
|
|
|
|
Bstrcpy(buf, buffer);
|
|
|
|
if (Bstrchr(buf,'.') == 0)
|
|
Bstrcat(buf,".grp");
|
|
|
|
s->str = Bstrdup(buf);
|
|
|
|
if (CommandGrps)
|
|
{
|
|
struct strllist *t;
|
|
for (t = CommandGrps; t->next; t=t->next) ;
|
|
t->next = s;
|
|
return;
|
|
}
|
|
CommandGrps = s;
|
|
}
|
|
|
|
void G_AddPath(const char *buffer)
|
|
{
|
|
struct strllist *s = Bcalloc(1,sizeof(struct strllist));
|
|
s->str = Bstrdup(buffer);
|
|
|
|
if (CommandPaths)
|
|
{
|
|
struct strllist *t;
|
|
for (t = CommandPaths; t->next; t=t->next) ;
|
|
t->next = s;
|
|
return;
|
|
}
|
|
CommandPaths = s;
|
|
}
|