summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar/paskha.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-05-10 17:32:06 +0000
committerache <ache@FreeBSD.org>1996-05-10 17:32:06 +0000
commitdf58ec580d62b91cdd59aa7806163c0bb3e9fa8e (patch)
tree35650da73c5ea4db017c33335e7f268ed8fdb6bf /usr.bin/calendar/paskha.c
parent02fead7e055f8da6555c29a488d8a0b2569cf17c (diff)
downloadFreeBSD-src-df58ec580d62b91cdd59aa7806163c0bb3e9fa8e.zip
FreeBSD-src-df58ec580d62b91cdd59aa7806163c0bb3e9fa8e.tar.gz
Allow to configure national Easter names.
Speedup my national months/days handling code.
Diffstat (limited to 'usr.bin/calendar/paskha.c')
-rw-r--r--usr.bin/calendar/paskha.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/usr.bin/calendar/paskha.c b/usr.bin/calendar/paskha.c
index 3fa8a31..28eb8c0 100644
--- a/usr.bin/calendar/paskha.c
+++ b/usr.bin/calendar/paskha.c
@@ -26,16 +26,13 @@
#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
+
+#include "calendar.h"
#define PASKHA "paskha"
#define PASKHALEN (sizeof(PASKHA) - 1)
-/* KOI8-R encoding, needed to fully handle Russian case */
-#define PASKHA1 "пасха"
-#define PASKHALEN1 (sizeof(PASKHA1) - 1)
-
-extern int *cumdays;
-
/* return year day for Orthodox Easter using Gauss formula */
/* (old style result) */
@@ -46,6 +43,7 @@ int R; /*year*/
int a, b, c, d, e;
static int x = 15;
static int y = 6;
+ extern int *cumdays;
a = R % 19;
b = R % 4;
@@ -63,11 +61,14 @@ getpaskha(s, year)
int year;
{
int offset;
+ extern struct fixs npaskha;
if (strncasecmp(s, PASKHA, PASKHALEN) == 0)
s += PASKHALEN;
- else if (strncasecmp(s, PASKHA1, PASKHALEN1) == 0)
- s += PASKHALEN1;
+ else if ( npaskha.name != NULL
+ && strncasecmp(s, npaskha.name, npaskha.len) == 0
+ )
+ s += npaskha.len;
else
return 0;
OpenPOWER on IntegriCloud