1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtcm: make it build

This commit is contained in:
Jon Trulson 2019-11-20 15:33:17 -07:00
parent 763cac54e4
commit 444aa700c0
7 changed files with 115 additions and 132 deletions

View file

@ -410,6 +410,12 @@ programs/dtspcd/Makefile
programs/dtscreen/Makefile programs/dtscreen/Makefile
programs/dtcm/Makefile
programs/dtcm/libDtCmP/Makefile
programs/dtcm/server/Makefile
programs/dtcm/dtcm/Makefile
]) ])
AC_OUTPUT AC_OUTPUT

View file

@ -1,3 +1,3 @@
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = libDtCmpP dtcm server SUBDIRS = libDtCmP dtcm server

View file

@ -2,29 +2,21 @@ MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = dtcm dtcm_delete dtcm_insert dtcm_lookup dtcm_editor bin_PROGRAMS = dtcm dtcm_delete dtcm_insert dtcm_lookup dtcm_editor
AM_CFLAGS = -I../../../lib/csa -I../libDtCmP -I../../dthelp $(TIRPCINC) AM_CFLAGS = $(DT_INCDIR) $(CSA_INCDIR) -I../../../lib/csa \
-I../libDtCmP $(TIRPCINC)
AM_LDADD = ../libDtCmP/libDtCmP.a $(LIBCSA) $(LIBPRINT) $(LIBHELP) \ LDADD = ../libDtCmP/libDtCmP.a $(LIBCSA) $(DTCLIENTLIBS) $(XTOOLLIB)
$(LIBWIDGET) $(LIBSVC) $(LIBTT) -lXm $(XTOOLLIB) ${X_LIBS}
if SOLARIS if SOLARIS
AM_CFLAGS += -xstrconst -Xc -v AM_CFLAGS += -xstrconst -Xc -v
endif endif
if HPUX
AM_LDADD += -lrpcsvc -lV3
endif
if AIX
AM_LDADD += -lrpcsvc -lPW -ldiag
endif
if FREEBSD if FREEBSD
AM_LDADD += -lcompat LDADD += -lcompat
endif endif
if NETBSD if NETBSD
AM_LDADD += -lcompat LDADD += -lcompat
endif endif
dtcm_SOURCES = MonthPanel.c RFCMIME.c about.c \ dtcm_SOURCES = MonthPanel.c RFCMIME.c about.c \

View file

@ -1,22 +1,21 @@
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = y.tab.c getdate.c
noinst_LIBRARIES = libDtCmP.a noinst_LIBRARIES = libDtCmP.a
libDtCmP_a_CFLAGS = -I../../../lib/csa -DRFC_MIME -DLINE_COUNT -DV2 -DOW_I18N \ libDtCmP_a_CFLAGS = $(CSA_INCDIR) -I../../../lib/csa -DRFC_MIME \
$(TIRPCINC) -DLINE_COUNT -DV2 -DOW_I18N $(TIRPCINC)
if SOLARIS if SOLARIS
libDtCmP_a_CFLAGS += -xstrconst -Xc -v libDtCmP_a_CFLAGS += -xstrconst -Xc -v
endif endif
libDtCmP_a_SOURCES = cm_tty.c cmfns.c dtfns.c \ libDtCmP_a_SOURCES = cm_tty.c cmfns.c dtfns.c props.c resource.c \
getdate.c props.c resource.c \ timeops.c util.c getdate.y
timeops.c util.c
all:: getdate.c # This is strange - ususally you generate a .h and a .c. But CDE
# comes with getdate.h, and you cannot generate it via yacc/lex. So -
getdate.c: getdate.y # someday this should be redone properly... see
$(YACC) getdate.y # https://opensource.apple.com/source/shell_cmds/shell_cmds-198/find/getdate.y.auto.html
$(MV) y.tab.c getdate.c # for what seems like a more recent version...
BUILT_SOURCES = getdate.c
CLEANFILES = $(BUILT_SOURCES)

View file

