summaryrefslogtreecommitdiff
path: root/src/language.c
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-10 13:54:09 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-10 13:54:09 +0000
commitb15c46d79518feb7a7027069bb99d6054a185e0f (patch)
treeeb52f57972296df2ef9396df47c50e2042f7ddce /src/language.c
parente7a15723172f46d1f0b192fc959c7a649830173d (diff)
Move getstring() and getstring2() from macros to functions. This fixes a bunch of warnings, and means they are actually *readable*, as well as type-safe and const.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1975 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/language.c')
-rw-r--r--src/language.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/language.c b/src/language.c
index 0f5fe8124..a1cf34874 100644
--- a/src/language.c
+++ b/src/language.c
@@ -306,4 +306,29 @@ void syntax_error(char *service, User * u, const char *command, int msgnum)
notice_lang(service, u, MORE_INFO, service, command);
}
+const char *getstring(NickAlias *na, int index)
+{
+ // Default to config
+ int langidx = NSDefLanguage;
+
+ // If they are registered (na->nc), and NOT forbidden
+ if (na->nc && !na->status & NS_FORBIDDEN)
+ langidx = na->nc->language; // set language to their nickcore's language
+
+ return langtexts[langidx][index];
+}
+
+const char *getstring2(NickCore *nc, int index)
+{
+ // Default to config
+ int langidx = NSDefLanguage;
+
+ if (nc)
+ {
+ langidx = nc->language;
+ }
+
+ return langtexts[langidx][index];
+}
+
/*************************************************************************/