@ -130,7 +130,7 @@ char *hours[24] = {
* Given a weekmask and the first day of the week, calculate * Given a weekmask and the first day of the week, calculate
* the number of times outstanding in the week. * the number of times outstanding in the week.
*/ */
extern int int
ntimes_this_week(u_int weekmask, int firstday) ntimes_this_week(u_int weekmask, int firstday)
{ {
int i, ntimes, weekdaymask = 1 << firstday; int i, ntimes, weekdaymask = 1 << firstday;
@ -146,21 +146,21 @@ ntimes_this_week(u_int weekmask, int firstday)
} }
/* Return beginning of time */ /* Return beginning of time */
extern Tick Tick
get_bot(void) get_bot(void)
{ {
return bot; return bot;
} }
/* Return end of time */ /* Return end of time */
extern Tick Tick
get_eot(void) get_eot(void)
{ {
return eot; return eot;
} }
/* Given a weekmask, find the last appointment in the week */ /* Given a weekmask, find the last appointment in the week */
extern int int
lastapptofweek(u_int mask) lastapptofweek(u_int mask)
{ {
int n; int n;
@ -174,7 +174,7 @@ lastapptofweek(u_int mask)
} }
/* Remove after v3 release */ /* Remove after v3 release */
extern boolean_t boolean_t
magic_time(Tick t) magic_time(Tick t)
{ {
boolean_t magic=B_FALSE; boolean_t magic=B_FALSE;
@ -188,7 +188,7 @@ magic_time(Tick t)
return(magic); return(magic);
} }
/* for 12 hour clock, if 24 subtract 12 */ /* for 12 hour clock, if 24 subtract 12 */
extern boolean_t boolean_t
adjust_hour(int *hr) adjust_hour(int *hr)
{ {
boolean_t am = B_TRUE; boolean_t am = B_TRUE;
@ -204,7 +204,7 @@ adjust_hour(int *hr)
} }
extern int int
timeok( Tick t) timeok( Tick t)
{ {
int r =((t >= bot) &&(t <= eot)); int r =((t >= bot) &&(t <= eot));
@ -232,19 +232,19 @@ dst_changed(Tick old, Tick new)
} }
} }
extern int int
seconds(int n, Unit unit) seconds(int n, Unit unit)
{ {
return(n *(int)unit); return(n *(int)unit);
} }
extern double double
seconds_dble(double n, Unit unit) seconds_dble(double n, Unit unit)
{ {
return((double)(n * (int)unit)); return((double)(n * (int)unit));
} }
extern int int
year(Tick t) year(Tick t)
{ {
struct tm *tm; struct tm *tm;
@ -254,7 +254,7 @@ year(Tick t)
return(tm->tm_year + 1900); return(tm->tm_year + 1900);
} }
extern int int
month(Tick t) month(Tick t)
{ {
struct tm *tm; struct tm *tm;
@ -264,7 +264,7 @@ month(Tick t)
return(tm->tm_mon+1); return(tm->tm_mon+1);
} }
extern int int
hour(Tick t) hour(Tick t)
{ {
struct tm *tm; struct tm *tm;
@ -274,7 +274,7 @@ hour(Tick t)
return(tm->tm_hour); return(tm->tm_hour);
} }
extern int int
minute(Tick t) minute(Tick t)
{ {
struct tm *tm; struct tm *tm;
@ -284,14 +284,14 @@ minute(Tick t)
return(tm->tm_min); return(tm->tm_min);
} }
extern int int
leapyr(int y) leapyr(int y)
{ {
return return
(y % 4 == 0 && y % 100 !=0 || y % 400 == 0); (y % 4 == 0 && y % 100 !=0 || y % 400 == 0);
} }
extern int int
monthlength(Tick t) monthlength(Tick t)
{ {
int mon; int mon;
@ -303,7 +303,7 @@ monthlength(Tick t)
return(((mon==1) && leapyr(tm.tm_year+1900))? 29 : monthdays[mon]); return(((mon==1) && leapyr(tm.tm_year+1900))? 29 : monthdays[mon]);
} }
extern int int
monthseconds(Tick t) monthseconds(Tick t)
{ {
int mon; int mon;
@ -315,7 +315,7 @@ monthseconds(Tick t)
return(((mon==1) && leapyr(tm.tm_year+1900))? 29*daysec : monthsecs[mon]); return(((mon==1) && leapyr(tm.tm_year+1900))? 29*daysec : monthsecs[mon]);
} }
extern int int
dom(Tick t) dom(Tick t)
{ {
struct tm *tm; struct tm *tm;
@ -325,7 +325,7 @@ dom(Tick t)
return(tm->tm_mday); return(tm->tm_mday);
} }
extern int int
wom(Tick t) wom(Tick t)
{ {
struct tm *tm; struct tm *tm;
@ -365,13 +365,13 @@ next_nmonth(Tick t, int n)
return(mktime(&tm)); return(mktime(&tm));
} }
extern Tick Tick
nextmonth(Tick t) nextmonth(Tick t)
{ {
return(next_nmonth(t, 1)); return(next_nmonth(t, 1));
} }
extern boolean_t boolean_t
weekofmonth(Tick t, int *wk) weekofmonth(Tick t, int *wk)
{ {
struct tm tm, tm1, tm2; struct tm tm, tm1, tm2;
@ -403,7 +403,7 @@ weekofmonth(Tick t, int *wk)
} }
} }
extern int int
dow(Tick t) dow(Tick t)
{ {
struct tm tm; struct tm tm;
@ -413,7 +413,7 @@ dow(Tick t)
return(tm.tm_wday); return(tm.tm_wday);
} }
extern int /* find dow(0-6) that 1st dom falls on */ int /* find dow(0-6) that 1st dom falls on */
fdom(Tick t) fdom(Tick t)
{ {
struct tm tm; struct tm tm;
@ -427,7 +427,7 @@ fdom(Tick t)
return(tm.tm_wday); return(tm.tm_wday);
} }
extern int int
ldom(Tick t /* find dow(0-6) that last dom falls on */ ) ldom(Tick t /* find dow(0-6) that last dom falls on */ )
{ {
struct tm tm; struct tm tm;
@ -442,21 +442,21 @@ ldom(Tick t /* find dow(0-6) that last dom falls on */ )
} }
/* returns tick of last day of month */ /* returns tick of last day of month */
extern Tick Tick
last_dom(Tick tick) last_dom(Tick tick)
{ {
return(upperbound(next_ndays(tick, monthlength(tick) - dom(tick)))); return(upperbound(next_ndays(tick, monthlength(tick) - dom(tick))));
} }
/* returns tick of first day of month */ /* returns tick of first day of month */
extern Tick Tick
first_dom(Tick tick) first_dom(Tick tick)
{ {
return(lowerbound(last_ndays(tick, dom(tick)-1))); return(lowerbound(last_ndays(tick, dom(tick)-1)));
} }
/* returns tick of first day of week */ /* returns tick of first day of week */
extern Tick Tick
first_dow(Tick tick) first_dow(Tick tick)
{ {
int d; int d;
@ -470,7 +470,7 @@ first_dow(Tick tick)
} }
/* returns tick of first day of week */ /* returns tick of first day of week */
extern Tick Tick
last_dow(Tick tick) last_dow(Tick tick)
{ {
int d; int d;
@ -484,13 +484,13 @@ last_dow(Tick tick)
return(upperbound(next_ndays(tick, d))); return(upperbound(next_ndays(tick, d)));
} }
/* returns number of weeks in month */ /* returns number of weeks in month */
extern int int
numwks(Tick tick) numwks(Tick tick)
{ {
return (wom(last_dom(tick))); return (wom(last_dom(tick)));
} }
extern int int
adjust_dst(Tick start, Tick next) adjust_dst(Tick start, Tick next)
{ {
DSTchange change; DSTchange change;
@ -508,7 +508,7 @@ adjust_dst(Tick start, Tick next)
return(next); return(next);
} }
extern Tick Tick
next_nhours(Tick t, int n) next_nhours(Tick t, int n)
{ {
Tick next; Tick next;
@ -525,7 +525,7 @@ next_nhours(Tick t, int n)
return(next); return(next);
} }
extern Tick Tick
last_ndays(Tick t, int n) last_ndays(Tick t, int n)
{ {
Tick last; Tick last;
@ -543,7 +543,7 @@ last_ndays(Tick t, int n)
return(last); return(last);
} }
extern Tick Tick
next_ndays(Tick t, int n) next_ndays(Tick t, int n)
{ {
Tick next; Tick next;
@ -565,7 +565,7 @@ next_ndays(Tick t, int n)
return(next); return(next);
} }
extern Tick Tick
nextday(Tick t) nextday(Tick t)
{ {
Tick next; Tick next;
@ -575,7 +575,7 @@ nextday(Tick t)
return(next); return(next);
} }
extern Tick Tick
prevday(Tick t) prevday(Tick t)
{ {
Tick prev; Tick prev;
@ -585,7 +585,7 @@ prevday(Tick t)
return(prev); return(prev);
} }
extern Tick Tick
nextweek(Tick t) nextweek(Tick t)
{ {
Tick next; Tick next;
@ -595,7 +595,7 @@ nextweek(Tick t)
return(next); return(next);
} }
extern Tick Tick
prevweek(Tick t) prevweek(Tick t)
{ {
Tick prev; Tick prev;
@ -605,7 +605,7 @@ prevweek(Tick t)
return(prev); return(prev);
} }
extern Tick Tick
next2weeks(Tick t) next2weeks(Tick t)
{ {
Tick next; Tick next;
@ -615,7 +615,7 @@ next2weeks(Tick t)
return(next); return(next);
} }
extern Tick Tick
prev2weeks(Tick t) prev2weeks(Tick t)
{ {
Tick prev; Tick prev;
@ -626,7 +626,7 @@ prev2weeks(Tick t)
} }
/* WORK OUT A BETTER WAY TO DO THIS!! */ /* WORK OUT A BETTER WAY TO DO THIS!! */
extern Tick Tick
prevmonth_exactday(Tick t) prevmonth_exactday(Tick t)
{ {
Tick prev; int day; Tick prev; int day;
@ -660,7 +660,7 @@ prevmonth_exactday(Tick t)
} }
/* WORK OUT A BETTER WAY TO DO THIS!! */ /* WORK OUT A BETTER WAY TO DO THIS!! */
extern Tick Tick
nextmonth_exactday(Tick t) nextmonth_exactday(Tick t)
{ {
Tick next; int day; Tick next; int day;
@ -692,7 +692,7 @@ nextmonth_exactday(Tick t)
return(next); return(next);
} }
extern Tick Tick
nextnyear(Tick t, int n) nextnyear(Tick t, int n)
{ {
struct tm tm; struct tm tm;
@ -707,13 +707,13 @@ nextnyear(Tick t, int n)
#endif /* SVR4 */ #endif /* SVR4 */
} }
extern Tick Tick
nextyear(Tick t) nextyear(Tick t)
{ {
return(nextnyear(t, 1)); return(nextnyear(t, 1));
} }
extern Tick Tick
prevnday_exacttime(Tick t, int n) prevnday_exacttime(Tick t, int n)
{ {
Tick prev; Tick prev;
@ -723,7 +723,7 @@ prevnday_exacttime(Tick t, int n)
return(prev); return(prev);
} }
extern Tick Tick
prevnyear(Tick t, int n) prevnyear(Tick t, int n)
{ {
struct tm tm; struct tm tm;
@ -738,13 +738,13 @@ prevnyear(Tick t, int n)
#endif /* SVR4 */ #endif /* SVR4 */
} }
extern Tick Tick
prevyear(Tick t) prevyear(Tick t)
{ {
return(prevnyear(t, 1)); return(prevnyear(t, 1));
} }
extern Tick Tick
previousmonth(Tick t) previousmonth(Tick t)
{ {
struct tm tm; struct tm tm;
@ -771,7 +771,7 @@ previousmonth(Tick t)
#endif /* SVR4 */ #endif /* SVR4 */
} }
extern Tick Tick
prev_nmonth(Tick t, int n) prev_nmonth(Tick t, int n)
{ {
struct tm tm; struct tm tm;
@ -801,7 +801,7 @@ prev_nmonth(Tick t, int n)
#endif /* SVR4 */ #endif /* SVR4 */
} }
extern Tick Tick
jan1(Tick t) jan1(Tick t)
{ {
struct tm tm; struct tm tm;
@ -818,7 +818,7 @@ jan1(Tick t)
#endif /* SVR4 */ #endif /* SVR4 */
} }
extern Tick Tick
nextjan1(Tick t) nextjan1(Tick t)
{ {
struct tm tm; struct tm tm;
@ -836,7 +836,7 @@ nextjan1(Tick t)
#endif /* SVR4 */ #endif /* SVR4 */
} }
extern Tick Tick
lastjan1(Tick t) lastjan1(Tick t)
{ {
struct tm tm; struct tm tm;
@ -854,7 +854,7 @@ lastjan1(Tick t)
#endif /* SVR4 */ #endif /* SVR4 */
} }
extern Tick Tick
lowerbound(Tick t) lowerbound(Tick t)
{ {
struct tm tm; struct tm tm;
@ -871,7 +871,7 @@ lowerbound(Tick t)
return(timelocal(&tm)); return(timelocal(&tm));
#endif /* SVR4 */ #endif /* SVR4 */
} }
extern Tick Tick
lower_bound(int i, Tick t) lower_bound(int i, Tick t)
{ {
struct tm tm; struct tm tm;
@ -888,7 +888,7 @@ lower_bound(int i, Tick t)
return (timelocal(&tm)); return (timelocal(&tm));
#endif /* SVR4 */ #endif /* SVR4 */
} }
extern Tick Tick
upperbound(Tick t) upperbound(Tick t)
{ {
struct tm tm; struct tm tm;
@ -912,7 +912,7 @@ leapsB4(int y)
return((y-1)/4 -(y-1)/100 +(y-1)/400); return((y-1)/4 -(y-1)/100 +(y-1)/400);
} }
extern Tick Tick
xytoclock(int x, int y, Tick t) xytoclock(int x, int y, Tick t)
{ {
int dd, mn, yr, ly, leaps; int dd, mn, yr, ly, leaps;
@ -943,13 +943,13 @@ xytoclock(int x, int y, Tick t)
return(tick); return(tick);
} }
extern Tick Tick
now(void) now(void)
{ {
return(time(0)); return(time(0));
} }
extern void void
set_timezone(char *tzname) set_timezone(char *tzname)
{ {
static char tzenv[MAXPATHLEN]; static char tzenv[MAXPATHLEN];
@ -970,7 +970,7 @@ set_timezone(char *tzname)
} }
} }
extern long long
gmt_off(void) gmt_off(void)
{ {
struct tm tm; struct tm tm;
@ -999,7 +999,7 @@ gmt_off(void)
* definitions of eot and EOT need to be changed as well as some * definitions of eot and EOT need to be changed as well as some
* of the routines in this file and the caller of these routines. * of the routines in this file and the caller of these routines.
*/ */
extern void void
init_time(void) init_time(void)
{ {
struct tm tm, gm; struct tm tm, gm;
@ -1035,57 +1035,57 @@ init_time(void)
eot =mktime(&tm); eot =mktime(&tm);
} }
extern int int
seconds_to_hours(int n) seconds_to_hours(int n)
{ {
return(n/(int)hrsec); return(n/(int)hrsec);
} }
extern int int
hours_to_seconds(int n) hours_to_seconds(int n)
{ {
return(n *(int)hrsec); return(n *(int)hrsec);
} }
extern int int
seconds_to_minutes(int n) seconds_to_minutes(int n)
{ {
return(n/60); return(n/60);
} }
extern int int
minutes_to_seconds(int n) minutes_to_seconds(int n)
{ {
return(n *(int)minsec); return(n *(int)minsec);
} }
extern int int
days_to_seconds(int n) days_to_seconds(int n)
{ {
return(n *(int)daysec); return(n *(int)daysec);
} }
seconds_to_days(int n) int seconds_to_days(int n)
{ {
return(n/(int)daysec); return(n/(int)daysec);
} }
/* /*
extern int int
weeks_to_seconds(int n) weeks_to_seconds(int n)
{ {
return(n *(int)wksec); return(n *(int)wksec);
} }
extern int int
seconds_to_weeks(int) seconds_to_weeks(int)
{ {
return(n/(int)wksec); return(n/(int)wksec);
} }
*/ */
extern Tick Tick
monthdayyear(int m, int d, int y) monthdayyear(int m, int d, int y)
{ {
int t, t1; int t, t1;

View file

@ -1,53 +1,38 @@
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = parser.c
bin_PROGRAMS = rpc.cmsd bin_PROGRAMS = rpc.cmsd
rpc.cmsd_CFLAGS = -I$(CSASRC) -I$(HELPSRC) $(TIRPCINC) rpc_cmsd_CFLAGS = -I../../../lib/csa $(DT_INCDIR) $(CSA_INCDIR) $(TIRPCINC)
rpc.cmsd_LDADD = $(LIBCSA) $(LIBSVC) $(LIBTT) $(LIBWIDGET) $(XTOOLLIB) ${X_LIBS} rpc_cmsd_LDADD = $(LIBCSA) $(DTCLIENTLIBS) $(XTOOLLIB)
if SOLARIS if SOLARIS
rpc.cmsd_CFLAGS += -xstrconst -Xc -v rpc_cmsd_CFLAGS += -xstrconst -Xc -v
rpc.cmsd_LDADD += -lsocket -lnsl -lintl -lm -ldl rpc_cmsd_LDADD += -lsocket -lnsl -lintl -lm -ldl
endif endif
if AIX rpc_cmsd_SOURCES = parser.c access.c callback.c cmscalendar.c \
rpc.cmsd_LDADD += -lrpcsvc -lPW -ldiag -lc cmsconvert.c cmsentry.c cmsmatch.c delete.c \
endif garbage.c insert.c lexit.c list.c log.c lookup.c \
reclotick.c recount.c relasttick.c reminder.c \
renexttick.c repeat.c reprevtick.c rerule.c \
reutil.c tree.c utility.c v4ops.c v5ops.c \
cmsfunc.c programtable.c rtable2.c rtable3.c \
rtable4.c svcmain.c update.c access.h cmsentry.h \
insert.h parser.h tree.h callback.h cmsmatch.h \
lexer.h reminder.h update.h cmsattr.h data.h \
list.h repeat.h utility.h cmscalendar.h delete.h \
log.h reutil.h v4ops.h cmsconvert.h garbage.h \
lookup.h rpcextras.h v5ops.h
if HPUX BUILT_SOURCES = parser.c parser.h
rpc.cmsd_CFLAGS += -DHPUX -DS9000 CLEANFILES = parser.c parser.h
rpc.cmsd_LDADD += -lrpcsvc -lV3 -lc -lPW
endif
rpc_cmsd_SOURCES = parser.c access.c callback.c \ AM_YFLAGS = -d
cmscalendar.c cmsconvert.c cmsentry.c \
cmsmatch.c delete.c garbage.c \
insert.c lexit.c list.c \
log.c lookup.c reclotick.c \
recount.c relasttick.c reminder.c \
renexttick.c repeat.c reprevtick.c \
rerule.c reutil.c tree.c \
utility.c v4ops.c v5ops.c \
cmsfunc.c programtable.c rtable2.c \
rtable3.c rtable4.c svcmain.c \
update.c
all:: rpc.cmsd parser.c parser.h: parser.y
$(YACC) $(AM_YFLAGS) $<
.SUFFIXES: .y $(SED) -e "s/yy/yyy/g" -e "/# line/d" y.tab.c > parser.c
$(SED) -e 's/yy/yyy/g' y.tab.h > parser.h
.y.c:
$(YACC) -d $(YFLAGS) $<
$(SED) -e "s/yy/yyy/g" -e "/# line/d" y.tab.c > $*.c
$(SED) s/yy/yyy/g y.tab.h > $*.h
$(RM) y.tab.c y.tab.h $(RM) y.tab.c y.tab.h
parser.o: parser.c
includes:: parser.c
clean::
echo -n > parser.h

View file

@ -38,6 +38,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <time.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#ifdef SVR4 #ifdef SVR4