├── .gitattributes ├── .gitignore ├── .travis.yml ├── GNUmakefile ├── INSTALL.md ├── Makefile.am ├── README.md ├── build-aux ├── .dir ├── Makefile.am ├── yuck-coru.c.m4 ├── yuck-coru.h.m4 ├── yuck-scmver.c ├── yuck-scmver.h ├── yuck-scmver.m4 ├── yuck.am ├── yuck.c ├── yuck.m4 ├── yuck.man.m4 ├── yuck.mk └── yuck.yuck ├── configure.ac ├── debian ├── changelog ├── compat ├── control ├── copyright ├── docs ├── echse.default ├── echse.init ├── info ├── rules ├── source │ └── format └── watch ├── info ├── Makefile.am ├── author.h2m └── proto ├── m4 ├── ax_zoneinfo.m4 ├── clitoris.m4 ├── sxe-compiler.m4 ├── sxe-events.m4 ├── sxe-libtool.m4 └── yuck.m4 ├── snap └── snapcraft.yaml ├── src ├── Makefile.am ├── bitint-bobs.c ├── bitint.c ├── bitint.h ├── boobs.h ├── bufpool.c ├── bufpool.h ├── celest.c ├── celest.h ├── dat_diyanet.c ├── dat_ummulqura.c ├── dt-strpf.c ├── dt-strpf.h ├── echsd.c ├── echsd.yuck ├── echse-genuid.c ├── echse-genuid.h ├── echse.c ├── echse.h ├── echse.yuck ├── echsq.c ├── echsq.yuck ├── echsx.c ├── echsx.yuck ├── evcomp-gp.erf ├── event.c ├── event.h ├── evfilt.c ├── evfilt.h ├── evical-gp.erf ├── evical.c ├── evical.h ├── evmeth-gp.erf ├── evmrul-gp.erf ├── evmrul.c ├── evmrul.h ├── evrrul-gp.erf ├── evrrul.c ├── evrrul.h ├── evstrm.c ├── evstrm.h ├── fdprnt.h ├── hash.c ├── hash.h ├── instant.c ├── instant.h ├── instruc.h ├── intern.c ├── intern.h ├── logger.c ├── logger.h ├── lunar.c ├── module.c ├── module.h ├── nedtrie.h ├── nifty.h ├── nummapstr.h ├── oid.h ├── range.c ├── range.h ├── scale.c ├── scale.h ├── shift.c ├── shift.h ├── sock.h ├── solar.c ├── state.c ├── state.h ├── strlst.c ├── strlst.h ├── task.c ├── task.h ├── tzob.c ├── tzob.h ├── tzraw.c ├── tzraw.h ├── version.c.in ├── version.h ├── wikisort.c ├── yd.h └── zoneinfo.c ├── test ├── Makefile.am ├── bitint_test_01.c ├── bitint_test_01.clit ├── bitint_test_02.c ├── bitint_test_02.clit ├── bitint_test_03.c ├── bitint_test_03.clit ├── bitint_test_04.c ├── bitint_test_04.clit ├── bitint_test_05.c ├── bitint_test_05.clit ├── bitint_test_06.c ├── bitint_test_06.clit ├── bitint_test_07.c ├── bitint_test_07.clit ├── bitint_test_08.c ├── bitint_test_08.clit ├── bitint_test_09.c ├── bitint_test_09.clit ├── bitint_test_10.c ├── bitint_test_10.clit ├── bitint_test_11.c ├── bitint_test_11.clit ├── bitint_test_12.c ├── bitint_test_12.clit ├── clitoris.am ├── clitoris.c ├── clitoris.yuck ├── evical_prnt.c ├── evical_prnt_01.clit ├── evical_prnt_02.clit ├── evical_prntdesc.c ├── filt_01.clit ├── filt_02.clit ├── filt_03.clit ├── filt_04.clit ├── genuid_01.clit ├── genuid_02.clit ├── merge_01.clit ├── merge_02.clit ├── merge_03.clit ├── merge_04.clit ├── mrul_01.clit ├── mrul_02.clit ├── mrul_03.clit ├── mrul_04.clit ├── rrul_01.clit ├── rrul_02.clit ├── rrul_03.clit ├── rrul_04.clit ├── rrul_05.clit ├── rrul_06.clit ├── rrul_07.clit ├── rrul_08.clit ├── rrul_09.clit ├── rrul_10.clit ├── rrul_11.clit ├── rrul_12.clit ├── rrul_13.clit ├── rrul_14.clit ├── rrul_15.clit ├── rrul_16.clit ├── rrul_17.clit ├── rrul_18.clit ├── rrul_19.clit ├── rrul_20.clit ├── rrul_22.clit ├── rrul_23.clit ├── rrul_24.clit ├── rrul_25.clit ├── rrul_26.clit ├── rrul_27.clit ├── rrul_28.clit ├── rrul_29.clit ├── rrul_30.clit ├── rrul_31.clit ├── rrul_32.clit ├── rrul_33.clit ├── rrul_34.clit ├── rrul_35.clit ├── rrul_36.clit ├── rrul_37.clit ├── rrul_38.clit ├── rrul_39.clit ├── rrul_40.clit ├── rrul_41.clit ├── rrul_42.clit ├── rrul_43.clit ├── rrul_44.clit ├── rrul_45.clit ├── rrul_46.clit ├── rrul_47.clit ├── rrul_48.clit ├── rrul_49.clit ├── rrul_50.clit ├── sample_01.ics ├── sample_02.ics ├── sample_03.ics ├── sample_04.ics ├── sample_05.ics ├── sample_06.ics ├── sample_07.ics ├── sample_08.ics ├── sample_09.ics ├── sample_10.ics ├── sample_11.ics ├── sample_12.ics ├── sample_12a.ics ├── sample_12b.ics ├── sample_13.ics ├── sample_13a.ics ├── sample_14.ics ├── sample_15.ics ├── sample_16.ics ├── sample_17b.ics ├── sample_17c.ics ├── sample_18.ics ├── sample_19.ics ├── sample_20.ics ├── sample_21.ics ├── sample_22.ics ├── sample_23.ics ├── sample_24.ics ├── sample_25.ics ├── sample_26.ics ├── sample_27.ics ├── sample_28.ics ├── sample_29.ics ├── sample_30.ics ├── sample_31.ics ├── sample_32.ics ├── sample_33.ics ├── sample_34.ics ├── sample_35.ics ├── sample_36.ics ├── sample_37.ics ├── sample_38.ics ├── sample_39.ics ├── sample_40.ics ├── unroll_01.clit ├── unroll_02.clit ├── unroll_03.clit ├── unroll_04.clit ├── unroll_05.clit ├── unroll_06.clit ├── unroll_07.clit ├── unroll_08.clit ├── unroll_09.clit ├── unroll_10.clit ├── unroll_11.clit ├── unroll_12.clit └── unroll_13.clit └── version.mk.in /.gitattributes: -------------------------------------------------------------------------------- 1 | *.c linguist-language=C 2 | *.h linguist-language=C 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | configure 2 | Makefile 3 | Makefile.in 4 | aclocal.m4 5 | autom4te.cache 6 | config.guess 7 | config.sub 8 | depcomp 9 | install-sh 10 | ltmain.sh 11 | missing 12 | m4/argz.m4 13 | m4/lt*.m4 14 | m4/libtool.m4 15 | compile 16 | config.h.in 17 | libltdl/ 18 | *~ 19 | ++* 20 | =* 21 | .rsync-filter 22 | .version 23 | version.h 24 | texinfo.tex 25 | *.info 26 | test-driver 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | ## travis configuration file 2 | 3 | language: c 4 | 5 | sudo: required 6 | 7 | env: 8 | global: 9 | - secure: "qIyxfoi6sDAu+bqx8fBsEHDQjI1myHFFJQqmm/03kGTZ8iuFMuP0q64xmNhq11t6xnB/XUuNJkw2zKizM2cTHCs3T6wElQ+GJ8ImUoSF/VDOjo1b/KLbar19zh5xO14adtlEsR6M/SKcEErwr7Mf8kHSNfLIjREm8lZn5jPN+tI=" 10 | 11 | compiler: 12 | - gcc 13 | - clang 14 | 15 | before_install: 16 | - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt 17 | 18 | before_script: 19 | - autoreconf -vfi 20 | 21 | script: 22 | - ./configure || { cat config.log; false; } 23 | - make clean all check || { cat test/test-suite.log; false; } 24 | - make distcheck 25 | 26 | ## whitelist 27 | branches: 28 | only: 29 | - master 30 | - next 31 | - coverity-scan 32 | - /^v\d+\..*/ 33 | 34 | deploy: 35 | provider: releases 36 | api_key: 37 | secure: "MqwGx4jj4ZXiqgFvmkLNSBUS1+x8cAqnoh2WLXS8AVlEkQ4KVEjCwZW37N5iZxVF0it/XRP/OgKOuU9UdnbEuW1msgYA0VcZtwNhpOL9OKINBtN1xMd1h5ifopB7XrAL755mjxSBxb/Hj2o8F6fuoJXD43NVEVHr6eWdDtscMVU=" 38 | file_glob: true 39 | file: echse-*.tar.xz 40 | skip_cleanup: true 41 | on: 42 | tags: true 43 | 44 | notifications: 45 | email: 46 | - devel@fresse.org 47 | 48 | addons: 49 | apt: 50 | packages: 51 | - gperf 52 | - libev-dev 53 | coverity_scan: 54 | project: 55 | name: "hroptatyr/echse" 56 | description: "echse coverity scan" 57 | notification_email: devel@fresse.org 58 | build_command_prepend: "./configure" 59 | build_command: "make all check" 60 | branch_pattern: coverity-scan 61 | -------------------------------------------------------------------------------- /GNUmakefile: -------------------------------------------------------------------------------- 1 | # This GNUmakefile is used only if you run GNU Make. 2 | 3 | # If the user runs GNU make but has not yet run ./configure, 4 | # give them a diagnostic. 5 | _gl-Makefile := $(wildcard [M]akefile) 6 | ifneq ($(_gl-Makefile),) 7 | 8 | _dist-target_p ?= $(filter-out %clean, $(filter dist%,$(MAKECMDGOALS))) 9 | 10 | include Makefile 11 | 12 | # update the included makefile snippet which sets VERSION variables 13 | version.mk: .version version.mk.in FORCE 14 | -$(AM_V_GEN) \ 15 | if test "$(MAKECMDGOALS)" != "am--refresh"; then \ 16 | $(MAKE) -C "$(top_builddir)/build-aux" $(MAKECMDGOALS); \ 17 | PATH="$(top_builddir)/build-aux:$${PATH}" \ 18 | yuck scmver --ignore-noscm -o $@ --reference $^; \ 19 | if test $$? -eq 3 -a -n "$(_dist-target_p)"; then \ 20 | exec $(MAKE) $(MAKECMDGOALS); \ 21 | fi; \ 22 | fi 23 | 24 | else 25 | 26 | .DEFAULT_GOAL := abort-due-to-no-makefile 27 | $(MAKECMDGOALS): abort-due-to-no-makefile 28 | 29 | abort-due-to-no-makefile: 30 | @echo There seems to be no Makefile in this directory. 1>&2 31 | @echo "You must run ./configure before running 'make'." 1>&2 32 | 33 | endif 34 | 35 | .PHONY: FORCE 36 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | Installation 2 | ============ 3 | 4 | echse is a standard autotools project, so installation steps are: 5 | 6 | When using a tarball distribution: 7 | ---------------------------------- 8 | 1. ./configure 9 | 2. make 10 | 3. make install 11 | 12 | When using the git repository: 13 | ------------------------------ 14 | 1. autoreconf -fi (only when using the git repository) 15 | 2. ./configure 16 | 3. make 17 | 4. make install 18 | 19 | 20 | Starting echsd 21 | -------------- 22 | 23 | Unlike other cron implementations echse explicitly allows being run as 24 | non-privileged user. To do so invoke: 25 | 26 | $ echsd 27 | 28 | Queue files and journals are placed in `~/.echse//`. This 29 | directory will be created if need be. The socket file to communicate 30 | with the echse daemon will be put into `/var/run/user//echse/`. 31 | 32 | In contrast, when invoked as superuser queue files and journals are 33 | placed in `/var/spool/echse`. Again, this directory will be created 34 | if need be. In superuser mode the socket file will be put into 35 | `/var/run/echse/`. 36 | 37 | 38 | Queuing 39 | ------- 40 | 41 | To add tasks to or delete tasks from the queue use the `echsq(1)` tool. 42 | This tool is aware of both running modes (non-privileged and privileged) 43 | and will look for the communication socket file in both places. 44 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_builddir)/version.mk 2 | 3 | LANG = C 4 | LC_ALL = C 5 | 6 | ACLOCAL_AMFLAGS = -I m4 7 | 8 | SUBDIRS = 9 | DISTCLEANFILES = 10 | EXTRA_DIST = $(DISTCLEANFILES) 11 | BUILT_SOURCES = 12 | 13 | SUBDIRS += build-aux 14 | if DESCEND_LIBLTDL 15 | SUBDIRS += libltdl 16 | endif DESCEND_LIBLTDL 17 | SUBDIRS += src 18 | SUBDIRS += info 19 | SUBDIRS += test 20 | 21 | EXTRA_DIST += README.md 22 | EXTRA_DIST += INSTALL.md 23 | 24 | DISTCLEANFILES += version.mk 25 | DISTCLEANFILES += .version 26 | EXTRA_DIST += version.mk.in 27 | 28 | ## make sure .version is read-only in the dist 29 | dist-hook: 30 | chmod ugo-w $(distdir)/.version 31 | 32 | ## Makefile.am ends here 33 | -------------------------------------------------------------------------------- /build-aux/.dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hroptatyr/echse/8f7e2bbaae9139deab7164d40bce6bb17d7fd9fe/build-aux/.dir -------------------------------------------------------------------------------- /build-aux/Makefile.am: -------------------------------------------------------------------------------- 1 | LANG = C 2 | LC_ALL = C 3 | 4 | AM_CFLAGS = $(EXTRA_CFLAGS) 5 | 6 | noinst_PROGRAMS = 7 | BUILT_SOURCES = 8 | EXTRA_DIST = 9 | DISTCLEANFILES = 10 | 11 | if !HAVE_YUCK 12 | include yuck.am 13 | endif !HAVE_YUCK 14 | 15 | ## Makefile.am ends here 16 | -------------------------------------------------------------------------------- /build-aux/yuck-scmver.h: -------------------------------------------------------------------------------- 1 | /*** yuck-version.h -- snarf versions off project cwds 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of yuck. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_yuck_version_h_ 38 | #define INCLUDED_yuck_version_h_ 39 | 40 | #include "stdlib.h" 41 | 42 | typedef const struct yuck_version_s *yuck_version_t; 43 | 44 | typedef enum { 45 | YUCK_SCM_ERROR = -1, 46 | YUCK_SCM_TARBALL, 47 | YUCK_SCM_GIT, 48 | YUCK_SCM_BZR, 49 | YUCK_SCM_HG, 50 | } yuck_scm_t; 51 | 52 | struct yuck_version_s { 53 | yuck_scm_t scm; 54 | unsigned int dirty:1U; 55 | char vtag[16U]; 56 | unsigned int dist; 57 | /* up to 28bits of revision id (hash for git), 58 | * the lower 4bits denote the length */ 59 | unsigned int rvsn; 60 | }; 61 | 62 | extern const char *const yscm_strs[]; 63 | 64 | 65 | /* public api */ 66 | /** 67 | * Determine SCM version of file(s) in PATH. */ 68 | extern int yuck_version(struct yuck_version_s *restrict v, const char *path); 69 | 70 | /** 71 | * Read a reference file FN and return scm version information. */ 72 | extern int yuck_version_read(struct yuck_version_s *restrict, const char *fn); 73 | 74 | /** 75 | * Write scm version information in V to reference file FN. */ 76 | extern int yuck_version_write(const char *fn, const struct yuck_version_s *v); 77 | 78 | /** 79 | * Write scm version into buffer. */ 80 | extern ssize_t yuck_version_write_fd(int fd, const struct yuck_version_s *v); 81 | 82 | /** 83 | * Compare two version objects, return <0 if V1 < V2, >0 if V1 > V2 and 84 | * 0 if V1 and V2 are considered equal. */ 85 | extern int yuck_version_cmp(yuck_version_t v1, yuck_version_t v2); 86 | 87 | #endif /* INCLUDED_yuck_version_h_ */ 88 | -------------------------------------------------------------------------------- /build-aux/yuck-scmver.m4: -------------------------------------------------------------------------------- 1 | changequote`'changequote([,])dnl 2 | divert([-1]) 3 | changecom([##]) 4 | 5 | ## we used to define YUCK_SCMVER_VERSION in m4 terms here 6 | ## however in C it's so much easier to come by with the same thing 7 | ## so we reserve this file for future (m4-based) goodness 8 | 9 | divert[]dnl 10 | changequote()dnl 11 | -------------------------------------------------------------------------------- /build-aux/yuck.am: -------------------------------------------------------------------------------- 1 | ## automake rules for yuck 2 | ## set the following variables in the including Makefile.am beforehand 3 | ## noinst_PROGRAMS 4 | ## BUILT_SOURCES 5 | ## EXTRA_DIST 6 | ## DISTCLEANFILES 7 | 8 | yuck_CPPFLAGS = -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE 9 | yuck_CPPFLAGS += -D_ALL_SOURCE 10 | yuck_CPPFLAGS += -D_DARWIN_C_SOURCE 11 | yuck_CPPFLAGS += -D_NETBSD_SOURCE 12 | 13 | noinst_PROGRAMS += yuck-bootstrap 14 | yuck_bootstrap_SOURCES = yuck.c 15 | yuck_bootstrap_CPPFLAGS = $(yuck_CPPFLAGS) 16 | yuck_bootstrap_CPPFLAGS += -DBOOTSTRAP 17 | yuck_bootstrap_CPPFLAGS += -DWITH_SCMVER 18 | 19 | noinst_PROGRAMS += yuck 20 | yuck_SOURCES = yuck.c yuck.yuck 21 | yuck_SOURCES += yuck-scmver.c yuck-scmver.h yuck-scmver.m4 22 | yuck_SOURCES += yuck.m4 23 | yuck_SOURCES += yuck-coru.c.m4 yuck-coru.h.m4 24 | yuck_SOURCES += yuck.man.m4 25 | yuck_CPPFLAGS += -DYUCK_TEMPLATE_PATH='"$(abs_srcdir)"' 26 | yuck_CPPFLAGS += -DWITH_SCMVER 27 | BUILT_SOURCES += yuck.yucc 28 | 29 | ## aix make wants all prereq's to exist 30 | EXTRA_DIST += yuck.m4i 31 | EXTRA_DIST += yuck.yucc 32 | 33 | DISTCLEANFILES += yuck.m4i yuck.yucc 34 | 35 | ## also include custom Makefile recipes 36 | include $(srcdir)/yuck.mk 37 | -------------------------------------------------------------------------------- /build-aux/yuck.man.m4: -------------------------------------------------------------------------------- 1 | .\" auto generated by yuck -*- nroff -*- 2 | changequote`'changequote([,])dnl 3 | ifdef([YUCK_VERSION], [], [dnl else (!YUCK_VERSION) 4 | ifdef([YUCK_SCMVER_VERSION], [dnl then 5 | define([YUCK_VERSION], [YUCK_SCMVER_VERSION])[]dnl 6 | ], [dnl else (!YUCK_SCMVER_VERSION) 7 | define([YUCK_VERSION], [unknown])dnl 8 | ])dnl 9 | ])dnl 10 | define([ucase], [translit([$1], [abcdefghijklmnopqrstuvwxyz], [ABCDEFGHIJKLMNOPQRSTUVWXYZ])])dnl 11 | ifdef([YUCK_PKG_STR], [], [define([YUCK_PKG_STR], [YUCK_UMB_STR])])dnl 12 | .TH ucase(YUCK_UMB_STR) "1" "YUCK_MAN_DATE" "YUCK_PKG_STR YUCK_VERSION" "User Commands" 13 | .SH NAME 14 | pushdef([umb_desc], [yuck_first_line(yuck_umb_desc())])dnl 15 | pushdef([alt_desc], [manual page for YUCK_PKG_STR YUCK_VERSION])dnl 16 | YUCK_UMB_STR - first_nonnil(umb_desc, alt_desc) 17 | popdef([umb_desc])dnl 18 | popdef([alt_desc])dnl 19 | .SH SYNOPSIS 20 | .B YUCK_UMB_STR 21 | [[\fIOPTION\fR]]...[ ]dnl 22 | ifelse(yuck_cmds(), [], [], [\fICOMMAND\fR]) 23 | []dnl 24 | yuck_esc(dnl 25 | yuck_esc(dnl 26 | yuck_esc(dnl 27 | yuck_esc(dnl 28 | yuck_esc(translit(defn([YUCK_UMB_POSARG]), [[]], []), 29 | [ -], [\fR -]), 30 | [ ], [ \fI]), 31 | [], [\fR\fI]), 32 | [], [\fR]), 33 | [...], [\fR...]) 34 | .SH DESCRIPTION 35 | yuck_umb_desc() 36 | ifelse(yuck_cmds(), [], [], [dnl 37 | 38 | .PP 39 | \fICOMMAND\fR may be one of: 40 | foreachq([__CMD__], yuck_cmds(), [dnl 41 | .TP 42 | .B yuck_cmd_string(__CMD__) 43 | . 44 | yuck_cmd_desc(__CMD__) 45 | ])dnl 46 | ])dnl 47 | 48 | .PP 49 | define([yuck_man_option], [dnl 50 | pushdef([lhs], [yuck_option_help_lhs([$1], [$2])])dnl 51 | yuck_esc(dnl 52 | yuck_esc(dnl 53 | yuck_esc(dnl 54 | yuck_esc(dnl 55 | yuck_esc(dnl 56 | yuck_esc(dnl 57 | yuck_esc(lhs, 58 | [,], [\fR,]), 59 | [ -], [ \fB-]), 60 | [], [\fR]), 61 | [=], [\fR=]), 62 | [=], [=\fI]), 63 | [], [\fR]), 64 | [...], [\fR...])dnl 65 | popdef([lhs])dnl 66 | ]) 67 | Recognized \fIOPTION\fRs: 68 | foreachq([__IDN__], yuck_idents(), [dnl 69 | .TP 70 | .B yuck_man_option(defn([__IDN__]), []) 71 | yuck_option_desc(defn([__IDN__]), []) 72 | ])dnl 73 | dnl 74 | ifelse(yuck_cmds(), [], [], [dnl 75 | .SH COMMANDS 76 | ])dnl 77 | foreachq([__CMD__], yuck_cmds(), [ 78 | .P 79 | .B YUCK_UMB_STR yuck_cmd_string(__CMD__) 80 | [[\fIOPTION\fR]]... 81 | yuck_esc(dnl 82 | yuck_esc(dnl 83 | yuck_esc(dnl 84 | yuck_esc(dnl 85 | yuck_esc(translit(yuck_cmd_posarg(__CMD__), [[]], []), 86 | [ -], [\fR -]), 87 | [ ], [ \fI]), 88 | [], [\fR\fI]), 89 | [], [\fR]), 90 | [...], [\fR...]) 91 | .br 92 | yuck_cmd_desc(C) 93 | .P 94 | \fIOPTION\fRs specific to the \fB[]yuck_cmd_string(__CMD__)\fR command: 95 | foreachq([__IDN__], yuck_idents(__CMD__), [dnl 96 | .TP 97 | .B yuck_option_help_lhs(defn([__IDN__]), defn([__CMD__])) 98 | yuck_option_desc(defn([__IDN__]), defn([__CMD__])) 99 | ])dnl 100 | ])dnl 101 | foreachq([__INC__], defn([YUCK_INCLUDES]), [dnl 102 | include(__INC__) 103 | ]) 104 | ifdef([YUCK_NFO_STR], [ 105 | .SH "SEE ALSO" 106 | The full documentation for 107 | .B YUCK_UMB_STR 108 | is maintained as a Texinfo manual. If the 109 | .B info 110 | and 111 | .B YUCK_UMB_STR 112 | programs are properly installed at your site, the command 113 | .IP 114 | .B info ifelse(YUCK_NFO_STR, YUCK_UMB_STR, [YUCK_NFO_STR], [(YUCK_NFO_STR)YUCK_UMB_STR]) 115 | .PP 116 | should give you access to the complete manual. 117 | ])dnl 118 | .\" yuck.m4man ends here 119 | changequote`'dnl 120 | -------------------------------------------------------------------------------- /build-aux/yuck.mk: -------------------------------------------------------------------------------- 1 | ## bootstrapping rules, made for inclusion in your own Makefiles 2 | yuck.m4i: yuck.yuck 3 | $(MAKE) $(AM_MAKEFLAGS) yuck-bootstrap 4 | $(AM_V_GEN) $(builddir)/yuck-bootstrap$(EXEEXT) $(srcdir)/yuck.yuck > $@ \ 5 | || { rm -f -- $@; false; } 6 | 7 | yuck.yucc: yuck.m4i yuck.m4 yuck-coru.h.m4 yuck-coru.c.m4 8 | $(AM_V_GEN) $(M4) $(srcdir)/yuck.m4 yuck.m4i \ 9 | $(srcdir)/yuck-coru.h.m4 $(srcdir)/yuck-coru.c.m4 | \ 10 | tr '\002\003\016\017' '[]()' > $@ \ 11 | || { rm -f -- $@; false; } 12 | -------------------------------------------------------------------------------- /build-aux/yuck.yuck: -------------------------------------------------------------------------------- 1 | Usage: yuck COMMAND [ARG]... 2 | 3 | Generate command line option parsers for umbrella commands. 4 | 5 | -k, --keep Keep intermediary files. 6 | -o, --output=FILE Output goes into FILE instead of stdout. 7 | 8 | 9 | ## Usages of the single commands 10 | Usage: yuck [OPTION]... gen [FILE]... 11 | 12 | Generate a parser from definitions in FILE, or stdin if omitted. 13 | 14 | -H, --header=FILE Also generate a header file. 15 | --no-auto-flags Do not add auto flags (--help, --version). 16 | --no-auto-help Do not add auto --help flag 17 | --no-auto-version Do not add auto --version flag 18 | --no-auto-actions Do not automatically handle auto flags. 19 | --version=VERSION Hardwire version number. 20 | --custom=FILE Include custom macros from FILE. 21 | -p, --preserve Preserve indentation and newlines. 22 | 23 | 24 | ## GENMAN 25 | Usage: yuck [OPTION]... genman [FILE]... 26 | 27 | Generate a man page from definitions in FILE, or stdin if omitted. 28 | 29 | --version-string=STRING Hardwire version number as STRING. 30 | --version-file=FILE Hardwire version number from FILE. 31 | --package=STRING Use package STRING instead of umbrella. 32 | -i, --include=FILE... Include sections from FILE 33 | --info-page[=NAME] Include reference to Texinfo manual. 34 | 35 | 36 | ## GENDSL 37 | Usage: yuck gendsl [FILE]... 38 | 39 | Generate the intermediary description of definitions from FILE, or stdin 40 | if omitted. 41 | 42 | --no-auto-flags Do not add auto flags (--help, --version). 43 | --no-auto-help Do not add auto --help flag 44 | --no-auto-version Do not add auto --version flag 45 | --no-auto-actions Do not automatically handle auto flags. 46 | --version=VERSION Hardwire version number. 47 | -p, --preserve Preserve indentation and newlines. 48 | 49 | 50 | ## VER 51 | Usage: yuck scmver [PATH] 52 | 53 | Guess version number for SCM controlled PATH. 54 | If PATH is a file run a transformation. 55 | If PATH is a directory just output the version number. 56 | 57 | Transformations are done through the m4 processor: 58 | YUCK_SCMVER_VTAG will expand to the tag name. 59 | YUCK_SCMVER_SCM will expand to the name of the SCM used. 60 | YUCK_SCMVER_DIST will expand to the distance, that is the number of 61 | commits since the last tag. 62 | YUCK_SCMVER_RVSN will expand to the current commit number. 63 | YUCK_SCMVER_FLAG_DIRTY is set for changes in the source tree that have 64 | not yet been committed. 65 | 66 | Definitions in the template yuck-scmver.m4 are prepended, and by 67 | default this defines the YUCK_SCMVER_VERSION macro that expands to the 68 | full version number. 69 | 70 | 71 | -v, --verbose Print additional information on stderr. 72 | --reference=FILE Store version reference in FILE and don't touch 73 | the output file if nothing has changed. 74 | -f, --force Force operation even if the current scm version 75 | coincides with the reference version. 76 | -n, --use-reference Use version number provided in the reference 77 | file instead of determining it. 78 | --ignore-noscm Don't treat no scm as error. 79 | 80 | 81 | Usage: yuck config 82 | 83 | Output config values for yuck. 84 | 85 | --m4 Print m4 value used during yuck build. 86 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | echse (0.2.1-1ubuntu1ppa1) trusty; urgency=low 2 | 3 | * 0.2.1 release 4 | 5 | -- Sebastian Freundt Thu, 16 Jul 2020 05:38:59 +0000 6 | 7 | echse (0.1.99-1ubuntu1ppa1) trusty; urgency=low 8 | 9 | * 0.2.0 prerealease 1 10 | 11 | -- Sebastian Freundt Mon, 16 May 2017 05:38:59 +0000 12 | 13 | echse (0.1.99-0ubuntu1ppa1) trusty; urgency=low 14 | 15 | * Initial release 16 | 17 | -- Sebastian Freundt Mon, 16 Nov 2015 05:38:59 +0000 18 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: echse 2 | Section: utils 3 | Priority: optional 4 | Maintainer: Sebastian Freundt 5 | Build-Depends: debhelper (>= 9.0.0), gperf, libev-dev 6 | Standards-Version: 3.9.5 7 | Homepage: http://www.fresse.org/echse/ 8 | Vcs-Git: git://github.com/hroptatyr/echse.git 9 | Vcs-Browser: https://github.com/hroptatyr/echse/ 10 | 11 | Package: echse 12 | Architecture: any 13 | Depends: ${shlibs:Depends}, ${misc:Depends}, 14 | sendmail | mail-transport-agent 15 | Description: Run jobs at regular times, much like cron. 16 | To schedule jobs this cron implementation makes use of RFC 5545 17 | calendaring and scheduling instructions, also known as ics or 18 | iCalendar, for which numerous front-end implementations are 19 | readily available and widely adopted. Not only will organizing 20 | jobs become easier using these front-ends but they will also 21 | greatly help keep track of schedules with their visualization 22 | facilities. 23 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: echse 3 | Source: https://github.com/hroptatyr/echse/downloads/ 4 | 5 | Files: * 6 | Copyright: 2010-2030 Sebastian Freundt 7 | License: BSD 3-clause 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted under the terms of the BSD License. 10 | . 11 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 12 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 15 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 16 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 17 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 18 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 19 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 20 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 21 | SUCH DAMAGE. 22 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /debian/echse.default: -------------------------------------------------------------------------------- 1 | # Defaults for echse initscript 2 | # sourced by /etc/init.d/echse 3 | # installed at /etc/default/echse by the maintainer scripts 4 | 5 | # 6 | # This is a POSIX shell fragment 7 | # 8 | 9 | # Additional options that are passed to the Daemon. 10 | DAEMON_OPTS="" 11 | -------------------------------------------------------------------------------- /debian/info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hroptatyr/echse/8f7e2bbaae9139deab7164d40bce6bb17d7fd9fe/debian/info -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all 4 | DPKG_EXPORT_BUILDFLAGS = 1 5 | include /usr/share/dpkg/default.mk 6 | 7 | export DH_VERBOSE=1 8 | 9 | # This has to be exported to make some magic below work. 10 | export DH_OPTIONS 11 | 12 | %: 13 | dh $@ 14 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | https://github.com/hroptatyr/echse/tags .*/v?(\d[\d\.]+)\.tar\.xz 3 | -------------------------------------------------------------------------------- /info/Makefile.am: -------------------------------------------------------------------------------- 1 | # Help the Developers and yourself. Just use the C locale and settings 2 | # for the compilation. They can still be overriden by make LANG= 3 | # but that is general a not very good idea 4 | LANG=C 5 | LC_ALL=C 6 | 7 | include $(top_builddir)/version.mk 8 | 9 | BUILT_SOURCES = 10 | EXTRA_DIST = $(BUILT_SOURCES) 11 | EXTRA_DIST += $(man1_MANS) 12 | SUFFIXES = 13 | 14 | man1_MANS = 15 | man1_MANS += $(built_mans) 16 | man1_MANS += echse.man 17 | man1_MANS += echsq.man 18 | man1_MANS += echsd.man 19 | man1_MANS += echsx.man 20 | 21 | BUILT_SOURCES += $(built_mans) 22 | EXTRA_DIST += author.h2m 23 | EXTRA_DIST += proto 24 | 25 | VPATH = $(srcdir):@top_srcdir@/src 26 | SUFFIXES += .yuck 27 | SUFFIXES += .man 28 | .yuck.man: 29 | $(AM_V_GEN) PATH="$(top_builddir)/build-aux:$${PATH}" \ 30 | yuck$(EXEEXT) genman \ 31 | --package "$(PACKAGE_NAME)" \ 32 | -i "$(srcdir)/author.h2m" \ 33 | -o $@ --version-file "$(top_builddir)/.version" $< 34 | 35 | ## Makefile.am ends here 36 | -------------------------------------------------------------------------------- /info/author.h2m: -------------------------------------------------------------------------------- 1 | [Author] 2 | Written by Sebastian Freundt 3 | 4 | [Reporting bugs] 5 | Report bugs to: https://github.com/hroptatyr/echse/issues 6 | 7 | -------------------------------------------------------------------------------- /info/proto: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | PRODID:-//GA Financial Solutions//echse//EN 4 | METHOD:PUBLISH 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | SUMMARY: 8 | ATTENDEE:$USER 9 | X-ECHS-MAIL-RUN:true 10 | X-ECHS-MAIL-OUT:true 11 | X-ECHS-MAIL-ERR:true 12 | X-ECHS-SHELL:$SHELL 13 | LOCATION:$PWD 14 | DTSTART: 15 | DURATION:P1D 16 | RRULE:FREQ=DAILY 17 | END:VEVENT 18 | END:VCALENDAR 19 | -------------------------------------------------------------------------------- /m4/clitoris.m4: -------------------------------------------------------------------------------- 1 | dnl clitoris.m4 --- checks necessary for the clitoris test harness 2 | dnl 3 | dnl Copyright (C) 2013-2016 Sebastian Freundt 4 | dnl 5 | dnl Author: Sebastian Freundt 6 | dnl 7 | dnl Redistribution and use in source and binary forms, with or without 8 | dnl modification, are permitted provided that the following conditions 9 | dnl are met: 10 | dnl 11 | dnl 1. Redistributions of source code must retain the above copyright 12 | dnl notice, this list of conditions and the following disclaimer. 13 | dnl 14 | dnl 2. Redistributions in binary form must reproduce the above copyright 15 | dnl notice, this list of conditions and the following disclaimer in the 16 | dnl documentation and/or other materials provided with the distribution. 17 | dnl 18 | dnl 3. Neither the name of the author nor the names of any contributors 19 | dnl may be used to endorse or promote products derived from this 20 | dnl software without specific prior written permission. 21 | dnl 22 | dnl THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 23 | dnl IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 | dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | dnl DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | dnl FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 | dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 | dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 | dnl BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 | dnl WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 | dnl OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 | dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | dnl 34 | dnl This file is part of clitoris. 35 | 36 | AC_DEFUN([AX_CHECK_CLITORIS], [dnl 37 | ## check for pseudo-tty support 38 | AC_CHECK_HEADERS([pty.h]) 39 | AM_CONDITIONAL([HAVE_PTY_H], [test "${ac_cv_header_pty_h}" = "yes"]) 40 | 41 | ## we might want to use splice(2) 42 | AC_CHECK_FUNCS([splice]) 43 | ])dnl AX_CHECK_CLITORIS 44 | 45 | dnl clitoris.m4 ends here 46 | -------------------------------------------------------------------------------- /m4/sxe-events.m4: -------------------------------------------------------------------------------- 1 | dnl sxe-events.m4 -- Event queue and things like that 2 | dnl 3 | dnl Copyright (C) 2005, 2006, 2007, 2008 Sebastian Freundt 4 | dnl 5 | dnl Author: Sebastian Freundt 6 | dnl 7 | dnl Redistribution and use in source and binary forms, with or without 8 | dnl modification, are permitted provided that the following conditions 9 | dnl are met: 10 | dnl 11 | dnl 1. Redistributions of source code must retain the above copyright 12 | dnl notice, this list of conditions and the following disclaimer. 13 | dnl 14 | dnl 2. Redistributions in binary form must reproduce the above copyright 15 | dnl notice, this list of conditions and the following disclaimer in the 16 | dnl documentation and/or other materials provided with the distribution. 17 | dnl 18 | dnl 3. Neither the name of the author nor the names of any contributors 19 | dnl may be used to endorse or promote products derived from this 20 | dnl software without specific prior written permission. 21 | dnl 22 | dnl THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 23 | dnl IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 | dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | dnl DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | dnl FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 | dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 | dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 | dnl BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 | dnl WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 | dnl OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 | dnl IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | dnl 34 | dnl This file is part of SXEmacs. 35 | 36 | AC_DEFUN([SXE_CHECK_LIBEV], [ 37 | ## defines sxe_cv_feat_libev 38 | PKG_CHECK_MODULES([ev], [libev >= 4.0], [have_libev="yes"], 39 | [have_libev="no"; ev_LIBS="-lev"]) 40 | save_CPPFLAGS="${CPPFLAGS}" 41 | save_LDFLAGS="${LDFLAGS}" 42 | CPPFLAGS="$CPPFLAGS $ev_CFLAGS" 43 | LDFLAGS="$LDFLAGS $ev_LIBS" 44 | AC_CHECK_HEADERS([ev.h]) 45 | AC_CHECK_LIB([ev], [ev_loop_new]) 46 | CPPFLAGS="${save_CPPFLAGS}" 47 | LDFLAGS="${save_LDFLAGS}" 48 | 49 | if test "$ac_cv_header_ev_h" = "yes" -a \ 50 | "$ac_cv_lib_ev___ev_loop_new$ac_cv_lib_ev_ev_loop_new" = "yes"; then 51 | AC_DEFINE([HAVE_LIBEV], [1], [Whether libev is fully functional]) 52 | sxe_cv_feat_libev="yes" 53 | have_libev="yes" 54 | else 55 | sxe_cv_feat_libev="no" 56 | have_libev="no" 57 | ev_CFLAGS= 58 | ev_LIBS= 59 | fi 60 | 61 | AC_SUBST([ev_CFLAGS]) 62 | AC_SUBST([ev_LIBS]) 63 | ])dnl SXE_CHECK_LIBEV 64 | 65 | dnl sxe-events.m4 ends here 66 | -------------------------------------------------------------------------------- /m4/sxe-libtool.m4: -------------------------------------------------------------------------------- 1 | dnl sxe-libtool.m4 -- just a quick libtoolish macros 2 | dnl 3 | dnl Copyright (C) 2007-2013 Sebastian Freundt. 4 | dnl 5 | dnl This file is part of unserding 6 | 7 | AC_DEFUN([SXE_CHECK_LIBTOOL], [dnl 8 | AC_MSG_RESULT([starting libtool investigation...]) 9 | 10 | ## turn off -Werror'ing 11 | ac_[]_AC_LANG_ABBREV[]_werror_flag= 12 | 13 | LT_PREREQ([2.1]) 14 | LT_INIT([dlopen]) 15 | 16 | LT_LIB_DLLOAD 17 | LT_LIB_M 18 | LT_SYS_DLOPEN_DEPLIBS 19 | LT_SYS_SYMBOL_USCORE 20 | LT_FUNC_DLSYM_USCORE 21 | 22 | ## cope with libtool's convenience lib/bin concept 23 | if test -n "$lt_cv_objdir"; then 24 | ## this variable is a #define, too 25 | LT_OBJDIR="$lt_cv_objdir" 26 | else 27 | ## hm, probably not the best idea but let's try 28 | LT_OBJDIR="." 29 | fi 30 | ## definitely subst that though 31 | AC_SUBST([LT_OBJDIR]) 32 | 33 | ## currently there's no official variable for that, but `lt-' 34 | ## seems to be a consistent choice throughout all libtools 35 | LT_CONVENIENCE_PREFIX="lt-" 36 | AC_SUBST([LT_CONVENIENCE_PREFIX]) 37 | 38 | ## reset XCCFLAG, we KNOW it's XCClinker in libtool 39 | XCCFLAG="-XCClinker" 40 | ])dnl SXE_CHECK_LIBTOOL 41 | 42 | AC_DEFUN([SXE_CHECK_LIBLTDL], [dnl 43 | ## make sure the libtool stuff has been run before 44 | AC_REQUIRE([SXE_CHECK_LIBTOOL]) 45 | 46 | ## This can't be here because older versions of libtool 47 | ## seem to overlook the argument to LTDL_INIT 48 | ## put the next two lines into c.ac instead and then call this macro 49 | dnl LT_CONFIG_LTDL_DIR([libltdl]) 50 | dnl LTDL_INIT([recursive]) 51 | 52 | # workaround libtool LT_CONFIG_H bug #12262 53 | AC_CONFIG_COMMANDS_PRE([LT_CONFIG_H=`expr "$LT_CONFIG_H" : '.*/\(.*\)'`]) 54 | AM_CONDITIONAL([DESCEND_LIBLTDL], [test "${with_included_ltdl}" = "yes"]) 55 | ])dnl SXE_CHECK_LIBLTDL 56 | 57 | dnl sxe-libtool.m4 ends here 58 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: echse 2 | version: '0.2.1 3 | summary: A cron daemon on RFC 5545 (ical) files. 4 | description: | 5 | In a nutshell: a cron daemon on RFC 5545 calendar files 6 | (aka iCalendar aka ics) with execution resolution up to one 7 | second, per-task configuration of everything, and which can 8 | be run in daemon mode by any user. 9 | grade: stable 10 | confinement: strict 11 | 12 | apps: 13 | echsd: 14 | command: sbin/echsd 15 | echsq: 16 | command: bin/echsq 17 | echsx: 18 | command: bin/echsx 19 | echse: 20 | command: bin/echse 21 | 22 | parts: 23 | echse: 24 | plugin: autotools 25 | source: https://github.com/hroptatyr/echse.git 26 | build-packages: 27 | - libltdl-dev 28 | - libev-dev 29 | - pkg-config 30 | - gperf 31 | -------------------------------------------------------------------------------- /src/bitint-bobs.c: -------------------------------------------------------------------------------- 1 | static void 2 | ass_bs(bitint_t *restrict bi, int x) 3 | { 4 | if (x > 0) { 5 | unsigned int p = (unsigned int)x % POS_BITZ; 6 | unsigned int j = (unsigned int)x / POS_BITZ; 7 | 8 | bi->pos[j] |= 1U << p; 9 | } else { 10 | unsigned int p = (unsigned int)(-x) % NEG_BITZ; 11 | unsigned int j = (unsigned int)(-x) / NEG_BITZ; 12 | bi->neg[j] |= 1U << p; 13 | } 14 | return; 15 | } 16 | 17 | static void 18 | ass_int(bitint_t *restrict bi, int x) 19 | { 20 | /* perform an insertion sort, with the special order 21 | * defined by the iterator, also use that sortedness 22 | * to check for dupes */ 23 | /* i is our candidate now, yay */ 24 | size_t i = *bi->pos >> 1U; 25 | size_t j; 26 | 27 | if (x >= 0) { 28 | for (j = 0UL; j < i && bi->neg[j] >= 0 && bi->neg[j] < x; j++); 29 | } else { 30 | for (j = 0UL; j < i && bi->neg[j] > x; j++); 31 | } 32 | /* now there's either j == i, in which case there's 33 | * trivially no dupes, or j < i, then there's no 34 | * dupes iff bi->neg[j] != x */ 35 | if (j < i && UNLIKELY(bi->neg[j] == x)) { 36 | /* dupe, just get on with life */ 37 | return; 38 | } else if (j < i) { 39 | /* move the bobs >= j one slot further down the road */ 40 | const size_t nmv = (i - j) * sizeof(*bi->neg); 41 | memmove(bi->neg + j + 1U, bi->neg + j, nmv); 42 | } 43 | /* now it's trivial, just insert at i == j */ 44 | bi->neg[j] = x; 45 | /* ... and up the counter */ 46 | *bi->pos += 2U; 47 | return; 48 | } 49 | 50 | #undef ass_bs 51 | #undef ass_int 52 | #undef bitint_t 53 | -------------------------------------------------------------------------------- /src/bufpool.h: -------------------------------------------------------------------------------- 1 | /*** bufpool.h -- pooling buffers 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_bufpool_h_ 38 | #define INCLUDED_bufpool_h_ 39 | 40 | #include 41 | 42 | /** 43 | * bufpools are length+offset integer tuples, much like interns. 44 | * Input buffers won't be checked for duplicates though. 45 | **/ 46 | typedef const struct bufpool_s bufpool_t; 47 | 48 | struct bufpool_s { 49 | char *str; 50 | size_t len; 51 | }; 52 | 53 | 54 | /** 55 | * Return the interned representation of STR. */ 56 | extern bufpool_t bufpool(const char *str, size_t len); 57 | 58 | /** 59 | * Unintern the BUFPOOL object. */ 60 | extern void bufunpool(bufpool_t); 61 | 62 | /** 63 | * Clean up resources used by the buffer pooling system. */ 64 | extern void clear_bufpool(void); 65 | 66 | #endif /* INCLUDED_bufpool_h_ */ 67 | -------------------------------------------------------------------------------- /src/dt-strpf.h: -------------------------------------------------------------------------------- 1 | /*** dt-strpf.h -- parser and formatter funs for echse 2 | * 3 | * Copyright (C) 2011-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | **/ 37 | #if !defined INCLUDED_dt_strpf_h_ 38 | #define INCLUDED_dt_strpf_h_ 39 | 40 | #include 41 | #include "instant.h" 42 | #include "range.h" 43 | 44 | /** 45 | * Parse STR with the standard parser. */ 46 | extern echs_instant_t dt_strp(const char *str, char **on, size_t len); 47 | 48 | /** 49 | * Print INST into BUF (of size BSZ) and return its length. */ 50 | extern size_t dt_strf(char *restrict buf, size_t bsz, echs_instant_t inst); 51 | 52 | /** 53 | * Print GRP-INST into BUF (of size BSZ) and return its length. */ 54 | extern size_t dt_strfg(char *restrict buf, size_t bsz, echs_instant_t inst); 55 | 56 | /** 57 | * Print INST into BUF (of size BSZ) in ical format and return its length. */ 58 | extern size_t dt_strf_ical(char *restrict buf, size_t bsz, echs_instant_t inst); 59 | 60 | /** 61 | * Parse ISO 8601 durations as idiff object. */ 62 | extern echs_idiff_t idiff_strp(const char *str, char **on, size_t len); 63 | 64 | /** 65 | * Print IDIFF into BUF (of size BSZ) in ISO format and return its length. */ 66 | extern size_t idiff_strf(char *restrict buf, size_t bsz, echs_idiff_t idiff); 67 | 68 | /** 69 | * Parse STR as range with the standard parser. */ 70 | extern echs_range_t range_strp(const char *str, char **on, size_t len); 71 | 72 | /** 73 | * Print RANGE into BUF (of size BSZ) in ISO format and return its length. */ 74 | extern size_t range_strf(char *restrict buf, size_t bsz, echs_range_t range); 75 | 76 | #endif /* INCLUDED_dt_strpf_h_ */ 77 | -------------------------------------------------------------------------------- /src/echsd.yuck: -------------------------------------------------------------------------------- 1 | Usage: echsd 2 | 3 | Run the echse daemon. 4 | 5 | -n, --foreground Run in foreground. 6 | --pidfile=PATH Put daemon pid in PATH. 7 | -------------------------------------------------------------------------------- /src/echse-genuid.h: -------------------------------------------------------------------------------- 1 | /*** echse-genuid.h -- uid generator 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_echse_genuid_h_ 38 | #define INCLUDED_echse_genuid_h_ 39 | 40 | #include "task.h" 41 | 42 | 43 | /* helper routines */ 44 | extern void echse_init_genuid(void); 45 | extern void echse_fini_genuid(void); 46 | 47 | extern int echse_genuid1(const char *fmt, const char *fn, bool forcep); 48 | 49 | /** 50 | * Service for the task fiddlers, generate an oid for task T. 51 | * This will not touch or update the oid slot of T. */ 52 | extern echs_toid_t echs_toid_gen(echs_task_t t); 53 | 54 | #endif /* INCLUDED_echse_genuid_h__h_ */ 55 | -------------------------------------------------------------------------------- /src/echse.h: -------------------------------------------------------------------------------- 1 | /*** echse.h -- testing echse concept 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_echse_h_ 38 | #define INCLUDED_echse_h_ 39 | 40 | #include 41 | #include 42 | #include 43 | #include "instant.h" 44 | #include "range.h" 45 | #include "dt-strpf.h" 46 | #include "event.h" 47 | #include "evstrm.h" 48 | 49 | /* auxiliary stuff that might pollute the global namespace */ 50 | #include "intern.h" 51 | #include "bufpool.h" 52 | 53 | #endif /* INCLUDED_echse_h_ */ 54 | -------------------------------------------------------------------------------- /src/echse.yuck: -------------------------------------------------------------------------------- 1 | Usage: echse ARG... 2 | 3 | Operate on echse sources. 4 | 5 | This tool has no deeper purpose other than to test the internals of the 6 | echsq and echsd tools. 7 | 8 | 9 | Usage: echse genuid [FILE]... 10 | 11 | Generate UIDs for ics FILEs. 12 | 13 | -f, --force Generate UID lines even if FILE already contains one. 14 | --format=SPEC Use SPEC as format string for UID lines: 15 | %f expands to the current filename, 16 | %x expands to the hash in hex notation 17 | 18 | 19 | Usage: echse merge [FILE]... 20 | 21 | Merge echse source FILEs and print merged output. 22 | 23 | --unroll=DT Unroll the stream to before DT first. 24 | 25 | 26 | Usage: echse unroll [FILE]... 27 | 28 | Select events and unroll recurrences in FILEs. 29 | Print the resulting stream. 30 | 31 | --from=DT Start event streams at DT. 32 | --till=DT Finish event streams by DT. 33 | --format=SPEC Output according to SPEC, a format string where 34 | - %b expands to the beginning of an event 35 | - %d expands to the first line of the description 36 | - %e expands to the end of an event 37 | - %f expands to the filename currently processed 38 | - %s expands to the summary 39 | - %u expands to the uid 40 | - %g expands to the group, which for yearly 41 | events is the year, for monthly events 42 | the month and year, etc. 43 | SPEC can also be "ical" in which case the 44 | output will be RFC 5545 compliant. 45 | The default format string is "%b\t%s" 46 | --filter=FILT Filter output by criteria given in FILT. 47 | FILT follows the syntax of RRULE parts: 48 | - BYMONTH selects only specified months 49 | - BYWEEKNO selects only specified week numbers 50 | - BYYEARDAY selects only specified days 51 | - BYMONTHDAY selects only specified days 52 | - BYDAY selects only specified days 53 | -e, --rrule=EXPR... Instead of FILE unroll rrule EXPR. 54 | -------------------------------------------------------------------------------- /src/echsq.yuck: -------------------------------------------------------------------------------- 1 | Usage: echsq COMMAND 2 | 3 | Control echse queues. 4 | 5 | -l, --list List jobs in the queue (much like crontab's -l) 6 | -n, --dry-run Do not sent tasks to echsd server. 7 | 8 | 9 | Usage: echsq add [FILE]... 10 | 11 | Add tasks from FILEs to the queue. 12 | With no FILE given and no input on stdin $EDITOR will be opened 13 | with the current machine's template. 14 | 15 | 16 | Usage: echsq cancel TUID... 17 | 18 | Cancel task with uid TUID. 19 | 20 | --next Only cancel the next run of the tasks. 21 | 22 | 23 | Usage: echsq edit TUID... 24 | 25 | Edit task with uid TUID. 26 | 27 | 28 | Usage: echsq list [TUID]... 29 | 30 | List jobs in the queue. 31 | If TUIDs are specified, restrict the listing to those. 32 | 33 | -u, --user=NAME|UID Request queue for user NAME or user id UID. 34 | --next Print task uid and the next scheduled run. 35 | --brief Print task uid and task command. 36 | 37 | 38 | Usage: echsq next [TUID]... 39 | 40 | Short form of echsq list --next. 41 | 42 | -u, --user=NAME|UID Request queue for user NAME or user id UID. 43 | -------------------------------------------------------------------------------- /src/echsx.yuck: -------------------------------------------------------------------------------- 1 | Usage: echsx 2 | 3 | Execute jobs from VTODO entries on stdin. 4 | 5 | -d, --daemon Run in daemon mode. 6 | -v, --vjournal Output job summary as VJOURNAL entry. 7 | -n, --no-run Do not run commands in VTODO. 8 | -------------------------------------------------------------------------------- /src/evcomp-gp.erf: -------------------------------------------------------------------------------- 1 | %{ 2 | typedef enum { 3 | COMP_UNK, 4 | COMP_VCAL, 5 | COMP_VEVT, 6 | COMP_VTOD, 7 | COMP_VJRN, 8 | } ical_comp_t; 9 | 10 | %} 11 | %7bit 12 | %readonly-tables 13 | %enum 14 | %switch=1 15 | %struct-type 16 | %define slot-name compstr 17 | %define hash-function-name __evical_comp_hash 18 | %define lookup-function-name __evical_comp 19 | %null-strings 20 | %compare-strncmp 21 | 22 | struct ical_comp_cell_s { 23 | const char *compstr; 24 | ical_comp_t comp; 25 | }; 26 | 27 | %% 28 | VCALENDAR, COMP_VCAL 29 | VEVENT, COMP_VEVT 30 | VTODO, COMP_VTOD 31 | VJOURNAL, COMP_VJRN 32 | -------------------------------------------------------------------------------- /src/event.c: -------------------------------------------------------------------------------- 1 | /*** event.c -- some echs_event_t functionality 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if defined HAVE_CONFIG_H 38 | # include "config.h" 39 | #endif /* HAVE_CONFIG_H */ 40 | #include "event.h" 41 | 42 | #define T echs_event_t 43 | 44 | #define compare echs_event_lt_p 45 | 46 | #include "wikisort.c" 47 | 48 | 49 | void 50 | echs_event_sort(echs_event_t *restrict ev, size_t nev) 51 | { 52 | WikiSort(ev, nev); 53 | return; 54 | } 55 | 56 | /* event.c ends here */ 57 | -------------------------------------------------------------------------------- /src/evfilt.h: -------------------------------------------------------------------------------- 1 | /*** evfilt.h -- filtering streams by events from other streams 2 | * 3 | * Copyright (C) 2014-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_evfilt_h_ 38 | #define INCLUDED_evfilt_h_ 39 | #include "evstrm.h" 40 | 41 | /** 42 | * Return a filter stream composed of events from E filtered by 43 | * events coming from X. If E's next event overlaps with X's simply 44 | * throw away E's next event and go to the next one. */ 45 | extern echs_evstrm_t make_evfilt(echs_evstrm_t e, echs_evstrm_t x); 46 | 47 | #endif /* INCLUDED_evfilt_h_ */ 48 | -------------------------------------------------------------------------------- /src/evical-gp.erf: -------------------------------------------------------------------------------- 1 | %{ 2 | typedef enum { 3 | FLD_UNK, 4 | FLD_BEGIN, 5 | FLD_END, 6 | FLD_METH, 7 | FLD_SCALE, 8 | FLD_DTSTART, 9 | FLD_DTEND, 10 | FLD_DUE, 11 | FLD_DURA, 12 | FLD_COMPL, 13 | FLD_RRULE, 14 | FLD_XRULE, 15 | FLD_RDATE, 16 | FLD_XDATE, 17 | FLD_UID, 18 | FLD_SUMM, 19 | FLD_DESC, 20 | FLD_LOC, 21 | FLD_SHELL, 22 | FLD_STATE, 23 | FLD_MRULE, 24 | FLD_MFILE, 25 | FLD_ATT, 26 | FLD_ORG, 27 | FLD_IFILE, 28 | FLD_OFILE, 29 | FLD_EFILE, 30 | FLD_MOUT, 31 | FLD_MERR, 32 | FLD_MRUN, 33 | FLD_MAX_SIMUL, 34 | FLD_RSTAT, 35 | FLD_RECURID, 36 | FLD_OWNER, 37 | FLD_UMASK, 38 | FLD_SUID, 39 | FLD_SGID, 40 | } ical_fld_t; 41 | 42 | %} 43 | %7bit 44 | %readonly-tables 45 | %enum 46 | %switch=1 47 | %struct-type 48 | %define slot-name fldstr 49 | %define hash-function-name __evical_fld_hash 50 | %define lookup-function-name __evical_fld 51 | %null-strings 52 | %compare-strncmp 53 | 54 | struct ical_fld_cell_s { 55 | const char *fldstr; 56 | ical_fld_t fld; 57 | }; 58 | 59 | %% 60 | BEGIN, FLD_BEGIN 61 | END, FLD_END 62 | METHOD, FLD_METH 63 | CALSCALE, FLD_SCALE 64 | DTSTART, FLD_DTSTART 65 | DTEND, FLD_DTEND 66 | DUE, FLD_DUE 67 | COMPLETED, FLD_COMPL 68 | DURATION, FLD_DURA 69 | RRULE, FLD_RRULE 70 | RDATE, FLD_RDATE 71 | EXRULE, FLD_XRULE 72 | EXDATE, FLD_XDATE 73 | UID, FLD_UID 74 | SUMMARY, FLD_SUMM 75 | DESCRIPTION, FLD_DESC 76 | X-GA-STATE, FLD_STATE 77 | X-GA-MRULE, FLD_MRULE 78 | X-GA-MFILE, FLD_MFILE 79 | X-ECHS-OWNER, FLD_OWNER 80 | X-ECHS-SHELL, FLD_SHELL 81 | X-ECHS-IFILE, FLD_IFILE 82 | X-ECHS-OFILE, FLD_OFILE 83 | X-ECHS-EFILE, FLD_EFILE 84 | X-ECHS-MAIL-RUN, FLD_MRUN 85 | X-ECHS-MAIL-OUT, FLD_MOUT 86 | X-ECHS-MAIL-ERR, FLD_MERR 87 | X-ECHS-MAX-SIMUL, FLD_MAX_SIMUL 88 | X-ECHS-UMASK, FLD_UMASK 89 | X-ECHS-SETUID, FLD_SUID 90 | X-ECHS-SETGID, FLD_SGID 91 | LOCATION, FLD_LOC 92 | ATTENDEE, FLD_ATT 93 | ORGANIZER, FLD_ORG 94 | REQUEST-STATUS, FLD_RSTAT 95 | RECURRENCE-ID, FLD_RECURID 96 | -------------------------------------------------------------------------------- /src/evmeth-gp.erf: -------------------------------------------------------------------------------- 1 | %{ 2 | typedef enum { 3 | METH_UNK, 4 | METH_PUBLISH, 5 | METH_REQUEST, 6 | METH_REPLY, 7 | METH_ADD, 8 | METH_CANCEL, 9 | METH_REFRESH, 10 | METH_COUNTER, 11 | METH_DECLINECOUNTER, 12 | } ical_meth_t; 13 | 14 | %} 15 | %7bit 16 | %readonly-tables 17 | %enum 18 | %switch=1 19 | %struct-type 20 | %define slot-name methstr 21 | %define hash-function-name __evical_meth_hash 22 | %define lookup-function-name __evical_meth 23 | %null-strings 24 | %compare-strncmp 25 | 26 | struct ical_meth_cell_s { 27 | const char *methstr; 28 | ical_meth_t meth; 29 | }; 30 | 31 | %% 32 | PUBLISH, METH_PUBLISH 33 | REQUEST, METH_REQUEST 34 | REPLY, METH_REPLY 35 | ADD, METH_ADD 36 | CANCEL, METH_CANCEL 37 | REFRESH, METH_REFRESH 38 | COUNTER, METH_COUNTER 39 | DECLINECOUNTER, METH_DECLINECOUNTER 40 | -------------------------------------------------------------------------------- /src/evmrul-gp.erf: -------------------------------------------------------------------------------- 1 | %{ 2 | typedef enum { 3 | MRUL_UNK, 4 | /* actual keys */ 5 | KEY_DIR, 6 | KEY_MOVEFROM, 7 | KEY_MOVEINTO, 8 | } mrul_key_t; 9 | 10 | %} 11 | %7bit 12 | %readonly-tables 13 | %enum 14 | %switch=1 15 | %struct-type 16 | %define slot-name keystr 17 | %define hash-function-name __evmrul_key_hash 18 | %define lookup-function-name __evmrul_key 19 | %null-strings 20 | %compare-strncmp 21 | 22 | struct mrul_key_cell_s { 23 | const char *keystr; 24 | mrul_key_t key; 25 | }; 26 | 27 | %% 28 | DIR, KEY_DIR 29 | MOVEFROM, KEY_MOVEFROM 30 | MOVEINTO, KEY_MOVEINTO 31 | -------------------------------------------------------------------------------- /src/evmrul.h: -------------------------------------------------------------------------------- 1 | /*** evmrul.h -- mover rules 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_evmrul_h_ 38 | #define INCLUDED_evmrul_h_ 39 | 40 | #include 41 | #include 42 | #include "state.h" 43 | #include "evstrm.h" 44 | 45 | typedef struct mrulsp_s mrulsp_t; 46 | 47 | typedef enum { 48 | MDIR_NONE, 49 | MDIR_PAST, 50 | MDIR_PASTTHENFUTURE, 51 | MDIR_FUTURE, 52 | MDIR_FUTURETHENPAST, 53 | } echs_mdir_t; 54 | 55 | struct mrulsp_s { 56 | echs_mdir_t mdir; 57 | /* set of states we allow the event to be moved into */ 58 | echs_stset_t into; 59 | /* set of states we need to move away from */ 60 | echs_stset_t from; 61 | }; 62 | 63 | 64 | /** 65 | * Turn a stream with movable events into a fixed date/time stream. */ 66 | extern echs_evstrm_t 67 | make_evmrul(const mrulsp_t*, echs_evstrm_t mov, echs_evstrm_t aux); 68 | 69 | /* serialiser */ 70 | extern void mrulsp_icalify(int whither, const mrulsp_t*); 71 | 72 | #endif /* INCLUDED_evmrul_h_ */ 73 | -------------------------------------------------------------------------------- /src/evrrul-gp.erf: -------------------------------------------------------------------------------- 1 | %{ 2 | typedef enum { 3 | KEY_UNK, 4 | /* actual keys */ 5 | KEY_FREQ, 6 | KEY_UNTIL, 7 | KEY_COUNT, 8 | KEY_INTER, 9 | KEY_WKST, 10 | KEY_SCALE, 11 | KEY_SHIFT, 12 | /* by* specs */ 13 | BY_SEC, 14 | BY_MIN, 15 | BY_HOUR, 16 | BY_WDAY, 17 | BY_MDAY, 18 | BY_YDAY, 19 | BY_WEEK, 20 | BY_MON, 21 | BY_POS, 22 | BY_EASTER, 23 | 24 | /* weekdays */ 25 | WDAY_MIR, 26 | WDAY_MON, 27 | WDAY_TUE, 28 | WDAY_WED, 29 | WDAY_THU, 30 | WDAY_FRI, 31 | WDAY_SAT, 32 | WDAY_SUN, 33 | } rrul_key_t; 34 | 35 | %} 36 | %7bit 37 | %readonly-tables 38 | %enum 39 | %switch=1 40 | %struct-type 41 | %define slot-name keystr 42 | %define hash-function-name __evrrul_key_hash 43 | %define lookup-function-name __evrrul_key 44 | %null-strings 45 | %compare-strncmp 46 | 47 | struct rrul_key_cell_s { 48 | const char *keystr; 49 | rrul_key_t key; 50 | }; 51 | 52 | %% 53 | FREQ, KEY_FREQ 54 | UNTIL, KEY_UNTIL 55 | COUNT, KEY_COUNT 56 | INTERVAL, KEY_INTER 57 | WKST, KEY_WKST 58 | SCALE, KEY_SCALE 59 | SHIFT, KEY_SHIFT 60 | BYSECOND, BY_SEC 61 | BYMINUTE, BY_MIN 62 | BYHOUR, BY_HOUR 63 | BYDAY, BY_WDAY 64 | BYMONTHDAY, BY_MDAY 65 | BYYEARDAY, BY_YDAY 66 | BYWEEKNO, BY_WEEK 67 | BYMONTH, BY_MON 68 | BYSETPOS, BY_POS 69 | BYEASTER, BY_EASTER 70 | -------------------------------------------------------------------------------- /src/hash.h: -------------------------------------------------------------------------------- 1 | /*** hash.h -- hashing strings 2 | * 3 | * Copyright (C) 2014-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_hash_h_ 38 | #define INCLUDED_hash_h_ 39 | #include 40 | 41 | /** 42 | * Unsigned integral hash type.. */ 43 | typedef uint32_t hash_t; 44 | 45 | /** 46 | * Return a hash (with the hash function du jour) of STR of size LEN. */ 47 | extern hash_t hash(const void *str, size_t len); 48 | 49 | #endif /* INCLUDED_hash_h_ */ 50 | -------------------------------------------------------------------------------- /src/instruc.h: -------------------------------------------------------------------------------- 1 | /*** instruc.h -- instructions over event streams 2 | * 3 | * Copyright (C) 2014-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_instruc_h_ 38 | #define INCLUDED_instruc_h_ 39 | 40 | #include "instant.h" 41 | #include "range.h" 42 | #include "task.h" 43 | 44 | typedef struct echs_instruc_s echs_instruc_t; 45 | 46 | typedef enum { 47 | INSVERB_UNK, 48 | /** 49 | * List all tasks (O == 0) or task with oid O. 50 | * The slots in the union are unused. */ 51 | INSVERB_LIST, 52 | /** 53 | * Schedule (create) task T with oid O. 54 | * If O == 0 generate a oid on the fly. */ 55 | INSVERB_SCHE, 56 | /** 57 | * Reschedule (update) task with oid O to specifics in T. 58 | * This verb is also used to denote a successful SCHE or RESC, 59 | * in that case the oid O is set but T is not. */ 60 | INSVERB_RESC, 61 | INSVERB_SUCC = INSVERB_RESC, 62 | /** 63 | * Unschedule (cancel) task with oid O. 64 | * This verb is also used to denote a failed SCHE or RESC, 65 | * in that case the oid is set. */ 66 | INSVERB_UNSC, 67 | INSVERB_FAIL = INSVERB_UNSC, 68 | 69 | /* non-RFC 5546 here */ 70 | /** 71 | * Return the next scheduled run for task with oid O, or all if 0. 72 | * The result will be a NEXT instruction with the INS slot set. */ 73 | INSVERB_NEXT, 74 | /** 75 | * Skip the next scheduled run for task with oid O, or all if 0. 76 | * The instant of the skipped run will be returned in FROM, the 77 | * instant the task is scheduled now at (if so) is returned in TO. */ 78 | INSVERB_SKIP, 79 | } echs_insverb_t; 80 | 81 | struct echs_instruc_s { 82 | echs_insverb_t v; 83 | echs_toid_t o; 84 | union { 85 | echs_task_t t; 86 | echs_instant_t ins; 87 | echs_range_t rng; 88 | struct { 89 | echs_instant_t from; 90 | echs_instant_t to; 91 | }; 92 | }; 93 | }; 94 | 95 | #endif /* INCLUDED_instruc_h_ */ 96 | -------------------------------------------------------------------------------- /src/intern.h: -------------------------------------------------------------------------------- 1 | /*** intern.h -- interning system 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_intern_h_ 38 | #define INCLUDED_intern_h_ 39 | 40 | #include 41 | 42 | /** 43 | * Obints are xxhash hash values, the lowest 32bit. */ 44 | typedef uint_fast32_t obint_t; 45 | 46 | /** 47 | * Return the interned representation of STR. */ 48 | extern obint_t intern(const char *str, size_t len); 49 | 50 | /** 51 | * Return the obint_t for STR of length LEN but do not intern that string. */ 52 | extern obint_t obint(const char *str, size_t len); 53 | 54 | /** 55 | * Unintern the OBINT object. */ 56 | extern void unintern(obint_t); 57 | 58 | /** 59 | * Return the string representation of an OBINT object. */ 60 | extern const char *obint_name(obint_t); 61 | 62 | /** 63 | * Clean up resources used by the interning system. */ 64 | extern void clear_interns(void); 65 | 66 | #endif /* INCLUDED_intern_h_ */ 67 | -------------------------------------------------------------------------------- /src/logger.c: -------------------------------------------------------------------------------- 1 | /*** logger.c -- logging facility 2 | * 3 | * Copyright (C) 2011-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if defined HAVE_CONFIG_H 38 | # include "config.h" 39 | #endif /* HAVE_CONFIG_H */ 40 | #include 41 | #include 42 | #include "logger.h" 43 | #include "nifty.h" 44 | 45 | void(*echs_log)(int prio, const char *fmt, ...) = syslog; 46 | 47 | 48 | void 49 | echs_errlog(int UNUSED(prio), const char *fmt, ...) 50 | { 51 | va_list ap; 52 | 53 | va_start(ap, fmt); 54 | vfprintf(stderr, fmt, ap); 55 | fputc('\n', stderr); 56 | va_end(ap); 57 | return; 58 | } 59 | 60 | /* logger.c ends here */ 61 | -------------------------------------------------------------------------------- /src/module.h: -------------------------------------------------------------------------------- 1 | /*** module.h -- module stuff 2 | * 3 | * Copyright (C) 2005-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | 38 | #if !defined INCLUDED_module_h_ 39 | #define INCLUDED_module_h_ 40 | 41 | typedef void *echs_mod_t; 42 | typedef void(*echs_mod_f)(); 43 | 44 | extern echs_mod_t echs_mod_open(const char *file); 45 | extern void echs_mod_close(echs_mod_t); 46 | extern echs_mod_f echs_mod_sym(echs_mod_t, const char *sym_name); 47 | 48 | #endif /* INCLUDED_module_h_ */ 49 | -------------------------------------------------------------------------------- /src/nifty.h: -------------------------------------------------------------------------------- 1 | /*** nifty.h -- generally handy macroes 2 | * 3 | * Copyright (C) 2009-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_nifty_h_ 38 | #define INCLUDED_nifty_h_ 39 | 40 | #if !defined LIKELY 41 | # define LIKELY(_x) __builtin_expect((_x), 1) 42 | #endif /* !LIKELY */ 43 | #if !defined UNLIKELY 44 | # define UNLIKELY(_x) __builtin_expect((_x), 0) 45 | #endif /* UNLIKELY */ 46 | 47 | #if !defined UNUSED 48 | # define UNUSED(_x) _x __attribute__((unused)) 49 | #endif /* !UNUSED */ 50 | 51 | #if !defined ALGN 52 | # define ALGN(_x, to) _x __attribute__((aligned(to))) 53 | #endif /* !ALGN */ 54 | 55 | #if !defined countof 56 | # define countof(x) (sizeof(x) / sizeof(*x)) 57 | #endif /* !countof */ 58 | 59 | #if !defined strlenof 60 | # define strlenof(lit) (sizeof(lit) - 1U) 61 | #endif /* !strlenof */ 62 | 63 | #define _paste(x, y) x ## y 64 | #define paste(x, y) _paste(x, y) 65 | 66 | #if !defined with 67 | # define with(args...) \ 68 | for (args, *paste(__ep, __LINE__) = (void*)1; \ 69 | paste(__ep, __LINE__); paste(__ep, __LINE__)= 0) 70 | #endif /* !with */ 71 | 72 | #if !defined if_with 73 | # define if_with(init, args...) \ 74 | for (init, *paste(__ep, __LINE__) = (void*)1; \ 75 | paste(__ep, __LINE__) && (args); paste(__ep, __LINE__)= 0) 76 | #endif /* !if_with */ 77 | 78 | #define once \ 79 | static int paste(__, __LINE__); \ 80 | if (!paste(__, __LINE__)++) 81 | #define but_first \ 82 | static int paste(__, __LINE__); \ 83 | if (paste(__, __LINE__)++) 84 | 85 | static __inline void* 86 | deconst(const void *cp) 87 | { 88 | union { 89 | const void *c; 90 | void *p; 91 | } tmp = {cp}; 92 | return tmp.p; 93 | } 94 | 95 | #endif /* INCLUDED_nifty_h_ */ 96 | -------------------------------------------------------------------------------- /src/nummapstr.h: -------------------------------------------------------------------------------- 1 | /*** nummapstr.h -- numerically mapped strings 2 | * 3 | * Copyright (C) 2014-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_nummapstr_h_ 38 | #define INCLUDED_nummapstr_h_ 39 | #include 40 | #include 41 | 42 | typedef uintptr_t nummapstr_t; 43 | #define NUMMAPSTR_NAN ((nummapstr_t)-1) 44 | #define NUMMAPSTR_WID (sizeof(nummapstr_t) * 8U) 45 | #define NUMMAPSTR_MSK ((nummapstr_t)1 << (NUMMAPSTR_WID - 1U)) 46 | #define NUMMAPSTR_MIN ((nummapstr_t)0) 47 | #define NUMMAPSTR_MAX ((nummapstr_t)INTPTRMAX) 48 | 49 | 50 | static inline char* 51 | nummapstr_str(nummapstr_t x) 52 | { 53 | /* Return the string in X as char*, or NULL if X is a number. */ 54 | return (x & NUMMAPSTR_MSK) ? NULL : (void*)x; 55 | } 56 | 57 | static inline uintptr_t 58 | nummapstr_num(nummapstr_t x) 59 | { 60 | /* Return the number in X as uintptr_t, or NUMMAPSTR_NAN if X is a string. */ 61 | return (x & NUMMAPSTR_MSK) ? x ^ NUMMAPSTR_MSK : NUMMAPSTR_NAN; 62 | } 63 | 64 | static inline nummapstr_t 65 | nummapstr_bang_num(uintptr_t n) 66 | { 67 | /* Return N as nummapstr_t */ 68 | return n | NUMMAPSTR_MSK; 69 | } 70 | 71 | static inline nummapstr_t 72 | nummapstr_bang_str(const char *s) 73 | { 74 | /* Return S as nummapstr_t */ 75 | return (uintptr_t)s; 76 | } 77 | 78 | #endif /* INCLUDED_nummapstr_h_ */ 79 | -------------------------------------------------------------------------------- /src/oid.h: -------------------------------------------------------------------------------- 1 | /*** oid.h -- object identifiers 2 | * 3 | * Copyright (C) 2014-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_oid_h_ 38 | #define INCLUDED_oid_h_ 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | typedef uintptr_t echs_oid_t; 45 | 46 | 47 | /* convenience */ 48 | static inline __attribute__((const, pure)) bool 49 | echs_oid_eq_p(echs_oid_t o1, echs_oid_t o2) 50 | { 51 | return o1 == o2; 52 | } 53 | 54 | #endif /* INCLUDED_oid_h_ */ 55 | -------------------------------------------------------------------------------- /src/range.c: -------------------------------------------------------------------------------- 1 | /*** range.c -- ranges over instants or idiffs 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if defined HAVE_CONFIG_H 38 | # include "config.h" 39 | #endif /* HAVE_CONFIG_H */ 40 | #include "range.h" 41 | 42 | /* range.c ends here */ 43 | -------------------------------------------------------------------------------- /src/shift.c: -------------------------------------------------------------------------------- 1 | /*** shift.c -- stream shifts 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #include 38 | #include 39 | #include 40 | #include "instant.h" 41 | #include "shift.h" 42 | 43 | /* echs_instant_shift() is defined in evrrul.c */ 44 | 45 | /* shift.c ends here */ 46 | -------------------------------------------------------------------------------- /src/sock.h: -------------------------------------------------------------------------------- 1 | /*** sock.h -- handy socket helpers 2 | * 3 | * Copyright (C) 2009-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_sock_h_ 38 | #define INCLUDED_sock_h_ 39 | 40 | static inline int 41 | fd_cloexec(int fd) 42 | { 43 | return fcntl(fd, F_SETFD, FD_CLOEXEC); 44 | } 45 | 46 | #endif /* INCLUDED_sock_h_ */ 47 | -------------------------------------------------------------------------------- /src/state.h: -------------------------------------------------------------------------------- 1 | /*** state.h -- state interning system 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_state_h_ 38 | #define INCLUDED_state_h_ 39 | 40 | #include 41 | #include 42 | 43 | /** 44 | * States are enumerated handles (from 1 to 63). */ 45 | typedef uint_fast8_t echs_state_t; 46 | 47 | /** 48 | * Stsets are bitsets of states. The lowest bit stands for the absent state, 49 | * For instance if an event does not define a state. */ 50 | typedef uint_fast64_t echs_stset_t; 51 | 52 | /** 53 | * Return the state number of STR. */ 54 | extern echs_state_t add_state(const char *str, size_t len); 55 | 56 | /** 57 | * Return the state number of STR. */ 58 | extern echs_state_t get_state(const char *str, size_t len); 59 | 60 | /** 61 | * Unintern STATE. */ 62 | extern void rem_state(echs_state_t); 63 | 64 | /** 65 | * Return the string representation of STATE. */ 66 | extern const char *state_name(echs_state_t); 67 | 68 | /** 69 | * Clean up resources used by the state interning system. */ 70 | extern void clear_states(void); 71 | 72 | 73 | static inline __attribute__((const, pure)) echs_stset_t 74 | stset_add_state(echs_stset_t set, echs_state_t st) 75 | { 76 | return set |= (uint_fast64_t)(1ULL << st); 77 | } 78 | 79 | static inline __attribute__((const, pure)) bool 80 | stset_has_state_p(echs_stset_t set, echs_state_t st) 81 | { 82 | return (set >> st) & 0b1U; 83 | } 84 | 85 | #endif /* INCLUDED_state_h_ */ 86 | -------------------------------------------------------------------------------- /src/strlst.h: -------------------------------------------------------------------------------- 1 | /*** strlst.h -- list of NULL terminated strings a la env 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if !defined INCLUDED_strlst_h_ 38 | #define INCLUDED_strlst_h_ 39 | 40 | struct strlst_s { 41 | /* pool for the strings */ 42 | char *s; 43 | /* index of next string */ 44 | size_t i; 45 | /* index of next pointer to string */ 46 | size_t nl; 47 | /* the actual char**, always NULL-terminated */ 48 | char *l[]; 49 | }; 50 | 51 | 52 | /** 53 | * Clone SL deeply. */ 54 | extern struct strlst_s *clone_strlst(const struct strlst_s *sl); 55 | 56 | /** 57 | * Add a string S to L. */ 58 | extern void strlst_add(struct strlst_s *l[static 1U], const char *s); 59 | 60 | /** 61 | * Add a string S of length N to L. */ 62 | extern void strlst_addn(struct strlst_s *l[static 1U], const char *s, size_t n); 63 | 64 | /** 65 | * String list dtor. */ 66 | extern void free_strlst(struct strlst_s *l); 67 | 68 | #endif /* INCLUDED_strlst_h_ */ 69 | -------------------------------------------------------------------------------- /src/version.c.in: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #include "version.h" 3 | 4 | const char echse_version_string[] = "YUCK_SCMVER_VERSION"; 5 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_version_h_ 2 | #define INCLUDED_version_h_ 3 | 4 | extern const char echse_version_string[]; 5 | #define package_version echse_version_string 6 | 7 | #endif /* INCLUDED_version_h_ */ 8 | -------------------------------------------------------------------------------- /src/yd.h: -------------------------------------------------------------------------------- 1 | /*** yd.h -- helpers for year-doy representation 2 | * 3 | * Copyright (C) 2010-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | **/ 37 | #if !defined INCLUDED_yd_h_ 38 | #define INCLUDED_yd_h_ 39 | 40 | #include 41 | 42 | #if !defined UNLIKELY 43 | # define UNLIKELY(_x) __builtin_expect((_x), 0) 44 | #endif /* UNLIKELY */ 45 | 46 | struct yd_s { 47 | unsigned int y; 48 | unsigned int d; 49 | }; 50 | 51 | struct md_s { 52 | unsigned int m; 53 | unsigned int d; 54 | }; 55 | 56 | 57 | static inline struct md_s 58 | __yd_to_md(struct yd_s yd) 59 | { 60 | /* stolen from dateutils */ 61 | #define GET_REM(x) (rem[x]) 62 | static const uint8_t rem[] = { 63 | 19U, 19U, 18U, 14U, 13U, 11U, 10U, 8U, 7U, 6U, 4U, 3U, 1U, 0U, 64 | }; 65 | unsigned int m; 66 | unsigned int d; 67 | unsigned int beef; 68 | unsigned int cake; 69 | 70 | /* get 32-adic doys */ 71 | m = (yd.d + 19U) / 32U; 72 | d = (yd.d + 19U) % 32U; 73 | beef = GET_REM(m); 74 | cake = GET_REM(m + 1); 75 | 76 | /* put leap years into cake */ 77 | if (UNLIKELY((yd.y % 4) == 0U && cake < 16U)) { 78 | /* note how all leap-affected cakes are < 16 */ 79 | beef += beef < 16U; 80 | cake++; 81 | } 82 | 83 | if (d <= cake) { 84 | d = yd.d - ((m - 1) * 32U - 19U + beef); 85 | } else { 86 | d = yd.d - (m++ * 32U - 19U + cake); 87 | } 88 | return (struct md_s){.m = m, .d = d}; 89 | #undef GET_REM 90 | } 91 | 92 | static inline struct yd_s 93 | __md_to_yd(unsigned int y, struct md_s md) 94 | { 95 | static uint16_t __mon_yday[] = { 96 | /* this is \sum ml */ 97 | 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 98 | }; 99 | unsigned int doy = __mon_yday[md.m - 1] + md.d + 100 | (UNLIKELY((y % 4U) == 0) && md.m >= 3U); 101 | 102 | return (struct yd_s){.y = y, .d = doy}; 103 | } 104 | 105 | #endif /* INCLUDED_yd_h_ */ 106 | -------------------------------------------------------------------------------- /test/bitint_test_01.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bituint31_t x = {0U}; 12 | 13 | x = ass_bui31(x, 19U); 14 | printf("%x\n", x); 15 | 16 | x = ass_bui31(x, 4U); 17 | printf("%x\n", x); 18 | 19 | x = ass_bui31(x, 4U); 20 | printf("%x\n", x); 21 | 22 | x = ass_bui31(x, 0U); 23 | printf("%x\n", x); 24 | x = ass_bui31(x, 1U); 25 | printf("%x\n", x); 26 | return 0; 27 | } 28 | 29 | /* bitint_test.c ends here */ 30 | -------------------------------------------------------------------------------- /test/bitint_test_01.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_01 4 | 27 5 | 100020 6 | 100020 7 | 100022 8 | 100026 9 | $ 10 | -------------------------------------------------------------------------------- /test/bitint_test_02.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bituint31_t x = {0U}; 12 | unsigned int v; 13 | 14 | x = ass_bui31(x, 19U); 15 | for (bitint_iter_t i = 0U; (v = bui31_next(&i, x), i);) { 16 | printf("got %u\n", v); 17 | } 18 | putchar('\n'); 19 | 20 | x = ass_bui31(x, 4U); 21 | for (bitint_iter_t i = 0U; (v = bui31_next(&i, x), i);) { 22 | printf("got %u\n", v); 23 | } 24 | putchar('\n'); 25 | 26 | x = ass_bui31(x, 4U); 27 | for (bitint_iter_t i = 0U; (v = bui31_next(&i, x), i);) { 28 | printf("got %u\n", v); 29 | } 30 | putchar('\n'); 31 | 32 | x = ass_bui31(x, 0U); 33 | x = ass_bui31(x, 1U); 34 | for (bitint_iter_t i = 0U; (v = bui31_next(&i, x), i);) { 35 | printf("got %u\n", v); 36 | } 37 | putchar('\n'); 38 | return 0; 39 | } 40 | 41 | /* bitint_test.c ends here */ 42 | -------------------------------------------------------------------------------- /test/bitint_test_02.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_02 4 | got 19 5 | 6 | got 4 7 | got 19 8 | 9 | got 4 10 | got 19 11 | 12 | got 0 13 | got 1 14 | got 4 15 | got 19 16 | 17 | $ 18 | -------------------------------------------------------------------------------- /test/bitint_test_03.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bitint31_t x = {0U}; 12 | 13 | x = ass_bi31(x, 19); 14 | printf("%x %x\n", x.pos, x.neg); 15 | 16 | x = ass_bi31(x, 4); 17 | printf("%x %x\n", x.pos, x.neg); 18 | 19 | x = ass_bi31(x, -4); 20 | printf("%x %x\n", x.pos, x.neg); 21 | 22 | x = ass_bi31(x, 0); 23 | printf("%x %x\n", x.pos, x.neg); 24 | x = ass_bi31(x, 1); 25 | printf("%x %x\n", x.pos, x.neg); 26 | x = ass_bi31(x, -2); 27 | printf("%x %x\n", x.pos, x.neg); 28 | return 0; 29 | } 30 | 31 | /* bitint_test.c ends here */ 32 | -------------------------------------------------------------------------------- /test/bitint_test_03.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_03 4 | 1 13 5 | 80010 0 6 | 80010 10 7 | 80010 11 8 | 80012 11 9 | 80012 15 10 | $ 11 | -------------------------------------------------------------------------------- /test/bitint_test_04.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bitint31_t x = {0U}; 12 | int v; 13 | 14 | x = ass_bi31(x, 19U); 15 | for (bitint_iter_t i = 0U; (v = bi31_next(&i, x), i);) { 16 | printf("got %d\n", v); 17 | } 18 | putchar('\n'); 19 | 20 | x = ass_bi31(x, 4U); 21 | for (bitint_iter_t i = 0U; (v = bi31_next(&i, x), i);) { 22 | printf("got %d\n", v); 23 | } 24 | putchar('\n'); 25 | 26 | x = ass_bi31(x, -4U); 27 | for (bitint_iter_t i = 0U; (v = bi31_next(&i, x), i);) { 28 | printf("got %d\n", v); 29 | } 30 | putchar('\n'); 31 | 32 | x = ass_bi31(x, 0U); 33 | x = ass_bi31(x, 1U); 34 | x = ass_bi31(x, -2U); 35 | for (bitint_iter_t i = 0U; (v = bi31_next(&i, x), i);) { 36 | printf("got %d\n", v); 37 | } 38 | putchar('\n'); 39 | return 0; 40 | } 41 | 42 | /* bitint_test.c ends here */ 43 | -------------------------------------------------------------------------------- /test/bitint_test_04.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_04 4 | got 19 5 | 6 | got 4 7 | got 19 8 | 9 | got 4 10 | got 19 11 | got -4 12 | 13 | got 0 14 | got 1 15 | got 4 16 | got 19 17 | got -2 18 | got -4 19 | 20 | $ 21 | -------------------------------------------------------------------------------- /test/bitint_test_05.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bituint63_t x = {0U}; 12 | 13 | x = ass_bui63(x, 36U); 14 | printf("%lx\n", x); 15 | 16 | x = ass_bui63(x, 40U); 17 | printf("%lx\n", x); 18 | 19 | x = ass_bui63(x, 4U); 20 | printf("%lx\n", x); 21 | 22 | x = ass_bui63(x, 0U); 23 | printf("%lx\n", x); 24 | x = ass_bui63(x, 1U); 25 | printf("%lx\n", x); 26 | return 0; 27 | } 28 | 29 | /* bitint_test.c ends here */ 30 | -------------------------------------------------------------------------------- /test/bitint_test_05.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_05 4 | 49 5 | 22000000000 6 | 22000000020 7 | 22000000022 8 | 22000000026 9 | $ 10 | -------------------------------------------------------------------------------- /test/bitint_test_06.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bituint63_t x = {0U}; 12 | unsigned int v; 13 | 14 | x = ass_bui63(x, 36U); 15 | for (bitint_iter_t i = 0U; (v = bui63_next(&i, x), i);) { 16 | printf("got %u\n", v); 17 | } 18 | putchar('\n'); 19 | 20 | x = ass_bui63(x, 40U); 21 | for (bitint_iter_t i = 0U; (v = bui63_next(&i, x), i);) { 22 | printf("got %u\n", v); 23 | } 24 | putchar('\n'); 25 | 26 | x = ass_bui63(x, 4U); 27 | for (bitint_iter_t i = 0U; (v = bui63_next(&i, x), i);) { 28 | printf("got %u\n", v); 29 | } 30 | putchar('\n'); 31 | 32 | x = ass_bui63(x, 0U); 33 | x = ass_bui63(x, 1U); 34 | for (bitint_iter_t i = 0U; (v = bui63_next(&i, x), i);) { 35 | printf("got %u\n", v); 36 | } 37 | putchar('\n'); 38 | return 0; 39 | } 40 | 41 | /* bitint_test.c ends here */ 42 | -------------------------------------------------------------------------------- /test/bitint_test_06.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_06 4 | got 36 5 | 6 | got 36 7 | got 40 8 | 9 | got 4 10 | got 36 11 | got 40 12 | 13 | got 0 14 | got 1 15 | got 4 16 | got 36 17 | got 40 18 | 19 | $ 20 | -------------------------------------------------------------------------------- /test/bitint_test_07.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bitint63_t x = {0U}; 12 | 13 | x = ass_bi63(x, 36); 14 | printf("%lx %lx\n", x.pos, x.neg); 15 | 16 | x = ass_bi63(x, 40); 17 | printf("%lx %lx\n", x.pos, x.neg); 18 | 19 | x = ass_bi63(x, -4); 20 | printf("%lx %lx\n", x.pos, x.neg); 21 | 22 | x = ass_bi63(x, 0); 23 | printf("%lx %lx\n", x.pos, x.neg); 24 | x = ass_bi63(x, 1); 25 | printf("%lx %lx\n", x.pos, x.neg); 26 | x = ass_bi63(x, -33); 27 | printf("%lx %lx\n", x.pos, x.neg); 28 | return 0; 29 | } 30 | 31 | /* bitint_test.c ends here */ 32 | -------------------------------------------------------------------------------- /test/bitint_test_07.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_07 4 | 1 24 5 | 11000000000 0 6 | 11000000000 10 7 | 11000000000 11 8 | 11000000002 11 9 | 11000000002 200000011 10 | $ 11 | -------------------------------------------------------------------------------- /test/bitint_test_08.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bitint63_t x = {0U}; 12 | int v; 13 | 14 | x = ass_bi63(x, 36U); 15 | for (bitint_iter_t i = 0U; (v = bi63_next(&i, x), i);) { 16 | printf("got %d\n", v); 17 | } 18 | putchar('\n'); 19 | 20 | x = ass_bi63(x, 40U); 21 | for (bitint_iter_t i = 0U; (v = bi63_next(&i, x), i);) { 22 | printf("got %d\n", v); 23 | } 24 | putchar('\n'); 25 | 26 | x = ass_bi63(x, -4U); 27 | for (bitint_iter_t i = 0U; (v = bi63_next(&i, x), i);) { 28 | printf("got %d\n", v); 29 | } 30 | putchar('\n'); 31 | 32 | x = ass_bi63(x, 0U); 33 | x = ass_bi63(x, 1U); 34 | x = ass_bi63(x, -33U); 35 | for (bitint_iter_t i = 0U; (v = bi63_next(&i, x), i);) { 36 | printf("got %d\n", v); 37 | } 38 | putchar('\n'); 39 | return 0; 40 | } 41 | 42 | /* bitint_test.c ends here */ 43 | -------------------------------------------------------------------------------- /test/bitint_test_08.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_08 4 | got 36 5 | 6 | got 36 7 | got 40 8 | 9 | got 36 10 | got 40 11 | got -4 12 | 13 | got 0 14 | got 1 15 | got 36 16 | got 40 17 | got -4 18 | got -33 19 | 20 | $ 21 | -------------------------------------------------------------------------------- /test/bitint_test_09.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bitint383_t x = {0U}; 12 | int v; 13 | 14 | ass_bi383(&x, 36); 15 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 16 | printf("got %d\n", v); 17 | } 18 | putchar('\n'); 19 | 20 | ass_bi383(&x, 40U); 21 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 22 | printf("got %d\n", v); 23 | } 24 | putchar('\n'); 25 | 26 | ass_bi383(&x, -4U); 27 | ass_bi383(&x, -200U); 28 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 29 | printf("got %d\n", v); 30 | } 31 | putchar('\n'); 32 | 33 | ass_bi383(&x, 0U); 34 | ass_bi383(&x, 1U); 35 | ass_bi383(&x, -33U); 36 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 37 | printf("got %d\n", v); 38 | } 39 | putchar('\n'); 40 | return 0; 41 | } 42 | 43 | /* bitint_test.c ends here */ 44 | -------------------------------------------------------------------------------- /test/bitint_test_09.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_09 4 | got 36 5 | 6 | got 36 7 | got 40 8 | 9 | got 36 10 | got 40 11 | got -4 12 | got -200 13 | 14 | got 0 15 | got 1 16 | got 36 17 | got 40 18 | got -4 19 | got -33 20 | got -200 21 | 22 | $ 23 | -------------------------------------------------------------------------------- /test/bitint_test_10.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bitint383_t x = {0U}; 12 | int v; 13 | 14 | ass_bi383(&x, 36); 15 | ass_bi383(&x, 48); 16 | ass_bi383(&x, 59); 17 | ass_bi383(&x, 61); 18 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 19 | printf("got %d\n", v); 20 | } 21 | putchar('\n'); 22 | 23 | ass_bi383(&x, 40); 24 | ass_bi383(&x, 44); 25 | ass_bi383(&x, 101); 26 | ass_bi383(&x, 72); 27 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 28 | printf("got %d\n", v); 29 | } 30 | putchar('\n'); 31 | 32 | ass_bi383(&x, 99); 33 | ass_bi383(&x, 102); 34 | ass_bi383(&x, 122); 35 | ass_bi383(&x, 133); 36 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 37 | printf("got %d\n", v); 38 | } 39 | putchar('\n'); 40 | 41 | ass_bi383(&x, 144); 42 | ass_bi383(&x, 242); 43 | ass_bi383(&x, 299); 44 | ass_bi383(&x, 302); 45 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 46 | printf("got %d\n", v); 47 | } 48 | putchar('\n'); 49 | return 0; 50 | } 51 | 52 | /* bitint_test.c ends here */ 53 | -------------------------------------------------------------------------------- /test/bitint_test_10.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_10 4 | got 36 5 | got 48 6 | got 59 7 | got 61 8 | 9 | got 36 10 | got 40 11 | got 44 12 | got 48 13 | got 59 14 | got 61 15 | got 72 16 | got 101 17 | 18 | got 36 19 | got 40 20 | got 44 21 | got 48 22 | got 59 23 | got 61 24 | got 72 25 | got 99 26 | got 101 27 | got 102 28 | got 122 29 | got 133 30 | 31 | got 36 32 | got 40 33 | got 44 34 | got 48 35 | got 59 36 | got 61 37 | got 72 38 | got 99 39 | got 101 40 | got 102 41 | got 122 42 | got 133 43 | got 144 44 | got 242 45 | got 299 46 | got 302 47 | 48 | $ 49 | -------------------------------------------------------------------------------- /test/bitint_test_11.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bitint383_t x = {0U}; 12 | int v; 13 | 14 | ass_bi383(&x, -36); 15 | ass_bi383(&x, -48); 16 | ass_bi383(&x, -59); 17 | ass_bi383(&x, -61); 18 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 19 | printf("got %d\n", v); 20 | } 21 | putchar('\n'); 22 | 23 | ass_bi383(&x, -40); 24 | ass_bi383(&x, -44); 25 | ass_bi383(&x, -101); 26 | ass_bi383(&x, -72); 27 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 28 | printf("got %d\n", v); 29 | } 30 | putchar('\n'); 31 | 32 | ass_bi383(&x, -99); 33 | ass_bi383(&x, -102); 34 | ass_bi383(&x, -122); 35 | ass_bi383(&x, -133); 36 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 37 | printf("got %d\n", v); 38 | } 39 | putchar('\n'); 40 | 41 | ass_bi383(&x, -144); 42 | ass_bi383(&x, -242); 43 | ass_bi383(&x, -299); 44 | ass_bi383(&x, -302); 45 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 46 | printf("got %d\n", v); 47 | } 48 | putchar('\n'); 49 | return 0; 50 | } 51 | 52 | /* bitint_test.c ends here */ 53 | -------------------------------------------------------------------------------- /test/bitint_test_11.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_11 4 | got -36 5 | got -48 6 | got -59 7 | got -61 8 | 9 | got -36 10 | got -40 11 | got -44 12 | got -48 13 | got -59 14 | got -61 15 | got -72 16 | got -101 17 | 18 | got -36 19 | got -40 20 | got -44 21 | got -48 22 | got -59 23 | got -61 24 | got -72 25 | got -99 26 | got -101 27 | got -102 28 | got -122 29 | got -133 30 | 31 | got -36 32 | got -40 33 | got -44 34 | got -48 35 | got -59 36 | got -61 37 | got -72 38 | got -99 39 | got -101 40 | got -102 41 | got -122 42 | got -133 43 | got -144 44 | got -242 45 | got -299 46 | got -302 47 | 48 | $ 49 | -------------------------------------------------------------------------------- /test/bitint_test_12.c: -------------------------------------------------------------------------------- 1 | #if defined HAVE_CONFIG_H 2 | # include "config.h" 3 | #endif /* HAVE_CONFIG_H */ 4 | #include 5 | #include "bitint.h" 6 | 7 | 8 | int 9 | main(int argc, char *argv[]) 10 | { 11 | bitint383_t x = {0U}; 12 | int v; 13 | 14 | ass_bi383(&x, 36); 15 | ass_bi383(&x, -48); 16 | ass_bi383(&x, 59); 17 | ass_bi383(&x, 59); 18 | ass_bi383(&x, -61); 19 | ass_bi383(&x, -61); 20 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 21 | printf("got %d\n", v); 22 | } 23 | putchar('\n'); 24 | 25 | ass_bi383(&x, 40); 26 | ass_bi383(&x, -44); 27 | ass_bi383(&x, 101); 28 | ass_bi383(&x, -72); 29 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 30 | printf("got %d\n", v); 31 | } 32 | putchar('\n'); 33 | 34 | ass_bi383(&x, 0); 35 | ass_bi383(&x, -102); 36 | ass_bi383(&x, 122); 37 | ass_bi383(&x, -133); 38 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 39 | printf("got %d\n", v); 40 | } 41 | putchar('\n'); 42 | 43 | ass_bi383(&x, -144); 44 | ass_bi383(&x, 242); 45 | ass_bi383(&x, -299); 46 | ass_bi383(&x, 302); 47 | for (bitint_iter_t i = 0U; (v = bi383_next(&i, &x), i);) { 48 | printf("got %d\n", v); 49 | } 50 | putchar('\n'); 51 | return 0; 52 | } 53 | 54 | /* bitint_test.c ends here */ 55 | -------------------------------------------------------------------------------- /test/bitint_test_12.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ bitint_test_12 4 | got 36 5 | got 59 6 | got -48 7 | got -61 8 | 9 | got 36 10 | got 40 11 | got 59 12 | got 101 13 | got -44 14 | got -48 15 | got -61 16 | got -72 17 | 18 | got 0 19 | got 36 20 | got 40 21 | got 59 22 | got 101 23 | got 122 24 | got -44 25 | got -48 26 | got -61 27 | got -72 28 | got -102 29 | got -133 30 | 31 | got 0 32 | got 36 33 | got 40 34 | got 59 35 | got 101 36 | got 122 37 | got 242 38 | got 302 39 | got -44 40 | got -48 41 | got -61 42 | got -72 43 | got -102 44 | got -133 45 | got -144 46 | got -299 47 | 48 | $ 49 | -------------------------------------------------------------------------------- /test/clitoris.am: -------------------------------------------------------------------------------- 1 | ## assumes TEST_EXTENSIONS, BUILT_SOURCES, check_PROGRAMS have been set 2 | TEST_EXTENSIONS += .clit 3 | CLIT_LOG_COMPILER = $(builddir)/clitoris 4 | 5 | ## our friendly helper 6 | check_PROGRAMS += clitoris 7 | clitoris_SOURCES = clitoris.c clitoris.yuck 8 | clitoris_CPPFLAGS = -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_BSD_SOURCE 9 | clitoris_CPPFLAGS += -D_ALL_SOURCE -D_NETBSD_SOURCE 10 | clitoris_CPPFLAGS += -UHAVE_VERSION_H 11 | clitoris_LDADD = 12 | if HAVE_PTY_H 13 | clitoris_LDADD += -lutil 14 | endif HAVE_PTY_H 15 | BUILT_SOURCES += clitoris.yucc 16 | 17 | ## yuck rule 18 | clitoris.yucc: $(srcdir)/clitoris.yuck 19 | $(AM_V_GEN) PATH=$(top_builddir)/build-aux:"$${PATH}" \ 20 | yuck$(EXEEXT) gen -o $@ $(srcdir)/clitoris.yuck 21 | -------------------------------------------------------------------------------- /test/clitoris.yuck: -------------------------------------------------------------------------------- 1 | Usage: clitoris [OPTION]... TEST_FILE 2 | 3 | Run .clit regression test files. 4 | 5 | --builddir=DIR Specify where the compiled binaries can be found. 6 | --srcdir=DIR Specify where the source tree resides. 7 | --shell=CMD Use CMD as shell command, default: /bin/sh 8 | 9 | -v, --verbose Repeat execution steps on stderr. 10 | -t, --pseudo-tty Allocate a pseudo-tty for the tests to run in. 11 | 12 | --timeout=SECS Time out after SECS seconds. 13 | 14 | -k, --keep-going Don't break on the first failure or differing output 15 | 16 | --diff=CMD Use specified diff command instead of the one in PATH. 17 | -x, --exit-code[=N] Map any non-0 exit code from the commands to N, 18 | (default: 1), or, if N is omitted, pass the exit 19 | code through as is. 20 | -------------------------------------------------------------------------------- /test/evical_prnt.c: -------------------------------------------------------------------------------- 1 | /*** evical_prnt.c -- simple icalendar parser for echse 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if defined HAVE_CONFIG_H 38 | # include "config.h" 39 | #endif /* HAVE_CONFIG_H */ 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include "echse.h" 45 | /* specifically testing the evical routines */ 46 | #include "evical.h" 47 | 48 | 49 | int 50 | main(int argc, char *argv[]) 51 | { 52 | for (int i = 1, n = 0; i < argc; i++, n = 0) { 53 | echs_evstrm_t s = make_echs_evical(argv[i]); 54 | 55 | for (echs_event_t e; 56 | !echs_event_0_p(e = echs_evstrm_next(s)); n++) { 57 | printf("VEVENT %d: %s\n", n, e.task->cmd); 58 | } 59 | free_echs_evstrm(s); 60 | } 61 | clear_interns(); 62 | clear_bufpool(); 63 | return 0; 64 | } 65 | 66 | /* evical_prnt.c ends here */ 67 | -------------------------------------------------------------------------------- /test/evical_prnt_01.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ evical_prnt "${srcdir}/sample_01.ics" "${srcdir}/sample_02.ics" 4 | VEVENT 0: March meeting 5 | VEVENT 1: Flight home 6 | VEVENT 0: New year's day 7 | VEVENT 1: Good Friday 8 | VEVENT 2: Boxing day 9 | $ 10 | -------------------------------------------------------------------------------- /test/evical_prnt_02.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ evical_prntdesc "${srcdir}/sample_01.ics" "${srcdir}/sample_02.ics" 4 | VEVENT 0: Just a catch-up thing really. 5 | VEVENT 1: Make sure to pack bags beforehand. 6 | VEVENT 0: 7 | VEVENT 1: 8 | VEVENT 2: 9 | $ 10 | -------------------------------------------------------------------------------- /test/evical_prntdesc.c: -------------------------------------------------------------------------------- 1 | /*** evical_prntdesc.c -- simple icalendar parser for echse 2 | * 3 | * Copyright (C) 2013-2020 Sebastian Freundt 4 | * 5 | * Author: Sebastian Freundt 6 | * 7 | * This file is part of echse. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * 3. Neither the name of the author nor the names of any contributors 21 | * may be used to endorse or promote products derived from this 22 | * software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 34 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ***/ 37 | #if defined HAVE_CONFIG_H 38 | # include "config.h" 39 | #endif /* HAVE_CONFIG_H */ 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include "echse.h" 45 | /* specifically testing the evical routines */ 46 | #include "evical.h" 47 | 48 | 49 | int 50 | main(int argc, char *argv[]) 51 | { 52 | for (int i = 1, n = 0; i < argc; i++, n = 0) { 53 | echs_evstrm_t s = make_echs_evical(argv[i]); 54 | 55 | for (echs_event_t e; 56 | !echs_event_0_p(e = echs_evstrm_next(s)); n++) { 57 | printf("VEVENT %d: %s\n", n, obint_name(e.sum)); 58 | } 59 | free_echs_evstrm(s); 60 | } 61 | clear_interns(); 62 | clear_bufpool(); 63 | return 0; 64 | } 65 | 66 | /* evical_prntdesc.c ends here */ 67 | -------------------------------------------------------------------------------- /test/filt_01.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## jsut select mondays 4 | $ echse unroll "${srcdir}/sample_12.ics" --filter 'BYDAY=MO' 5 | 2000-02-28 Some February Days 6 | 2000-12-25 Some December Days 7 | 2001-12-31 Some December Days 8 | 2003-12-29 Some December Days 9 | 2004-12-20 Some December Days 10 | 2005-02-28 Some February Days 11 | 2011-02-28 Some February Days 12 | $ 13 | -------------------------------------------------------------------------------- /test/filt_02.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## jsut select mondays 4 | $ echse unroll "${srcdir}/sample_12.ics" --filter 'BYMONTH=2' 5 | 2000-02-28 Some February Days 6 | 2000-02-29 Some February Days 7 | 2001-02-28 Some February Days 8 | 2002-02-28 Some February Days 9 | 2003-02-28 Some February Days 10 | 2004-02-28 Some February Days 11 | 2004-02-29 Some February Days 12 | 2005-02-28 Some February Days 13 | 2006-02-28 Some February Days 14 | 2007-02-28 Some February Days 15 | 2008-02-28 Some February Days 16 | 2008-02-29 Some February Days 17 | 2009-02-28 Some February Days 18 | 2010-02-28 Some February Days 19 | 2011-02-28 Some February Days 20 | 2012-02-28 Some February Days 21 | 2012-02-29 Some February Days 22 | 2013-02-28 Some February Days 23 | 2014-02-28 Some February Days 24 | 2015-02-28 Some February Days 25 | $ 26 | -------------------------------------------------------------------------------- /test/filt_03.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll "${srcdir}/sample_12.ics" --filter 'BYMONTHDAY=29' 4 | 2000-02-29 Some February Days 5 | 2000-12-29 Some December Days 6 | 2001-12-29 Some December Days 7 | 2002-12-29 Some December Days 8 | 2003-12-29 Some December Days 9 | 2004-02-29 Some February Days 10 | 2004-12-29 Some December Days 11 | 2008-02-29 Some February Days 12 | 2012-02-29 Some February Days 13 | $ 14 | -------------------------------------------------------------------------------- /test/filt_04.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll "${srcdir}/sample_12.ics" --filter 'BYYEARDAY=60' 4 | 2000-02-29 Some February Days 5 | 2004-02-29 Some February Days 6 | 2008-02-29 Some February Days 7 | 2012-02-29 Some February Days 8 | $ 9 | -------------------------------------------------------------------------------- /test/genuid_01.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse genuid "${srcdir}/sample_01.ics" 4 | BEGIN:VCALENDAR 5 | VERSION:1.0 6 | BEGIN:VEVENT 7 | DTSTART:20140323T090000 8 | DTEND:20140323T100000 9 | UID:echse/sample_01.ics/2bb49ee5@example.com 10 | SUMMARY:March meeting 11 | DESCRIPTION:Just a catch-up thing really. 12 | PRIORITY:3 13 | END:VEVENT 14 | BEGIN:VEVENT 15 | DTSTART:20140423T090000 16 | DTEND:20140423T120000 17 | UID:echse/sample_01.ics/d1950912@example.com 18 | SUMMARY:Flight home 19 | DESCRIPTION:Make sure to pack bags beforehand. 20 | PRIORITY:3 21 | END:VEVENT 22 | END:VCALENDAR 23 | $ 24 | -------------------------------------------------------------------------------- /test/genuid_02.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse genuid --format "%x@example.com" -f "${srcdir}/sample_02.ics" 4 | BEGIN:VCALENDAR 5 | VERSION:2.0 6 | CALSCALE:GREGORIAN 7 | BEGIN:VEVENT 8 | DTSTAMP:20140324T005526Z 9 | DTSTART;VALUE=DATE:20130329 10 | DTEND;VALUE=DATE:20130330 11 | DESCRIPTION: 12 | UID:5d1d69b3@example.com 13 | SUMMARY:Good Friday 14 | TRANSP:TRANSPARENT 15 | END:VEVENT 16 | BEGIN:VEVENT 17 | DTSTAMP:20140324T005526Z 18 | DTSTART;VALUE=DATE:20130101 19 | DTEND;VALUE=DATE:20130102 20 | DESCRIPTION: 21 | LOCATION: 22 | UID:2fccc6be@example.com 23 | SUMMARY:New year's day 24 | TRANSP:TRANSPARENT 25 | END:VEVENT 26 | BEGIN:VEVENT 27 | DTSTAMP:20140324T005526Z 28 | DTSTART;VALUE=DATE:20131226 29 | DTEND;VALUE=DATE:20131227 30 | DESCRIPTION: 31 | LOCATION: 32 | SEQUENCE:0 33 | UID:007df97a@example.com 34 | SUMMARY:Boxing day 35 | TRANSP:TRANSPARENT 36 | END:VEVENT 37 | END:VCALENDAR 38 | $ 39 | -------------------------------------------------------------------------------- /test/merge_01.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## we know DTSTAMP lines differ so filter them out 4 | $ echse merge "${srcdir}/sample_01.ics" "${srcdir}/sample_02.ics" | \ 5 | grep -vF DTSTAMP: 6 | BEGIN:VCALENDAR 7 | VERSION:2.0 8 | PRODID:-//GA Financial Solutions//echse//EN 9 | CALSCALE:GREGORIAN 10 | BEGIN:VEVENT 11 | UID:echse/autouid-0x2bb49ee5@echse 12 | SUMMARY:March meeting 13 | DESCRIPTION:Just a catch-up thing really. 14 | DTSTART:20140323T090000Z 15 | DURATION:PT1H 16 | END:VEVENT 17 | BEGIN:VEVENT 18 | UID:echse/autouid-0xd1950912@echse 19 | SUMMARY:Flight home 20 | DESCRIPTION:Make sure to pack bags beforehand. 21 | DTSTART:20140423T090000Z 22 | DURATION:PT3H 23 | END:VEVENT 24 | BEGIN:VEVENT 25 | UID:sample_02_ics_vevent_01@example.com 26 | SUMMARY:Good Friday 27 | DTSTART;VALUE=DATE:20130329 28 | DURATION:P1D 29 | END:VEVENT 30 | BEGIN:VEVENT 31 | UID:sample_02_ics_vevent_02@example.com 32 | SUMMARY:New year's day 33 | DTSTART;VALUE=DATE:20130101 34 | DURATION:P1D 35 | END:VEVENT 36 | BEGIN:VEVENT 37 | UID:sample_02_ics_vevent_03@example.com 38 | SUMMARY:Boxing day 39 | DTSTART;VALUE=DATE:20131226 40 | DURATION:P1D 41 | END:VEVENT 42 | END:VCALENDAR 43 | $ 44 | -------------------------------------------------------------------------------- /test/merge_02.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## we know DTSTAMP lines differ so filter them out 4 | $ echse merge "${srcdir}/sample_05.ics" "${srcdir}/sample_03.ics" | \ 5 | grep -vF DTSTAMP: 6 | BEGIN:VCALENDAR 7 | VERSION:2.0 8 | PRODID:-//GA Financial Solutions//echse//EN 9 | CALSCALE:GREGORIAN 10 | BEGIN:VEVENT 11 | UID:sample_05_ics_vevent_01@example.com 12 | SUMMARY:4/a 13 | DTSTART;VALUE=DATE:20000304 14 | DURATION:P0D 15 | RRULE:FREQ=YEARLY;BYMONTH=3,10;BYMONTHDAY=4,6 16 | END:VEVENT 17 | BEGIN:VEVENT 18 | UID:sample_05_ics_vevent_02@example.com 19 | SUMMARY:2/a 20 | DTSTART;VALUE=DATE:20000411 21 | DURATION:P0D 22 | RRULE:FREQ=YEARLY;BYMONTH=4,10;BYMONTHDAY=11;COUNT=7 23 | END:VEVENT 24 | BEGIN:VEVENT 25 | UID:sample_05_ics_vevent_03@example.com 26 | SUMMARY:XXX 27 | DTSTART;VALUE=DATE:20000530 28 | DURATION:P0D 29 | RRULE:FREQ=YEARLY;INTERVAL=2;BYMONTH=5,11;BYMONTHDAY=-2;UNTIL=20031231 30 | END:VEVENT 31 | BEGIN:VEVENT 32 | UID:sample_03_ics_vevent_01@example.com 33 | SUMMARY:Christmas Day 34 | DTSTART;VALUE=DATE:20001225 35 | DURATION:P0D 36 | RRULE:FREQ=YEARLY 37 | END:VEVENT 38 | BEGIN:VEVENT 39 | UID:sample_03_ics_vevent_02@example.com 40 | SUMMARY:Boxing Day 41 | DESCRIPTION:This one starts out at sometime in January. 42 | DTSTART;VALUE=DATE:20001226 43 | DURATION:P0D 44 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=26 45 | END:VEVENT 46 | END:VCALENDAR 47 | $ 48 | -------------------------------------------------------------------------------- /test/merge_03.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## we know DTSTAMP lines differ so filter them out 4 | $ echse merge "${srcdir}/sample_12a.ics" | \ 5 | grep -vF DTSTAMP: 6 | BEGIN:VCALENDAR 7 | VERSION:2.0 8 | PRODID:-//GA Financial Solutions//echse//EN 9 | CALSCALE:GREGORIAN 10 | BEGIN:VEVENT 11 | UID:sample_12_ics_vevent_01@example.com 12 | SUMMARY:Some December Days 13 | DTSTART;VALUE=DATE:20001220 14 | DURATION:P0D 15 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYPOS=1,4,-1,-3;COUNT=20 16 | END:VEVENT 17 | BEGIN:VEVENT 18 | UID:sample_12_ics_vevent_01@example.com 19 | SUMMARY:Some February Days 20 | DTSTART;VALUE=DATE:20000228 21 | DURATION:P0D 22 | RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYPOS=7,-1,-14;COUNT=20 23 | END:VEVENT 24 | END:VCALENDAR 25 | $ 26 | -------------------------------------------------------------------------------- /test/merge_04.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## we know DTSTAMP lines differ so filter them out 4 | $ echse merge "${srcdir}/sample_12b.ics" | \ 5 | grep -vF DTSTAMP: 6 | BEGIN:VCALENDAR 7 | VERSION:2.0 8 | PRODID:-//GA Financial Solutions//echse//EN 9 | CALSCALE:GREGORIAN 10 | BEGIN:VEVENT 11 | UID:sample_12_ics_vevent_01@example.com 12 | SUMMARY:Some Feb/Dec Days 13 | DTSTART;VALUE=DATE:20000228 14 | DURATION:P0D 15 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYPOS=1,4,-1,-3;COUNT=20 16 | RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYPOS=7,-1,-14;COUNT=20 17 | END:VEVENT 18 | END:VCALENDAR 19 | $ 20 | -------------------------------------------------------------------------------- /test/mrul_01.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --from 2014-01-01 --till 2014-03-31 "${srcdir}/sample_25.ics" 4 | 2014-01-16 TRADE? 5 | 2014-02-20 TRADE? 6 | 2014-03-20 TRADE? 7 | $ 8 | -------------------------------------------------------------------------------- /test/mrul_02.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --from 2014-01-01 --till 2014-03-31 "${srcdir}/sample_24.ics" "${srcdir}/sample_25.ics" 4 | 2014-01-03 NOTRADE 5 | 2014-01-04 NOTRADE 6 | 2014-01-05 NOTRADE 7 | 2014-01-10 NOTRADE 8 | 2014-01-11 NOTRADE 9 | 2014-01-12 NOTRADE 10 | 2014-01-16 TRADE? 11 | 2014-01-17 NOTRADE 12 | 2014-01-18 NOTRADE 13 | 2014-01-19 NOTRADE 14 | 2014-01-24 NOTRADE 15 | 2014-01-25 NOTRADE 16 | 2014-01-26 NOTRADE 17 | 2014-01-31 NOTRADE 18 | 2014-02-01 NOTRADE 19 | 2014-02-02 NOTRADE 20 | 2014-02-07 NOTRADE 21 | 2014-02-08 NOTRADE 22 | 2014-02-09 NOTRADE 23 | 2014-02-14 NOTRADE 24 | 2014-02-15 NOTRADE 25 | 2014-02-16 NOTRADE 26 | 2014-02-20 TRADE? 27 | 2014-02-21 NOTRADE 28 | 2014-02-22 NOTRADE 29 | 2014-02-23 NOTRADE 30 | 2014-02-28 NOTRADE 31 | 2014-03-01 NOTRADE 32 | 2014-03-02 NOTRADE 33 | 2014-03-07 NOTRADE 34 | 2014-03-08 NOTRADE 35 | 2014-03-09 NOTRADE 36 | 2014-03-14 NOTRADE 37 | 2014-03-15 NOTRADE 38 | 2014-03-16 NOTRADE 39 | 2014-03-20 TRADE? 40 | 2014-03-21 NOTRADE 41 | 2014-03-22 NOTRADE 42 | 2014-03-23 NOTRADE 43 | 2014-03-28 NOTRADE 44 | 2014-03-29 NOTRADE 45 | 2014-03-30 NOTRADE 46 | $ 47 | -------------------------------------------------------------------------------- /test/mrul_03.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --from 2014-01-01 --till 2014-03-31 "${srcdir}/sample_26.ics" 4 | 2014-01-20 TRADE? 5 | 2014-02-24 TRADE? 6 | 2014-03-24 TRADE? 7 | $ 8 | -------------------------------------------------------------------------------- /test/mrul_04.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --from 2014-01-01 --till 2014-03-31 "${srcdir}/sample_24.ics" "${srcdir}/sample_26.ics" 4 | 2014-01-03 NOTRADE 5 | 2014-01-04 NOTRADE 6 | 2014-01-05 NOTRADE 7 | 2014-01-10 NOTRADE 8 | 2014-01-11 NOTRADE 9 | 2014-01-12 NOTRADE 10 | 2014-01-17 NOTRADE 11 | 2014-01-18 NOTRADE 12 | 2014-01-19 NOTRADE 13 | 2014-01-20 TRADE? 14 | 2014-01-24 NOTRADE 15 | 2014-01-25 NOTRADE 16 | 2014-01-26 NOTRADE 17 | 2014-01-31 NOTRADE 18 | 2014-02-01 NOTRADE 19 | 2014-02-02 NOTRADE 20 | 2014-02-07 NOTRADE 21 | 2014-02-08 NOTRADE 22 | 2014-02-09 NOTRADE 23 | 2014-02-14 NOTRADE 24 | 2014-02-15 NOTRADE 25 | 2014-02-16 NOTRADE 26 | 2014-02-21 NOTRADE 27 | 2014-02-22 NOTRADE 28 | 2014-02-23 NOTRADE 29 | 2014-02-24 TRADE? 30 | 2014-02-28 NOTRADE 31 | 2014-03-01 NOTRADE 32 | 2014-03-02 NOTRADE 33 | 2014-03-07 NOTRADE 34 | 2014-03-08 NOTRADE 35 | 2014-03-09 NOTRADE 36 | 2014-03-14 NOTRADE 37 | 2014-03-15 NOTRADE 38 | 2014-03-16 NOTRADE 39 | 2014-03-21 NOTRADE 40 | 2014-03-22 NOTRADE 41 | 2014-03-23 NOTRADE 42 | 2014-03-24 TRADE? 43 | 2014-03-28 NOTRADE 44 | 2014-03-29 NOTRADE 45 | 2014-03-30 NOTRADE 46 | $ 47 | -------------------------------------------------------------------------------- /test/rrul_01.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_01.ics" 4 | 2014-03-23T09:00:00 March meeting 5 | 2014-04-23T09:00:00 Flight home 6 | $ 7 | -------------------------------------------------------------------------------- /test/rrul_02.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_02.ics" 4 | 2013-01-01 New year's day 5 | 2013-03-29 Good Friday 6 | 2013-12-26 Boxing day 7 | $ 8 | -------------------------------------------------------------------------------- /test/rrul_03.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_02.ics" "${srcdir}/sample_01.ics" 4 | 2013-01-01 New year's day 5 | 2013-03-29 Good Friday 6 | 2013-12-26 Boxing day 7 | 2014-03-23T09:00:00 March meeting 8 | 2014-04-23T09:00:00 Flight home 9 | $ 10 | -------------------------------------------------------------------------------- /test/rrul_04.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" --from 2014-01-01 "${srcdir}/sample_02.ics" "${srcdir}/sample_01.ics" 4 | 2014-03-23T09:00:00 March meeting 5 | 2014-04-23T09:00:00 Flight home 6 | $ 7 | -------------------------------------------------------------------------------- /test/rrul_05.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" --till 2015-12-31 "${srcdir}/sample_03.ics" 4 | 2000-12-25 Christmas Day 5 | 2000-12-26 Boxing Day 6 | 2001-12-25 Christmas Day 7 | 2001-12-26 Boxing Day 8 | 2002-12-25 Christmas Day 9 | 2002-12-26 Boxing Day 10 | 2003-12-25 Christmas Day 11 | 2003-12-26 Boxing Day 12 | 2004-12-25 Christmas Day 13 | 2004-12-26 Boxing Day 14 | 2005-12-25 Christmas Day 15 | 2005-12-26 Boxing Day 16 | 2006-12-25 Christmas Day 17 | 2006-12-26 Boxing Day 18 | 2007-12-25 Christmas Day 19 | 2007-12-26 Boxing Day 20 | 2008-12-25 Christmas Day 21 | 2008-12-26 Boxing Day 22 | 2009-12-25 Christmas Day 23 | 2009-12-26 Boxing Day 24 | 2010-12-25 Christmas Day 25 | 2010-12-26 Boxing Day 26 | 2011-12-25 Christmas Day 27 | 2011-12-26 Boxing Day 28 | 2012-12-25 Christmas Day 29 | 2012-12-26 Boxing Day 30 | 2013-12-25 Christmas Day 31 | 2013-12-26 Boxing Day 32 | 2014-12-25 Christmas Day 33 | 2014-12-26 Boxing Day 34 | 2015-12-25 Christmas Day 35 | 2015-12-26 Boxing Day 36 | $ 37 | -------------------------------------------------------------------------------- /test/rrul_06.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_04.ics" 4 | 2000-02-29 Leap Day 5 | 2000-02-29 Leap Day 2 6 | 2004-02-29 Leap Day 7 | 2004-02-29 Leap Day 2 8 | 2008-02-29 Leap Day 9 | 2008-02-29 Leap Day 2 10 | 2012-02-29 Leap Day 11 | 2012-02-29 Leap Day 2 12 | 2016-02-29 Leap Day 13 | 2016-02-29 Leap Day 2 14 | 2020-02-29 Leap Day 15 | 2020-02-29 Leap Day 2 16 | 2024-02-29 Leap Day 17 | 2028-02-29 Leap Day 18 | 2032-02-29 Leap Day 19 | $ 20 | -------------------------------------------------------------------------------- /test/rrul_07.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" --till 2005-12-31 "${srcdir}/sample_05.ics" 4 | 2000-03-04 4/a 5 | 2000-03-06 4/a 6 | 2000-04-11 2/a 7 | 2000-05-30 XXX 8 | 2000-10-04 4/a 9 | 2000-10-06 4/a 10 | 2000-10-11 2/a 11 | 2000-11-29 XXX 12 | 2001-03-04 4/a 13 | 2001-03-06 4/a 14 | 2001-04-11 2/a 15 | 2001-10-04 4/a 16 | 2001-10-06 4/a 17 | 2001-10-11 2/a 18 | 2002-03-04 4/a 19 | 2002-03-06 4/a 20 | 2002-04-11 2/a 21 | 2002-05-30 XXX 22 | 2002-10-04 4/a 23 | 2002-10-06 4/a 24 | 2002-10-11 2/a 25 | 2002-11-29 XXX 26 | 2003-03-04 4/a 27 | 2003-03-06 4/a 28 | 2003-04-11 2/a 29 | 2003-10-04 4/a 30 | 2003-10-06 4/a 31 | 2004-03-04 4/a 32 | 2004-03-06 4/a 33 | 2004-10-04 4/a 34 | 2004-10-06 4/a 35 | 2005-03-04 4/a 36 | 2005-03-06 4/a 37 | 2005-10-04 4/a 38 | 2005-10-06 4/a 39 | $ 40 | -------------------------------------------------------------------------------- /test/rrul_08.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" --till 2005-12-31 "${srcdir}/sample_05.ics" "${srcdir}/sample_03.ics" 4 | 2000-03-04 4/a 5 | 2000-03-06 4/a 6 | 2000-04-11 2/a 7 | 2000-05-30 XXX 8 | 2000-10-04 4/a 9 | 2000-10-06 4/a 10 | 2000-10-11 2/a 11 | 2000-11-29 XXX 12 | 2000-12-25 Christmas Day 13 | 2000-12-26 Boxing Day 14 | 2001-03-04 4/a 15 | 2001-03-06 4/a 16 | 2001-04-11 2/a 17 | 2001-10-04 4/a 18 | 2001-10-06 4/a 19 | 2001-10-11 2/a 20 | 2001-12-25 Christmas Day 21 | 2001-12-26 Boxing Day 22 | 2002-03-04 4/a 23 | 2002-03-06 4/a 24 | 2002-04-11 2/a 25 | 2002-05-30 XXX 26 | 2002-10-04 4/a 27 | 2002-10-06 4/a 28 | 2002-10-11 2/a 29 | 2002-11-29 XXX 30 | 2002-12-25 Christmas Day 31 | 2002-12-26 Boxing Day 32 | 2003-03-04 4/a 33 | 2003-03-06 4/a 34 | 2003-04-11 2/a 35 | 2003-10-04 4/a 36 | 2003-10-06 4/a 37 | 2003-12-25 Christmas Day 38 | 2003-12-26 Boxing Day 39 | 2004-03-04 4/a 40 | 2004-03-06 4/a 41 | 2004-10-04 4/a 42 | 2004-10-06 4/a 43 | 2004-12-25 Christmas Day 44 | 2004-12-26 Boxing Day 45 | 2005-03-04 4/a 46 | 2005-03-06 4/a 47 | 2005-10-04 4/a 48 | 2005-10-06 4/a 49 | 2005-12-25 Christmas Day 50 | 2005-12-26 Boxing Day 51 | $ 52 | -------------------------------------------------------------------------------- /test/rrul_09.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" --till 2009-12-31 "${srcdir}/sample_06.ics" 4 | 2000-04-18 YWD example (neg) 5 | 2000-04-24 YWD example 6 | 2001-04-17 YWD example (neg) 7 | 2001-04-23 YWD example 8 | 2002-04-16 YWD example (neg) 9 | 2002-04-22 YWD example 10 | 2003-04-15 YWD example (neg) 11 | 2003-04-21 YWD example 12 | 2004-04-19 YWD example 13 | 2004-04-20 YWD example (neg) 14 | 2005-04-19 YWD example (neg) 15 | 2005-04-25 YWD example 16 | 2006-04-18 YWD example (neg) 17 | 2006-04-24 YWD example 18 | 2007-04-17 YWD example (neg) 19 | 2007-04-23 YWD example 20 | 2008-04-15 YWD example (neg) 21 | 2008-04-21 YWD example 22 | 2009-04-20 YWD example 23 | 2009-04-21 YWD example (neg) 24 | $ 25 | -------------------------------------------------------------------------------- /test/rrul_10.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" --till 2009-12-31 "${srcdir}/sample_07.ics" 4 | 2000-04-17 YWD example 5 | 2000-04-24 YWD example 6 | 2001-04-16 YWD example 7 | 2001-04-23 YWD example 8 | 2002-04-15 YWD example 9 | 2002-04-22 YWD example 10 | 2003-04-14 YWD example 11 | 2003-04-21 YWD example 12 | 2004-04-19 YWD example 13 | 2005-04-18 YWD example 14 | 2005-04-25 YWD example 15 | 2006-04-17 YWD example 16 | 2006-04-24 YWD example 17 | 2007-04-16 YWD example 18 | 2007-04-23 YWD example 19 | 2008-04-14 YWD example 20 | 2008-04-21 YWD example 21 | 2009-04-20 YWD example 22 | $ 23 | -------------------------------------------------------------------------------- /test/rrul_11.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" --till 2005-12-31 "${srcdir}/sample_08.ics" 4 | 2000-04-17 YWD example 5 | 2000-04-23 YWD example 6 | 2000-04-24 YWD example 7 | 2000-04-30 YWD example 8 | 2001-04-16 YWD example 9 | 2001-04-22 YWD example 10 | 2001-04-23 YWD example 11 | 2001-04-29 YWD example 12 | 2002-04-15 YWD example 13 | 2002-04-21 YWD example 14 | 2002-04-22 YWD example 15 | 2002-04-28 YWD example 16 | 2003-04-14 YWD example 17 | 2003-04-20 YWD example 18 | 2003-04-21 YWD example 19 | 2003-04-27 YWD example 20 | 2004-04-19 YWD example 21 | 2004-04-25 YWD example 22 | 2005-04-18 YWD example 23 | 2005-04-24 YWD example 24 | 2005-04-25 YWD example 25 | 2005-05-01 YWD example 26 | $ 27 | -------------------------------------------------------------------------------- /test/rrul_12.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" --till 2005-12-31 "${srcdir}/sample_08.ics" "${srcdir}/sample_07.ics" 4 | 2000-04-17 YWD example 5 | 2000-04-17 YWD example 6 | 2000-04-23 YWD example 7 | 2000-04-24 YWD example 8 | 2000-04-24 YWD example 9 | 2000-04-30 YWD example 10 | 2001-04-16 YWD example 11 | 2001-04-16 YWD example 12 | 2001-04-22 YWD example 13 | 2001-04-23 YWD example 14 | 2001-04-23 YWD example 15 | 2001-04-29 YWD example 16 | 2002-04-15 YWD example 17 | 2002-04-15 YWD example 18 | 2002-04-21 YWD example 19 | 2002-04-22 YWD example 20 | 2002-04-22 YWD example 21 | 2002-04-28 YWD example 22 | 2003-04-14 YWD example 23 | 2003-04-14 YWD example 24 | 2003-04-20 YWD example 25 | 2003-04-21 YWD example 26 | 2003-04-21 YWD example 27 | 2003-04-27 YWD example 28 | 2004-04-19 YWD example 29 | 2004-04-19 YWD example 30 | 2004-04-25 YWD example 31 | 2005-04-18 YWD example 32 | 2005-04-18 YWD example 33 | 2005-04-24 YWD example 34 | 2005-04-25 YWD example 35 | 2005-04-25 YWD example 36 | 2005-05-01 YWD example 37 | $ 38 | -------------------------------------------------------------------------------- /test/rrul_13.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_09.ics" 4 | 2000-03-26 YMCW example 5 | 2000-10-29 YMCW example 6 | 2001-03-25 YMCW example 7 | 2001-10-28 YMCW example 8 | 2002-03-31 YMCW example 9 | 2002-10-27 YMCW example 10 | 2003-03-30 YMCW example 11 | 2003-10-26 YMCW example 12 | 2004-03-28 YMCW example 13 | 2004-05-30 YMCW example 2 14 | 2004-10-31 YMCW example 15 | 2005-03-27 YMCW example 16 | 2005-05-29 YMCW example 2 17 | 2005-10-30 YMCW example 18 | 2006-03-26 YMCW example 19 | 2006-10-29 YMCW example 20 | 2007-03-25 YMCW example 21 | 2007-10-28 YMCW example 22 | 2008-03-30 YMCW example 23 | 2008-10-26 YMCW example 24 | 2009-03-29 YMCW example 25 | 2009-05-31 YMCW example 2 26 | 2009-10-25 YMCW example 27 | 2010-03-28 YMCW example 28 | 2010-05-30 YMCW example 2 29 | 2010-10-31 YMCW example 30 | 2011-03-27 YMCW example 31 | 2011-05-29 YMCW example 2 32 | 2011-10-30 YMCW example 33 | 2015-05-31 YMCW example 2 34 | 2016-05-29 YMCW example 2 35 | 2020-05-31 YMCW example 2 36 | 2021-05-30 YMCW example 2 37 | 2022-05-29 YMCW example 2 38 | 2026-05-31 YMCW example 2 39 | 2027-05-30 YMCW example 2 40 | $ 41 | -------------------------------------------------------------------------------- /test/rrul_14.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_10.ics" 4 | 2000-01-30 YCW example 2 5 | 2000-12-31 YCW example 6 | 2001-02-04 YCW example 2 7 | 2001-12-30 YCW example 8 | 2002-02-03 YCW example 2 9 | 2002-12-29 YCW example 10 | 2003-02-02 YCW example 2 11 | 2003-12-28 YCW example 12 | 2004-02-01 YCW example 2 13 | 2004-12-26 YCW example 14 | 2005-01-30 YCW example 2 15 | 2005-12-25 YCW example 16 | 2006-01-29 YCW example 2 17 | 2006-12-31 YCW example 18 | 2007-02-04 YCW example 2 19 | 2007-12-30 YCW example 20 | 2008-02-03 YCW example 2 21 | 2008-12-28 YCW example 22 | 2009-02-01 YCW example 2 23 | 2009-12-27 YCW example 24 | 2010-01-31 YCW example 2 25 | 2010-12-26 YCW example 26 | 2011-01-30 YCW example 2 27 | 2011-12-25 YCW example 28 | 2012-12-30 YCW example 29 | 2013-12-29 YCW example 30 | 2014-12-28 YCW example 31 | 2015-12-27 YCW example 32 | 2016-12-25 YCW example 33 | 2017-12-31 YCW example 34 | 2018-12-30 YCW example 35 | 2019-12-29 YCW example 36 | 2020-12-27 YCW example 37 | 2021-12-26 YCW example 38 | 2022-12-25 YCW example 39 | 2023-12-31 YCW example 40 | $ 41 | -------------------------------------------------------------------------------- /test/rrul_15.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_11.ics" 4 | 2000-04-21 Gregorian Easter minus 2 5 | 2000-04-23 Gregorian Easter Sunday/Monday 6 | 2000-04-24 Gregorian Easter Sunday/Monday 7 | 2001-04-13 Gregorian Easter minus 2 8 | 2001-04-15 Gregorian Easter Sunday/Monday 9 | 2001-04-16 Gregorian Easter Sunday/Monday 10 | 2002-03-29 Gregorian Easter minus 2 11 | 2002-03-31 Gregorian Easter Sunday/Monday 12 | 2002-04-01 Gregorian Easter Sunday/Monday 13 | 2003-04-18 Gregorian Easter minus 2 14 | 2003-04-20 Gregorian Easter Sunday/Monday 15 | 2003-04-21 Gregorian Easter Sunday/Monday 16 | 2004-04-09 Gregorian Easter minus 2 17 | 2004-04-11 Gregorian Easter Sunday/Monday 18 | 2004-04-12 Gregorian Easter Sunday/Monday 19 | 2005-03-25 Gregorian Easter minus 2 20 | 2005-03-27 Gregorian Easter Sunday/Monday 21 | 2005-03-28 Gregorian Easter Sunday/Monday 22 | 2006-04-14 Gregorian Easter minus 2 23 | 2006-04-16 Gregorian Easter Sunday/Monday 24 | 2006-04-17 Gregorian Easter Sunday/Monday 25 | 2007-04-06 Gregorian Easter minus 2 26 | 2007-04-08 Gregorian Easter Sunday/Monday 27 | 2007-04-09 Gregorian Easter Sunday/Monday 28 | 2008-03-21 Gregorian Easter minus 2 29 | 2008-03-23 Gregorian Easter Sunday/Monday 30 | 2008-03-24 Gregorian Easter Sunday/Monday 31 | 2009-04-10 Gregorian Easter minus 2 32 | 2009-04-12 Gregorian Easter Sunday/Monday 33 | 2009-04-13 Gregorian Easter Sunday/Monday 34 | 2010-04-02 Gregorian Easter minus 2 35 | 2010-04-04 Gregorian Easter Sunday/Monday 36 | 2010-04-05 Gregorian Easter Sunday/Monday 37 | 2011-04-22 Gregorian Easter minus 2 38 | 2011-04-24 Gregorian Easter Sunday/Monday 39 | 2011-04-25 Gregorian Easter Sunday/Monday 40 | 2012-04-06 Gregorian Easter minus 2 41 | 2012-04-08 Gregorian Easter Sunday/Monday 42 | 2012-04-09 Gregorian Easter Sunday/Monday 43 | 2013-03-29 Gregorian Easter minus 2 44 | 2013-03-31 Gregorian Easter Sunday/Monday 45 | 2013-04-01 Gregorian Easter Sunday/Monday 46 | 2014-04-18 Gregorian Easter minus 2 47 | 2014-04-20 Gregorian Easter Sunday/Monday 48 | 2014-04-21 Gregorian Easter Sunday/Monday 49 | 2015-04-03 Gregorian Easter minus 2 50 | 2015-04-05 Gregorian Easter Sunday/Monday 51 | 2015-04-06 Gregorian Easter Sunday/Monday 52 | 2016-03-25 Gregorian Easter minus 2 53 | 2016-03-27 Gregorian Easter Sunday/Monday 54 | 2016-03-28 Gregorian Easter Sunday/Monday 55 | 2017-04-14 Gregorian Easter minus 2 56 | 2017-04-16 Gregorian Easter Sunday/Monday 57 | 2017-04-17 Gregorian Easter Sunday/Monday 58 | 2018-03-30 Gregorian Easter minus 2 59 | 2018-04-01 Gregorian Easter Sunday/Monday 60 | 2018-04-02 Gregorian Easter Sunday/Monday 61 | 2019-04-19 Gregorian Easter minus 2 62 | 2019-04-21 Gregorian Easter Sunday/Monday 63 | 2019-04-22 Gregorian Easter Sunday/Monday 64 | 2020-04-10 Gregorian Easter minus 2 65 | 2020-04-12 Gregorian Easter Sunday/Monday 66 | 2020-04-13 Gregorian Easter Sunday/Monday 67 | 2021-04-02 Gregorian Easter minus 2 68 | 2021-04-04 Gregorian Easter Sunday/Monday 69 | 2021-04-05 Gregorian Easter Sunday/Monday 70 | 2022-04-15 Gregorian Easter minus 2 71 | 2022-04-17 Gregorian Easter Sunday/Monday 72 | 2022-04-18 Gregorian Easter Sunday/Monday 73 | 2023-04-07 Gregorian Easter minus 2 74 | 2023-04-09 Gregorian Easter Sunday/Monday 75 | 2023-04-10 Gregorian Easter Sunday/Monday 76 | $ 77 | -------------------------------------------------------------------------------- /test/rrul_16.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_12.ics" 4 | 2000-02-28 Some February Days 5 | 2000-02-29 Some February Days 6 | 2000-12-20 Some December Days 7 | 2000-12-25 Some December Days 8 | 2000-12-29 Some December Days 9 | 2000-12-31 Some December Days 10 | 2001-02-28 Some February Days 11 | 2001-12-20 Some December Days 12 | 2001-12-25 Some December Days 13 | 2001-12-29 Some December Days 14 | 2001-12-31 Some December Days 15 | 2002-02-28 Some February Days 16 | 2002-12-20 Some December Days 17 | 2002-12-25 Some December Days 18 | 2002-12-29 Some December Days 19 | 2002-12-31 Some December Days 20 | 2003-02-28 Some February Days 21 | 2003-12-20 Some December Days 22 | 2003-12-25 Some December Days 23 | 2003-12-29 Some December Days 24 | 2003-12-31 Some December Days 25 | 2004-02-28 Some February Days 26 | 2004-02-29 Some February Days 27 | 2004-12-20 Some December Days 28 | 2004-12-25 Some December Days 29 | 2004-12-29 Some December Days 30 | 2004-12-31 Some December Days 31 | 2005-02-28 Some February Days 32 | 2006-02-28 Some February Days 33 | 2007-02-28 Some February Days 34 | 2008-02-28 Some February Days 35 | 2008-02-29 Some February Days 36 | 2009-02-28 Some February Days 37 | 2010-02-28 Some February Days 38 | 2011-02-28 Some February Days 39 | 2012-02-28 Some February Days 40 | 2012-02-29 Some February Days 41 | 2013-02-28 Some February Days 42 | 2014-02-28 Some February Days 43 | 2015-02-28 Some February Days 44 | $ 45 | -------------------------------------------------------------------------------- /test/rrul_17.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitors ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_13.ics" 4 | 2001-12-24 Some December Monday 5 | 2003-12-22 Some December Monday 6 | 2004-02-29 Some February Leap Sunday 7 | 2004-02-29 60th Day And Sunday 8 | 2004-12-20 Some December Monday 9 | 2007-12-24 Some December Monday 10 | 2008-12-22 Some December Monday 11 | 2009-03-01 60th Day And Sunday 12 | 2010-12-20 Some December Monday 13 | 2012-12-24 Some December Monday 14 | 2014-12-22 Some December Monday 15 | 2015-03-01 60th Day And Sunday 16 | 2018-12-24 Some December Monday 17 | 2021-12-20 Some December Monday 18 | 2026-03-01 60th Day And Sunday 19 | 2032-02-29 Some February Leap Sunday 20 | $ 21 | -------------------------------------------------------------------------------- /test/rrul_18.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_14.ics" 4 | 2000-12-04 Some December Monday 5 | 2001-12-24 Some December Monday 6 | 2002-12-02 Some December Monday 7 | 2003-12-22 Some December Monday 8 | 2004-12-06 Some December Monday 9 | 2004-12-20 Some December Monday 10 | 2006-12-04 Some December Monday 11 | 2007-12-24 Some December Monday 12 | 2008-12-22 Some December Monday 13 | 2010-12-06 Some December Monday 14 | 2010-12-20 Some December Monday 15 | 2012-12-24 Some December Monday 16 | 2013-12-02 Some December Monday 17 | 2014-12-22 Some December Monday 18 | 2017-12-04 Some December Monday 19 | 2018-12-24 Some December Monday 20 | 2019-12-02 Some December Monday 21 | 2021-12-06 Some December Monday 22 | 2021-12-20 Some December Monday 23 | 2023-12-04 Some December Monday 24 | $ 25 | -------------------------------------------------------------------------------- /test/rrul_19.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --from 2000-01-01 --format "%b\t%s" "${srcdir}/sample_15.ics" --till 2020-12-31 4 | 2000-12-25 Christmas Day 5 | 2000-12-26 Boxing Day 6 | 2001-12-25 Christmas Day 7 | 2001-12-26 Boxing Day 8 | 2002-12-25 Christmas Day 9 | 2002-12-26 Boxing Day 10 | 2003-12-25 Christmas Day 11 | 2003-12-26 Boxing Day 12 | 2004-12-27 Christmas Day 13 | 2004-12-28 Boxing Day 14 | 2005-12-26 Boxing Day 15 | 2005-12-27 Christmas Day 16 | 2006-12-25 Christmas Day 17 | 2006-12-26 Boxing Day 18 | 2007-12-25 Christmas Day 19 | 2007-12-26 Boxing Day 20 | 2008-12-25 Christmas Day 21 | 2008-12-26 Boxing Day 22 | 2009-12-25 Christmas Day 23 | 2009-12-28 Boxing Day 24 | 2010-12-27 Christmas Day 25 | 2010-12-28 Boxing Day 26 | 2011-12-26 Boxing Day 27 | 2011-12-27 Christmas Day 28 | 2012-12-25 Christmas Day 29 | 2012-12-26 Boxing Day 30 | 2013-12-25 Christmas Day 31 | 2013-12-26 Boxing Day 32 | 2014-12-25 Christmas Day 33 | 2014-12-26 Boxing Day 34 | 2015-12-25 Christmas Day 35 | 2015-12-28 Boxing Day 36 | 2016-12-26 Boxing Day 37 | 2016-12-27 Christmas Day 38 | 2017-12-25 Christmas Day 39 | 2017-12-26 Boxing Day 40 | 2018-12-25 Christmas Day 41 | 2018-12-26 Boxing Day 42 | 2019-12-25 Christmas Day 43 | 2019-12-26 Boxing Day 44 | 2020-12-25 Christmas Day 45 | 2020-12-28 Boxing Day 46 | $ 47 | -------------------------------------------------------------------------------- /test/rrul_20.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --from 2000-01-01 --format "%b\t%s" "${srcdir}/sample_16.ics" --till 2014-12-31 4 | 2000-05-29 Spring Bank Holiday 5 | 2001-05-28 Spring Bank Holiday 6 | 2002-05-27 Spring Bank Holiday 7 | 2003-05-26 Spring Bank Holiday 8 | 2004-05-31 Spring Bank Holiday 9 | 2005-05-30 Spring Bank Holiday 10 | 2006-05-29 Spring Bank Holiday 11 | 2007-05-28 Spring Bank Holiday 12 | 2008-05-26 Spring Bank Holiday 13 | 2009-05-25 Spring Bank Holiday 14 | 2010-05-31 Spring Bank Holiday 15 | 2011-05-30 Spring Bank Holiday 16 | 2012-06-04 Spring Bank Holiday (in-lieu of 2012-05-28) 17 | 2013-05-27 Spring Bank Holiday 18 | 2014-05-26 Spring Bank Holiday 19 | $ 20 | -------------------------------------------------------------------------------- /test/rrul_22.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format ical --from 2000-01-01 --till 2000-12-31 "${srcdir}/sample_08.ics" "${srcdir}/sample_07.ics" | grep -vF 'DTSTAMP:' 4 | BEGIN:VCALENDAR 5 | VERSION:2.0 6 | PRODID:-//GA Financial Solutions//echse//EN 7 | CALSCALE:GREGORIAN 8 | BEGIN:VEVENT 9 | DTSTART;VALUE=DATE:20000417 10 | DURATION:P0D 11 | UID:sample_08_ics_vevent_01@example.com 12 | SUMMARY:YWD example 13 | END:VEVENT 14 | BEGIN:VEVENT 15 | DTSTART;VALUE=DATE:20000417 16 | DURATION:P0D 17 | UID:sample_07_ics_vevent_01@example.com 18 | SUMMARY:YWD example 19 | END:VEVENT 20 | BEGIN:VEVENT 21 | DTSTART;VALUE=DATE:20000423 22 | DURATION:P0D 23 | UID:sample_08_ics_vevent_01@example.com 24 | SUMMARY:YWD example 25 | END:VEVENT 26 | BEGIN:VEVENT 27 | DTSTART;VALUE=DATE:20000424 28 | DURATION:P0D 29 | UID:sample_08_ics_vevent_01@example.com 30 | SUMMARY:YWD example 31 | END:VEVENT 32 | BEGIN:VEVENT 33 | DTSTART;VALUE=DATE:20000424 34 | DURATION:P0D 35 | UID:sample_07_ics_vevent_01@example.com 36 | SUMMARY:YWD example 37 | END:VEVENT 38 | BEGIN:VEVENT 39 | DTSTART;VALUE=DATE:20000430 40 | DURATION:P0D 41 | UID:sample_08_ics_vevent_01@example.com 42 | SUMMARY:YWD example 43 | END:VEVENT 44 | END:VCALENDAR 45 | $ 46 | -------------------------------------------------------------------------------- /test/rrul_23.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format '%b\t%u' --from 2000-01-01 --till 2000-12-31 "${srcdir}/sample_08.ics" "${srcdir}/sample_07.ics" 4 | 2000-04-17 sample_08_ics_vevent_01@example.com 5 | 2000-04-17 sample_07_ics_vevent_01@example.com 6 | 2000-04-23 sample_08_ics_vevent_01@example.com 7 | 2000-04-24 sample_08_ics_vevent_01@example.com 8 | 2000-04-24 sample_07_ics_vevent_01@example.com 9 | 2000-04-30 sample_08_ics_vevent_01@example.com 10 | $ 11 | -------------------------------------------------------------------------------- /test/rrul_26.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll "${srcdir}/sample_20.ics" 4 | 2003-01-05 Fifth of the month 5 | 2003-02-05 Fifth of the month 6 | 2003-03-05 Fifth of the month 7 | 2003-04-05 Fifth of the month 8 | 2003-05-05 Fifth of the month 9 | 2003-06-05 Fifth of the month 10 | 2003-07-05 Fifth of the month 11 | 2003-08-05 Fifth of the month 12 | 2003-09-05 Fifth of the month 13 | 2003-10-05 Fifth of the month 14 | 2003-11-05 Fifth of the month 15 | 2003-12-05 Fifth of the month 16 | 2004-01-05 Fifth of the month 17 | 2004-02-05 Fifth of the month 18 | 2004-03-05 Fifth of the month 19 | 2004-04-05 Fifth of the month 20 | 2004-05-05 Fifth of the month 21 | 2004-06-05 Fifth of the month 22 | 2004-07-05 Fifth of the month 23 | 2004-08-05 Fifth of the month 24 | 2007-01-31 Last of the month 25 | 2007-02-28 Last of the month 26 | 2007-03-31 Last of the month 27 | 2007-04-30 Last of the month 28 | 2007-05-31 Last of the month 29 | 2007-06-30 Last of the month 30 | 2007-07-31 Last of the month 31 | 2007-08-31 Last of the month 32 | 2007-09-30 Last of the month 33 | 2007-10-31 Last of the month 34 | 2007-11-30 Last of the month 35 | 2007-12-31 Last of the month 36 | 2008-01-31 Last of the month 37 | 2008-02-29 Last of the month 38 | 2008-03-31 Last of the month 39 | 2008-04-30 Last of the month 40 | 2008-05-31 Last of the month 41 | 2008-06-30 Last of the month 42 | 2008-07-31 Last of the month 43 | 2008-08-31 Last of the month 44 | 2008-09-30 Last of the month 45 | 2008-10-31 Last of the month 46 | 2008-11-30 Last of the month 47 | 2008-12-31 Last of the month 48 | $ 49 | -------------------------------------------------------------------------------- /test/rrul_27.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll "${srcdir}/sample_21.ics" 4 | 2003-05-11 Eleventh of the month 5 | 2003-06-11 Eleventh of the month 6 | 2003-09-11 Eleventh of the month 7 | 2004-05-11 Eleventh of the month 8 | 2004-06-11 Eleventh of the month 9 | 2004-09-11 Eleventh of the month 10 | 2005-05-11 Eleventh of the month 11 | 2005-06-11 Eleventh of the month 12 | 2005-09-11 Eleventh of the month 13 | 2006-05-11 Eleventh of the month 14 | 2006-06-11 Eleventh of the month 15 | 2006-09-11 Eleventh of the month 16 | 2007-05-11 Eleventh of the month 17 | 2007-06-11 Eleventh of the month 18 | 2007-09-11 Eleventh of the month 19 | 2008-05-11 Eleventh of the month 20 | 2008-06-11 Eleventh of the month 21 | 2008-09-11 Eleventh of the month 22 | 2009-05-11 Eleventh of the month 23 | 2009-06-11 Eleventh of the month 24 | $ 25 | -------------------------------------------------------------------------------- /test/rrul_28.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll "${srcdir}/sample_22.ics" 4 | 2000-02-29 60th Day 5 | 2001-03-01 60th Day 6 | 2002-03-01 60th Day 7 | 2003-03-01 60th Day 8 | 2004-02-29 60th Day 9 | $ 10 | -------------------------------------------------------------------------------- /test/rrul_29.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll "${srcdir}/sample_23.ics" 4 | 2000-02-22 Some 22nd 5 | 2000-03-12 2SUN 6 | 2000-03-20 20,22,24 doms 7 | 2000-03-22 Some 22nd 8 | 2000-04-09 2SUN 9 | 2000-04-22 Some 22nd 10 | 2000-04-24 20,22,24 doms 11 | 2000-05-14 2SUN 12 | 2000-05-22 20,22,24 doms 13 | 2000-06-11 2SUN 14 | 2000-07-09 2SUN 15 | 2000-07-24 20,22,24 doms 16 | 2000-11-20 20,22,24 doms 17 | 2001-01-22 20,22,24 doms 18 | 2001-08-20 20,22,24 doms 19 | 2001-09-24 20,22,24 doms 20 | 2001-10-22 20,22,24 doms 21 | 2001-12-24 20,22,24 doms 22 | $ 23 | -------------------------------------------------------------------------------- /test/rrul_30.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_12a.ics" 4 | 2000-02-28 Some February Days 5 | 2000-02-29 Some February Days 6 | 2001-02-28 Some February Days 7 | 2002-02-28 Some February Days 8 | 2003-02-28 Some February Days 9 | 2004-02-28 Some February Days 10 | 2004-02-29 Some February Days 11 | 2005-02-28 Some February Days 12 | 2006-02-28 Some February Days 13 | 2007-02-28 Some February Days 14 | 2008-02-28 Some February Days 15 | 2008-02-29 Some February Days 16 | 2009-02-28 Some February Days 17 | 2010-02-28 Some February Days 18 | 2011-02-28 Some February Days 19 | 2012-02-28 Some February Days 20 | 2012-02-29 Some February Days 21 | 2013-02-28 Some February Days 22 | 2014-02-28 Some February Days 23 | 2015-02-28 Some February Days 24 | $ 25 | -------------------------------------------------------------------------------- /test/rrul_31.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_12b.ics" 4 | 2000-02-28 Some Feb/Dec Days 5 | 2000-02-29 Some Feb/Dec Days 6 | 2000-12-20 Some Feb/Dec Days 7 | 2000-12-25 Some Feb/Dec Days 8 | 2000-12-29 Some Feb/Dec Days 9 | 2000-12-31 Some Feb/Dec Days 10 | 2001-02-28 Some Feb/Dec Days 11 | 2001-12-20 Some Feb/Dec Days 12 | 2001-12-25 Some Feb/Dec Days 13 | 2001-12-29 Some Feb/Dec Days 14 | 2001-12-31 Some Feb/Dec Days 15 | 2002-02-28 Some Feb/Dec Days 16 | 2002-12-20 Some Feb/Dec Days 17 | 2002-12-25 Some Feb/Dec Days 18 | 2002-12-29 Some Feb/Dec Days 19 | 2002-12-31 Some Feb/Dec Days 20 | 2003-02-28 Some Feb/Dec Days 21 | 2003-12-20 Some Feb/Dec Days 22 | 2003-12-25 Some Feb/Dec Days 23 | 2003-12-29 Some Feb/Dec Days 24 | 2003-12-31 Some Feb/Dec Days 25 | 2004-02-28 Some Feb/Dec Days 26 | 2004-02-29 Some Feb/Dec Days 27 | 2004-12-20 Some Feb/Dec Days 28 | 2004-12-25 Some Feb/Dec Days 29 | 2004-12-29 Some Feb/Dec Days 30 | 2004-12-31 Some Feb/Dec Days 31 | 2005-02-28 Some Feb/Dec Days 32 | 2006-02-28 Some Feb/Dec Days 33 | 2007-02-28 Some Feb/Dec Days 34 | 2008-02-28 Some Feb/Dec Days 35 | 2008-02-29 Some Feb/Dec Days 36 | 2009-02-28 Some Feb/Dec Days 37 | 2010-02-28 Some Feb/Dec Days 38 | 2011-02-28 Some Feb/Dec Days 39 | 2012-02-28 Some Feb/Dec Days 40 | 2012-02-29 Some Feb/Dec Days 41 | 2013-02-28 Some Feb/Dec Days 42 | 2014-02-28 Some Feb/Dec Days 43 | 2015-02-28 Some Feb/Dec Days 44 | $ 45 | -------------------------------------------------------------------------------- /test/rrul_32.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitors ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_13a.ics" 4 | 2004-02-29 Some February Leap Sunday 5 | 2004-02-29 60th Day And Sunday 6 | 2009-03-01 60th Day And Sunday 7 | 2015-03-01 60th Day And Sunday 8 | 2026-03-01 60th Day And Sunday 9 | 2032-02-29 Some February Leap Sunday 10 | $ 11 | -------------------------------------------------------------------------------- /test/rrul_33.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll "${srcdir}/sample_27.ics" --from 2000-01-01 4 | 2000-09-22 Just about a hundred days left 5 | 2001-09-22 Just about a hundred days left 6 | 2002-09-22 Just about a hundred days left 7 | 2003-09-22 Just about a hundred days left 8 | 2004-09-22 Just about a hundred days left 9 | 2005-09-22 Just about a hundred days left 10 | 2006-09-22 Just about a hundred days left 11 | 2007-09-22 Just about a hundred days left 12 | 2008-09-22 Just about a hundred days left 13 | 2009-09-22 Just about a hundred days left 14 | 2010-09-22 Just about a hundred days left 15 | 2011-09-22 Just about a hundred days left 16 | 2012-09-22 Just about a hundred days left 17 | 2013-09-22 Just about a hundred days left 18 | 2014-09-22 Just about a hundred days left 19 | 2015-09-22 Just about a hundred days left 20 | 2016-09-22 Just about a hundred days left 21 | 2017-09-22 Just about a hundred days left 22 | 2018-09-22 Just about a hundred days left 23 | 2019-09-22 Just about a hundred days left 24 | 2020-09-22 Just about a hundred days left 25 | 2021-09-22 Just about a hundred days left 26 | 2022-09-22 Just about a hundred days left 27 | 2023-09-22 Just about a hundred days left 28 | 2024-09-22 Just about a hundred days left 29 | 2025-09-22 Just about a hundred days left 30 | 2026-09-22 Just about a hundred days left 31 | 2027-09-22 Just about a hundred days left 32 | 2028-09-22 Just about a hundred days left 33 | 2029-09-22 Just about a hundred days left 34 | 2030-09-22 Just about a hundred days left 35 | 2031-09-22 Just about a hundred days left 36 | 2032-09-22 Just about a hundred days left 37 | 2033-09-22 Just about a hundred days left 38 | 2034-09-22 Just about a hundred days left 39 | 2035-09-22 Just about a hundred days left 40 | 2036-09-22 Just about a hundred days left 41 | 2037-09-22 Just about a hundred days left 42 | $ 43 | -------------------------------------------------------------------------------- /test/rrul_34.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll "${srcdir}/sample_28.ics" --from 2000-01-01 4 | 2000-01-17 Just about a whole year left 5 | 2001-01-16 Just about a whole year left 6 | 2002-01-16 Just about a whole year left 7 | 2003-01-16 Just about a whole year left 8 | 2004-01-17 Just about a whole year left 9 | 2005-01-16 Just about a whole year left 10 | 2006-01-16 Just about a whole year left 11 | 2007-01-16 Just about a whole year left 12 | 2008-01-17 Just about a whole year left 13 | 2009-01-16 Just about a whole year left 14 | 2010-01-16 Just about a whole year left 15 | 2011-01-16 Just about a whole year left 16 | 2012-01-17 Just about a whole year left 17 | 2013-01-16 Just about a whole year left 18 | 2014-01-16 Just about a whole year left 19 | 2015-01-16 Just about a whole year left 20 | 2016-01-17 Just about a whole year left 21 | 2017-01-16 Just about a whole year left 22 | 2018-01-16 Just about a whole year left 23 | 2019-01-16 Just about a whole year left 24 | 2020-01-17 Just about a whole year left 25 | 2021-01-16 Just about a whole year left 26 | 2022-01-16 Just about a whole year left 27 | 2023-01-16 Just about a whole year left 28 | 2024-01-17 Just about a whole year left 29 | 2025-01-16 Just about a whole year left 30 | 2026-01-16 Just about a whole year left 31 | 2027-01-16 Just about a whole year left 32 | 2028-01-17 Just about a whole year left 33 | 2029-01-16 Just about a whole year left 34 | 2030-01-16 Just about a whole year left 35 | 2031-01-16 Just about a whole year left 36 | 2032-01-17 Just about a whole year left 37 | 2033-01-16 Just about a whole year left 38 | 2034-01-16 Just about a whole year left 39 | 2035-01-16 Just about a whole year left 40 | 2036-01-17 Just about a whole year left 41 | 2037-01-16 Just about a whole year left 42 | $ 43 | -------------------------------------------------------------------------------- /test/rrul_35.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | setopt exit-code 4 | 5 | $ [ -f "${TZDIR}/Europe/Berlin" -o -f "${TZDIR_RIGHT}/Europe/Berlin" ] || exit 77 6 | $ [ -f "${TZDIR}/Europe/London" -o -f "${TZDIR_RIGHT}/Europe/London" ] || exit 77 7 | $ echse unroll --format '%b\t%e\t%s' "${srcdir}/sample_29.ics" 8 | 2015-01-05T16:00:00 2015-01-05T16:30:00 First Monday 9 | 2015-02-02T16:00:00 2015-02-02T16:30:00 First Monday 10 | 2015-03-02T16:00:00 2015-03-02T16:30:00 First Monday 11 | 2015-04-06T15:00:00 2015-04-06T15:30:00 First Monday 12 | 2015-05-04T15:00:00 2015-05-04T15:30:00 First Monday 13 | 2015-06-01T15:00:00 2015-06-01T15:30:00 First Monday 14 | 2015-07-06T15:00:00 2015-07-06T15:30:00 First Monday 15 | 2015-08-03T15:00:00 2015-08-03T15:30:00 First Monday 16 | 2015-09-07T15:00:00 2015-09-07T15:30:00 First Monday 17 | 2015-10-05T15:00:00 2015-10-05T15:30:00 First Monday 18 | 2015-11-02T16:00:00 2015-11-02T16:30:00 First Monday 19 | 2015-12-07T16:00:00 2015-12-07T16:30:00 First Monday 20 | $ 21 | -------------------------------------------------------------------------------- /test/rrul_36.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | setopt exit-code 4 | 5 | $ [ -f "${TZDIR}/Europe/Berlin" -o -f "${TZDIR_RIGHT}/Europe/Berlin" ] || exit 77 6 | $ [ -f "${TZDIR}/Europe/London" -o -f "${TZDIR_RIGHT}/Europe/London" ] || exit 77 7 | $ echse unroll --format '%b\t%e\t%s' "${srcdir}/sample_30.ics" 8 | 2015-01-05T16:00:00 2015-01-05T16:30:00 Just one Monday 9 | $ 10 | -------------------------------------------------------------------------------- /test/rrul_37.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | setopt exit-code 4 | 5 | $ [ -f "${TZDIR}/Europe/Berlin" -o -f "${TZDIR_RIGHT}/Europe/Berlin" ] || exit 77 6 | $ [ -f "${TZDIR}/Europe/London" -o -f "${TZDIR_RIGHT}/Europe/London" ] || exit 77 7 | $ echse unroll --format '%b\t%e\t%s' "${srcdir}/sample_31.ics" 8 | 2015-02-05T16:00:00 2015-02-05T16:30:00 The fifth 9 | 2015-03-05T16:00:00 2015-03-05T16:30:00 The fifth 10 | 2015-04-05T15:00:00 2015-04-05T15:30:00 The fifth 11 | 2015-04-05T16:00:00 2015-04-05T16:30:00 The fifth 12 | $ 13 | -------------------------------------------------------------------------------- /test/rrul_38.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | setopt exit-code 4 | 5 | $ [ -f "${TZDIR}/Europe/Berlin" -o -f "${TZDIR_RIGHT}/Europe/Berlin" ] || exit 77 6 | $ [ -f "${TZDIR}/Europe/London" -o -f "${TZDIR_RIGHT}/Europe/London" ] || exit 77 7 | $ echse unroll --format '%b\t%e\t%s' "${srcdir}/sample_32.ics" 8 | 2015-02-05T16:00:00 2015-02-05T16:30:00 The fifth 9 | 2015-03-05T16:00:00 2015-03-05T16:30:00 The fifth 10 | 2015-04-05T15:00:00 2015-04-05T15:30:00 The fifth 11 | $ 12 | -------------------------------------------------------------------------------- /test/rrul_39.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | setopt exit-code 4 | 5 | $ [ -f "${TZDIR}/Europe/Berlin" -o -f "${TZDIR_RIGHT}/Europe/Berlin" ] || exit 77 6 | $ [ -f "${TZDIR}/Europe/London" -o -f "${TZDIR_RIGHT}/Europe/London" ] || exit 77 7 | $ echse unroll --format '%b\t%e\t%s' "${srcdir}/sample_33.ics" 8 | 2015-02-05T16:00:00 2015-02-05T16:30:00 The fifth 9 | 2015-03-05T16:00:00 2015-03-05T16:30:00 The fifth 10 | 2015-04-05T15:00:00 2015-04-05T15:30:00 The fifth 11 | $ 12 | -------------------------------------------------------------------------------- /test/rrul_40.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | setopt exit-code 4 | 5 | $ [ -f "${TZDIR}/Europe/Berlin" -o -f "${TZDIR_RIGHT}/Europe/Berlin" ] || exit 77 6 | $ [ -f "${TZDIR}/Europe/London" -o -f "${TZDIR_RIGHT}/Europe/London" ] || exit 77 7 | $ echse unroll --format '%b\t%e\t%s' "${srcdir}/sample_34.ics" 8 | 2015-02-05T16:00:00 2015-02-05T16:30:00 The fifth 9 | 2015-03-05T16:00:00 2015-03-05T16:30:00 The fifth 10 | 2015-04-05T15:00:00 2015-04-05T15:30:00 The fifth 11 | $ 12 | -------------------------------------------------------------------------------- /test/rrul_41.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format '%b\t%e\t%s' "${srcdir}/sample_35.ics" 4 | 2015-01-05T17:52:00 2015-01-05T18:22:00 The fifth 5 | $ 6 | -------------------------------------------------------------------------------- /test/rrul_42.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format '%b\t%e\t%s' "${srcdir}/sample_36.ics" 4 | 2015-01-05T17:00:00 2015-01-05T17:30:00 The fifth 5 | 2015-01-05T17:10:00 2015-01-05T17:40:00 The fifth 6 | 2015-01-05T17:20:00 2015-01-05T17:50:00 The fifth 7 | 2015-01-05T17:30:00 2015-01-05T18:00:00 The fifth 8 | 2015-01-05T17:40:00 2015-01-05T18:10:00 The fifth 9 | 2015-01-05T17:50:00 2015-01-05T18:20:00 The fifth 10 | 2015-01-05T18:00:00 2015-01-05T18:30:00 The fifth 11 | 2015-01-05T18:10:00 2015-01-05T18:40:00 The fifth 12 | 2015-01-05T18:20:00 2015-01-05T18:50:00 The fifth 13 | 2015-01-05T18:30:00 2015-01-05T19:00:00 The fifth 14 | 2015-01-05T18:40:00 2015-01-05T19:10:00 The fifth 15 | 2015-01-05T18:50:00 2015-01-05T19:20:00 The fifth 16 | 2015-01-05T19:00:00 2015-01-05T19:30:00 The fifth 17 | 2015-01-05T19:10:00 2015-01-05T19:40:00 The fifth 18 | 2015-01-05T19:20:00 2015-01-05T19:50:00 The fifth 19 | 2015-01-05T19:30:00 2015-01-05T20:00:00 The fifth 20 | 2015-01-05T19:40:00 2015-01-05T20:10:00 The fifth 21 | 2015-01-05T19:50:00 2015-01-05T20:20:00 The fifth 22 | 2015-01-05T20:00:00 2015-01-05T20:30:00 The fifth 23 | 2015-01-05T20:10:00 2015-01-05T20:40:00 The fifth 24 | 2015-01-05T20:20:00 2015-01-05T20:50:00 The fifth 25 | 2015-01-05T20:30:00 2015-01-05T21:00:00 The fifth 26 | 2015-01-05T20:40:00 2015-01-05T21:10:00 The fifth 27 | 2015-01-05T20:50:00 2015-01-05T21:20:00 The fifth 28 | 2015-01-05T21:00:00 2015-01-05T21:30:00 The fifth 29 | 2015-01-05T21:10:00 2015-01-05T21:40:00 The fifth 30 | 2015-01-05T21:20:00 2015-01-05T21:50:00 The fifth 31 | 2015-01-05T21:30:00 2015-01-05T22:00:00 The fifth 32 | 2015-01-05T21:40:00 2015-01-05T22:10:00 The fifth 33 | 2015-01-05T21:50:00 2015-01-05T22:20:00 The fifth 34 | 2015-01-05T22:00:00 2015-01-05T22:30:00 The fifth 35 | $ 36 | -------------------------------------------------------------------------------- /test/rrul_43.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format '%b\t%s' "${srcdir}/sample_37.ics" 4 | 2011-04-25 Easter Monday on April 25 5 | 2022-04-15 Good Friday on April 15 6 | 2033-04-15 Good Friday on April 15 7 | $ 8 | -------------------------------------------------------------------------------- /test/rrul_44.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format '%b\t%s' "${srcdir}/sample_38.ics" 4 | 2000-04-21 Good Friday in April 5 | 2001-04-13 Good Friday in April 6 | 2003-04-18 Good Friday in April 7 | 2004-04-09 Good Friday in April 8 | 2006-04-14 Good Friday in April 9 | 2007-04-06 Good Friday in April 10 | 2009-04-10 Good Friday in April 11 | 2010-04-02 Good Friday in April 12 | 2011-04-22 Good Friday in April 13 | 2011-04-25 Easter Monday on the 25th 14 | 2012-04-06 Good Friday in April 15 | $ 16 | -------------------------------------------------------------------------------- /test/rrul_45.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format '%b\t%s' "${srcdir}/sample_39.ics" 4 | 2000-02-09 Monthly Hijri 5 | 2000-03-09 Monthly Hijri 6 | 2000-04-08 Monthly Hijri 7 | 2000-05-07 Monthly Hijri 8 | 2000-06-05 Monthly Hijri 9 | 2000-07-05 Monthly Hijri 10 | 2000-08-03 Monthly Hijri 11 | 2000-09-01 Monthly Hijri 12 | 2000-09-30 Monthly Hijri 13 | 2000-10-30 Monthly Hijri 14 | 2000-11-29 Monthly Hijri 15 | 2000-12-29 Monthly Hijri 16 | 2001-01-28 Monthly Hijri 17 | 2001-02-26 Monthly Hijri 18 | 2001-03-28 Monthly Hijri 19 | 2001-04-27 Monthly Hijri 20 | 2001-05-26 Monthly Hijri 21 | 2001-06-24 Monthly Hijri 22 | 2001-07-24 Monthly Hijri 23 | 2001-08-22 Monthly Hijri 24 | 2006-10-23 Recurring Hijri 25 | 2014-07-28 Recurring Hijri 26 | 2015-12-11 HIJRI 1437-02-29 27 | 2017-06-25 HIJRI 1438-10-01 28 | 2022-05-02 Recurring Hijri 29 | 2030-02-04 Recurring Hijri 30 | $ 31 | -------------------------------------------------------------------------------- /test/rrul_46.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format '%b\t%s' "${srcdir}/sample_40.ics" 4 | 1420-12-30 seeing if intercalary 5 | 1421-12-29 seeing if intercalary 6 | 1422-12-29 seeing if intercalary 7 | 1423-12-30 seeing if intercalary 8 | 1424-12-29 seeing if intercalary 9 | 1425-12-30 seeing if intercalary 10 | 1426-12-29 seeing if intercalary 11 | 1427-12-29 seeing if intercalary 12 | 1428-12-30 seeing if intercalary 13 | 1429-12-29 seeing if intercalary 14 | 1430-12-29 seeing if intercalary 15 | 1431-12-30 seeing if intercalary 16 | 1432-12-29 seeing if intercalary 17 | 1433-12-29 seeing if intercalary 18 | 1434-12-30 seeing if intercalary 19 | 1435-12-29 seeing if intercalary 20 | 1436-12-30 seeing if intercalary 21 | 1437-12-29 seeing if intercalary 22 | 1438-12-29 seeing if intercalary 23 | 1439-12-30 seeing if intercalary 24 | 1440-12-29 seeing if intercalary 25 | $ 26 | -------------------------------------------------------------------------------- /test/rrul_47.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ sed 's/HIJRI.IA/HIJRI.UMMULQURA/' "${srcdir}/sample_40.ics" | echse unroll --format '%b\t%s' 4 | 1420-12-30 seeing if intercalary 5 | 1421-12-30 seeing if intercalary 6 | 1422-12-30 seeing if intercalary 7 | 1423-12-30 seeing if intercalary 8 | 1424-12-29 seeing if intercalary 9 | 1425-12-29 seeing if intercalary 10 | 1426-12-30 seeing if intercalary 11 | 1427-12-29 seeing if intercalary 12 | 1428-12-30 seeing if intercalary 13 | 1429-12-30 seeing if intercalary 14 | 1430-12-30 seeing if intercalary 15 | 1431-12-30 seeing if intercalary 16 | 1432-12-29 seeing if intercalary 17 | 1433-12-29 seeing if intercalary 18 | 1434-12-29 seeing if intercalary 19 | 1435-12-30 seeing if intercalary 20 | 1436-12-30 seeing if intercalary 21 | 1437-12-30 seeing if intercalary 22 | 1438-12-29 seeing if intercalary 23 | 1439-12-30 seeing if intercalary 24 | 1440-12-29 seeing if intercalary 25 | $ 26 | -------------------------------------------------------------------------------- /test/rrul_48.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ sed 's/HIJRI.IA/HIJRI.DIYANET/' "${srcdir}/sample_40.ics" | echse unroll --format '%b\t%s' 4 | 1420-12-30 seeing if intercalary 5 | 1421-12-30 seeing if intercalary 6 | 1422-12-30 seeing if intercalary 7 | 1423-12-30 seeing if intercalary 8 | 1424-12-29 seeing if intercalary 9 | 1425-12-30 seeing if intercalary 10 | 1426-12-30 seeing if intercalary 11 | 1427-12-29 seeing if intercalary 12 | 1428-12-30 seeing if intercalary 13 | 1429-12-30 seeing if intercalary 14 | 1430-12-29 seeing if intercalary 15 | 1431-12-30 seeing if intercalary 16 | 1432-12-29 seeing if intercalary 17 | 1433-12-30 seeing if intercalary 18 | 1434-12-29 seeing if intercalary 19 | 1435-12-30 seeing if intercalary 20 | 1436-12-29 seeing if intercalary 21 | 1437-12-29 seeing if intercalary 22 | 1438-12-29 seeing if intercalary 23 | 1439-12-30 seeing if intercalary 24 | 1440-12-29 seeing if intercalary 25 | $ 26 | -------------------------------------------------------------------------------- /test/rrul_49.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --from 2000-01-01 --format "%b\t%s" "${srcdir}/sample_17b.ics" --till 2020-12-31 4 | 2000-01-10 November Days 5 | 2000-06-05 Some Day 6 | 2001-01-15 November Days 7 | 2001-06-04 Some Day 8 | 2002-01-14 November Days 9 | 2002-06-03 Some Day 10 | 2003-01-13 November Days 11 | 2003-06-02 Some Day 12 | 2004-01-12 November Days 13 | 2004-06-07 Some Day 14 | 2005-01-10 November Days 15 | 2005-06-06 Some Day 16 | 2006-01-16 November Days 17 | 2006-06-05 Some Day 18 | 2007-01-15 November Days 19 | 2007-06-04 Some Day 20 | 2008-01-14 November Days 21 | 2008-06-02 Some Day 22 | 2009-01-12 November Days 23 | 2009-06-01 Some Day 24 | 2010-01-11 November Days 25 | 2010-06-07 Some Day 26 | 2011-01-10 November Days 27 | 2011-06-06 Some Day 28 | 2012-01-16 November Days 29 | 2012-06-04 Some Day 30 | 2013-01-14 November Days 31 | 2013-06-03 Some Day 32 | 2014-01-13 November Days 33 | 2014-06-02 Some Day 34 | 2015-01-12 November Days 35 | 2015-06-01 Some Day 36 | 2016-01-11 November Days 37 | 2016-06-06 Some Day 38 | 2017-01-16 November Days 39 | 2017-06-05 Some Day 40 | 2018-01-15 November Days 41 | 2018-06-04 Some Day 42 | 2019-01-14 November Days 43 | 2019-06-03 Some Day 44 | 2020-01-13 November Days 45 | 2020-06-01 Some Day 46 | $ 47 | -------------------------------------------------------------------------------- /test/rrul_50.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | $ echse unroll --format "%b\t%s" "${srcdir}/sample_17c.ics" 4 | 2018-01-16 normal 5 | 2018-01-16 inverted 6 | 2018-02-16 normal 7 | 2018-02-16 inverted 8 | 2018-03-16 normal 9 | 2018-03-16 inverted 10 | 2018-04-16 normal 11 | 2018-04-17 inverted 12 | 2018-05-16 normal 13 | 2018-05-16 inverted 14 | 2018-06-18 normal 15 | 2018-06-18 inverted 16 | 2018-07-16 normal 17 | 2018-07-17 inverted 18 | 2018-08-16 normal 19 | 2018-08-16 inverted 20 | 2018-09-17 normal 21 | 2018-09-18 inverted 22 | 2018-10-16 normal 23 | 2018-10-16 inverted 24 | 2018-11-16 normal 25 | 2018-11-16 inverted 26 | 2018-12-17 normal 27 | 2018-12-18 inverted 28 | $ 29 | -------------------------------------------------------------------------------- /test/sample_01.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:1.0 3 | BEGIN:VEVENT 4 | DTSTART:20140323T090000 5 | DTEND:20140323T100000 6 | SUMMARY:March meeting 7 | DESCRIPTION:Just a catch-up thing really. 8 | PRIORITY:3 9 | END:VEVENT 10 | BEGIN:VEVENT 11 | DTSTART:20140423T090000 12 | DTEND:20140423T120000 13 | SUMMARY:Flight home 14 | DESCRIPTION:Make sure to pack bags beforehand. 15 | PRIORITY:3 16 | END:VEVENT 17 | END:VCALENDAR 18 | -------------------------------------------------------------------------------- /test/sample_02.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_02_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20130329 8 | DTEND;VALUE=DATE:20130330 9 | DESCRIPTION: 10 | SUMMARY:Good Friday 11 | TRANSP:TRANSPARENT 12 | END:VEVENT 13 | BEGIN:VEVENT 14 | DTSTAMP:20140324T005526Z 15 | UID:sample_02_ics_vevent_02@example.com 16 | DTSTART;VALUE=DATE:20130101 17 | DTEND;VALUE=DATE:20130102 18 | DESCRIPTION: 19 | LOCATION: 20 | SUMMARY:New year's day 21 | TRANSP:TRANSPARENT 22 | END:VEVENT 23 | BEGIN:VEVENT 24 | DTSTAMP:20140324T005526Z 25 | UID:sample_02_ics_vevent_03@example.com 26 | DTSTART;VALUE=DATE:20131226 27 | DTEND;VALUE=DATE:20131227 28 | DESCRIPTION: 29 | LOCATION: 30 | SEQUENCE:0 31 | SUMMARY:Boxing day 32 | TRANSP:TRANSPARENT 33 | END:VEVENT 34 | END:VCALENDAR 35 | -------------------------------------------------------------------------------- /test/sample_03.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_03_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20001225 8 | RRULE:FREQ=YEARLY 9 | SUMMARY:Christmas Day 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_03_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000101 15 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=26 16 | SUMMARY:Boxing Day 17 | DESCRIPTION:This one starts out at sometime in January. 18 | END:VEVENT 19 | END:VCALENDAR 20 | -------------------------------------------------------------------------------- /test/sample_04.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_04_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;INTERVAL=4;COUNT=9 9 | SUMMARY:Leap Day 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_04_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000101 15 | RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=29;INTERVAL=2;UNTIL=20220101 16 | SUMMARY:Leap Day 2 17 | END:VEVENT 18 | BEGIN:VEVENT 19 | DTSTAMP:20140324T005526Z 20 | UID:sample_04_ics_vevent_03@example.com 21 | DTSTART;VALUE=DATE:20000101 22 | RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=30;INTERVAL=1 23 | SUMMARY:Bullshit Day 24 | END:VEVENT 25 | END:VCALENDAR 26 | -------------------------------------------------------------------------------- /test/sample_05.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_05_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYMONTH=3,10;BYMONTHDAY=4,6 9 | SUMMARY:4/a 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_05_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000229 15 | RRULE:FREQ=YEARLY;BYMONTH=4,10;BYMONTHDAY=11;COUNT=7 16 | SUMMARY:2/a 17 | END:VEVENT 18 | BEGIN:VEVENT 19 | DTSTAMP:20140324T005526Z 20 | UID:sample_05_ics_vevent_03@example.com 21 | DTSTART;VALUE=DATE:20000229 22 | RRULE:FREQ=YEARLY;BYMONTH=5,11;BYMONTHDAY=-2;INTERVAL=2;UNTIL=20031231 23 | SUMMARY:XXX 24 | END:VEVENT 25 | END:VCALENDAR 26 | -------------------------------------------------------------------------------- /test/sample_06.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_06_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYWEEKNO=17;BYDAY=MO 9 | SUMMARY:YWD example 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_06_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000229 15 | RRULE:FREQ=YEARLY;BYWEEKNO=-37;BYDAY=TU 16 | SUMMARY:YWD example (neg) 17 | END:VEVENT 18 | END:VCALENDAR 19 | -------------------------------------------------------------------------------- /test/sample_07.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_07_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYWEEKNO=17,-37;BYDAY=MO 9 | SUMMARY:YWD example 10 | END:VEVENT 11 | END:VCALENDAR 12 | -------------------------------------------------------------------------------- /test/sample_08.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_08_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYWEEKNO=17,-37;BYDAY=MO,SU 9 | SUMMARY:YWD example 10 | END:VEVENT 11 | END:VCALENDAR 12 | -------------------------------------------------------------------------------- /test/sample_09.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_09_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYMONTH=3,10;BYDAY=-1SU;COUNT=24 9 | SUMMARY:YMCW example 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_09_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000229 15 | RRULE:FREQ=YEARLY;BYMONTH=5;BYDAY=5SU;COUNT=12 16 | SUMMARY:YMCW example 2 17 | END:VEVENT 18 | END:VCALENDAR 19 | -------------------------------------------------------------------------------- /test/sample_10.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_10_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000101 8 | RRULE:FREQ=YEARLY;BYDAY=-1SU;COUNT=24 9 | SUMMARY:YCW example 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_10_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000101 15 | RRULE:FREQ=YEARLY;BYDAY=5SU;COUNT=12 16 | SUMMARY:YCW example 2 17 | END:VEVENT 18 | END:VCALENDAR 19 | -------------------------------------------------------------------------------- /test/sample_11.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_11_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYEASTER=-2;COUNT=24 9 | SUMMARY:Gregorian Easter minus 2 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_11_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000229 15 | RRULE:FREQ=YEARLY;BYEASTER=0,1;COUNT=48 16 | SUMMARY:Gregorian Easter Sunday/Monday 17 | END:VEVENT 18 | END:VCALENDAR 19 | -------------------------------------------------------------------------------- /test/sample_12.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_12_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000101 8 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYSETPOS=-1,-3,1,4;COUNT=20 9 | SUMMARY:Some December Days 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_12_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000101 15 | RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYSETPOS=7,-1,-14;COUNT=20 16 | SUMMARY:Some February Days 17 | END:VEVENT 18 | END:VCALENDAR 19 | -------------------------------------------------------------------------------- /test/sample_12a.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_12_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000101 8 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYSETPOS=-1,-3,1,4;COUNT=20 9 | SUMMARY:Some December Days 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_12_ics_vevent_01@example.com 14 | DTSTART;VALUE=DATE:20000101 15 | RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYSETPOS=7,-1,-14;COUNT=20 16 | SUMMARY:Some February Days 17 | END:VEVENT 18 | END:VCALENDAR 19 | -------------------------------------------------------------------------------- /test/sample_12b.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_12_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000101 8 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYSETPOS=-1,-3,1,4;COUNT=20 9 | RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=20,22,24,25,26,27,28,29,30,31;BYSETPOS=7,-1,-14;COUNT=20 10 | SUMMARY:Some Feb/Dec Days 11 | END:VEVENT 12 | END:VCALENDAR 13 | -------------------------------------------------------------------------------- /test/sample_13.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_13_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=20,22,24;BYDAY=MO;COUNT=10 9 | SUMMARY:Some December Monday 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_13_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000229 15 | RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=29;BYDAY=SU;COUNT=2 16 | SUMMARY:Some February Leap Sunday 17 | END:VEVENT 18 | BEGIN:VEVENT 19 | DTSTAMP:20140324T005526Z 20 | UID:sample_13_ics_vevent_03@example.com 21 | DTSTART;VALUE=DATE:20000229 22 | RRULE:FREQ=YEARLY;BYYEARDAY=60;BYDAY=SU;COUNT=4 23 | SUMMARY:60th Day And Sunday 24 | END:VEVENT 25 | END:VCALENDAR 26 | -------------------------------------------------------------------------------- /test/sample_13a.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_13_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=20,22,24;BYDAY=MO;COUNT=10 9 | SUMMARY:Some December Monday 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_13_ics_vevent_01@example.com 14 | DTSTART;VALUE=DATE:20000229 15 | RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=29;BYDAY=SU;COUNT=2 16 | SUMMARY:Some February Leap Sunday 17 | END:VEVENT 18 | BEGIN:VEVENT 19 | DTSTAMP:20140324T005526Z 20 | UID:sample_13_ics_vevent_03@example.com 21 | DTSTART;VALUE=DATE:20000229 22 | RRULE:FREQ=YEARLY;BYYEARDAY=60;BYDAY=SU;COUNT=4 23 | SUMMARY:60th Day And Sunday 24 | END:VEVENT 25 | END:VCALENDAR 26 | -------------------------------------------------------------------------------- /test/sample_14.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_14_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=20,22,24;BYDAY=MO;COUNT=10 9 | RRULE:FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=02,04,06;BYDAY=MO;COUNT=10 10 | SUMMARY:Some December Monday 11 | END:VEVENT 12 | END:VCALENDAR 13 | -------------------------------------------------------------------------------- /test/sample_15.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | PRODID:-//GA Financial Solutions//echse//EN 4 | CALSCALE:GREGORIAN 5 | BEGIN:VEVENT 6 | DTSTAMP:20140324T005526Z 7 | UID:sample_15_ics_vevent_01@example.com 8 | DTSTART;VALUE=DATE:19540101 9 | DTEND;VALUE=DATE:19540102 10 | RRULE:FREQ=YEARLY;BYMONTH=12;BYDAY=MO,TU,WE,TH,FR;BYMONTHDAY=25 11 | RRULE:FREQ=YEARLY;BYMONTH=12;BYDAY=MO,TU;BYMONTHDAY=27 12 | SUMMARY:Christmas Day 13 | END:VEVENT 14 | BEGIN:VEVENT 15 | DTSTAMP:20140324T005526Z 16 | UID:sample_15_ics_vevent_02@example.com 17 | DTSTART;VALUE=DATE:19540101 18 | DTEND;VALUE=DATE:19540102 19 | RRULE:FREQ=YEARLY;BYMONTH=12;BYDAY=WE,TH,FR;BYMONTHDAY=26 20 | RRULE:FREQ=YEARLY;BYMONTH=12;BYDAY=MO,TU;BYMONTHDAY=26,28;BYSETPOS=1 21 | SUMMARY:Boxing Day 22 | END:VEVENT 23 | END:VCALENDAR 24 | -------------------------------------------------------------------------------- /test/sample_16.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//uk.gov/GOVUK calendars//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP:20140324T005526Z 8 | DTSTART;VALUE=DATE:19540101 9 | DTEND;VALUE=DATE:19540102 10 | RRULE:FREQ=YEARLY;BYMONTH=5;BYDAY=-1MO 11 | EXDATE:20120528 12 | SUMMARY:Spring Bank Holiday 13 | END:VEVENT 14 | BEGIN:VEVENT 15 | DTSTAMP:20140324T005526Z 16 | DTSTART;VALUE=DATE:20120604 17 | DTEND;VALUE=DATE:20120605 18 | SUMMARY:Spring Bank Holiday (in-lieu of 2012-05-28) 19 | END:VEVENT 20 | END:VCALENDAR 21 | -------------------------------------------------------------------------------- /test/sample_17b.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//uk.gov/GOVUK calendars//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP:20140324T005526Z 8 | DTSTART;VALUE=DATE:19860101 9 | DTEND;VALUE=DATE:19860102 10 | RRULE:FREQ=YEARLY;BYMONTH=5;BYDAY=-1MO;SHIFT=7 11 | SUMMARY:Some Day 12 | END:VEVENT 13 | BEGIN:VEVENT 14 | DTSTAMP:20140324T005526Z 15 | DTSTART;VALUE=DATE:19860101 16 | DTEND;VALUE=DATE:19860102 17 | RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1MO;SHIFT=70 18 | SUMMARY:November Days 19 | END:VEVENT 20 | END:VCALENDAR 21 | -------------------------------------------------------------------------------- /test/sample_17c.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//uk.gov/GOVUK calendars//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP:20140324T005526Z 8 | DTSTART;VALUE=DATE:20180101 9 | DTEND;VALUE=DATE:20180102 10 | RRULE:FREQ=MONTHLY;BYMONTHDAY=15;SHIFT=1B;COUNT=12 11 | SUMMARY:normal 12 | END:VEVENT 13 | BEGIN:VEVENT 14 | DTSTAMP:20140324T005526Z 15 | DTSTART;VALUE=DATE:20180101 16 | DTEND;VALUE=DATE:20180102 17 | RRULE:FREQ=MONTHLY;BYMONTHDAY=15;SHIFT=1B+;COUNT=12 18 | SUMMARY:inverted 19 | END:VEVENT 20 | END:VCALENDAR 21 | -------------------------------------------------------------------------------- /test/sample_18.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | PRODID:-//GA Financial Solutions//echse//EN 4 | CALSCALE:GREGORIAN 5 | BEGIN:VEVENT 6 | DTSTAMP:20140417T033301Z 7 | DTSTART;VALUE=DATE:20030101 8 | DTEND;VALUE=DATE:20030102 9 | UID:echse_merged_vevent_1 10 | SUMMARY:Saturday 11 | RRULE:FREQ=YEARLY;BYDAY=SA;UNTIL=20141231 12 | END:VEVENT 13 | BEGIN:VEVENT 14 | DTSTAMP:20140417T033301Z 15 | DTSTART;VALUE=DATE:20090101 16 | DTEND;VALUE=DATE:20090102 17 | UID:echse_merged_vevent_2 18 | SUMMARY:Weekend 19 | RRULE:FREQ=YEARLY;BYDAY=SA,SU;UNTIL=20141231 20 | END:VEVENT 21 | END:VCALENDAR 22 | -------------------------------------------------------------------------------- /test/sample_19.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | PRODID:-//GA Financial Solutions//echse//EN 4 | CALSCALE:GREGORIAN 5 | BEGIN:VEVENT 6 | DTSTAMP:20140417T033301Z 7 | DTSTART;VALUE=DATE:20030101 8 | DTEND;VALUE=DATE:20030102 9 | UID:echse_merged_vevent_1 10 | SUMMARY:Tuesdays in May 11 | RRULE:FREQ=YEARLY;BYMONTH=5;BYDAY=TU;UNTIL=20141231 12 | END:VEVENT 13 | BEGIN:VEVENT 14 | DTSTAMP:20140417T033301Z 15 | DTSTART;VALUE=DATE:20090101 16 | DTEND;VALUE=DATE:20090102 17 | UID:echse_merged_vevent_2 18 | SUMMARY:Weekends in August 19 | RRULE:FREQ=YEARLY;BYMONTH=8;BYDAY=SA,SU;UNTIL=20141231 20 | END:VEVENT 21 | END:VCALENDAR 22 | -------------------------------------------------------------------------------- /test/sample_20.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | PRODID:-//GA Financial Solutions//echse//EN 4 | CALSCALE:GREGORIAN 5 | BEGIN:VEVENT 6 | DTSTAMP:20140417T033301Z 7 | DTSTART;VALUE=DATE:20030101 8 | DTEND;VALUE=DATE:20030102 9 | UID:echse_merged_vevent_1 10 | SUMMARY:Fifth of the month 11 | RRULE:FREQ=YEARLY;BYMONTHDAY=5;COUNT=20 12 | END:VEVENT 13 | BEGIN:VEVENT 14 | DTSTAMP:20140417T033301Z 15 | DTSTART;VALUE=DATE:20070101 16 | DTEND;VALUE=DATE:20070102 17 | UID:echse_merged_vevent_2 18 | SUMMARY:Last of the month 19 | RRULE:FREQ=YEARLY;BYMONTHDAY=-1;UNTIL=20081231 20 | END:VEVENT 21 | END:VCALENDAR 22 | -------------------------------------------------------------------------------- /test/sample_21.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | PRODID:-//GA Financial Solutions//echse//EN 4 | CALSCALE:GREGORIAN 5 | BEGIN:VEVENT 6 | DTSTAMP:20140417T033301Z 7 | DTSTART;VALUE=DATE:20030111 8 | DTEND;VALUE=DATE:20030112 9 | UID:echse_merged_vevent_1 10 | SUMMARY:Eleventh of the month 11 | RRULE:FREQ=YEARLY;BYMONTH=5,6,9;COUNT=20 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_22.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_22_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYYEARDAY=60;COUNT=5 9 | SUMMARY:60th Day 10 | END:VEVENT 11 | END:VCALENDAR 12 | -------------------------------------------------------------------------------- /test/sample_23.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_23_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=MONTHLY;BYMONTHDAY=20,22,24;BYDAY=MO;COUNT=10 9 | SUMMARY:20,22,24 doms 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_23_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000201 15 | RRULE:FREQ=MONTHLY;BYMONTHDAY=22;COUNT=3 16 | SUMMARY:Some 22nd 17 | END:VEVENT 18 | BEGIN:VEVENT 19 | DTSTAMP:20140324T005526Z 20 | UID:sample_23_ics_vevent_03@example.com 21 | DTSTART;VALUE=DATE:20000229 22 | RRULE:FREQ=MONTHLY;BYDAY=2SU;COUNT=5 23 | SUMMARY:2SUN 24 | END:VEVENT 25 | END:VCALENDAR 26 | -------------------------------------------------------------------------------- /test/sample_24.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | PRODID:-//GA Financial Solutions//echse//EN 4 | CALSCALE:GREGORIAN 5 | BEGIN:VEVENT 6 | DTSTART;VALUE=DATE:20080101 7 | DTEND;VALUE=DATE:20080102 8 | UID:test_sample_24.ics_01@example.com 9 | SUMMARY:NOTRADE 10 | X-GA-STATE:NOTRADE 11 | RRULE:FREQ=YEARLY;BYDAY=FR,SA,SU 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_25.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | PRODID:-//GA Financial Solutions//echse//EN 4 | CALSCALE:GREGORIAN 5 | X-GA-MFILE:file://sample_24.ics 6 | BEGIN:VEVENT 7 | DTSTART;VALUE=DATE:20080101 8 | DTEND;VALUE=DATE:20080102 9 | UID:test_sample_25.ics_01@example.com 10 | SUMMARY:TRADE? 11 | RRULE:FREQ=MONTHLY;BYDAY=3FR 12 | X-GA-MRULE:DIR=PAST;MOVEFROM=NOTRADE 13 | END:VEVENT 14 | END:VCALENDAR 15 | -------------------------------------------------------------------------------- /test/sample_26.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | PRODID:-//GA Financial Solutions//echse//EN 4 | CALSCALE:GREGORIAN 5 | X-GA-MFILE:file://sample_24.ics 6 | BEGIN:VEVENT 7 | DTSTART;VALUE=DATE:20080101 8 | DTEND;VALUE=DATE:20080102 9 | UID:test_sample_26.ics_01@example.com 10 | SUMMARY:TRADE? 11 | RRULE:FREQ=MONTHLY;BYDAY=3FR 12 | X-GA-MRULE:DIR=FUTURE;MOVEFROM=NOTRADE 13 | END:VEVENT 14 | END:VCALENDAR 15 | -------------------------------------------------------------------------------- /test/sample_27.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART;VALUE=DATE:19540101Z 9 | DTEND;VALUE=DATE:19540102Z 10 | RRULE:FREQ=YEARLY;BYYEARDAY=-101 11 | SUMMARY:Just about a hundred days left 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_28.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART;VALUE=DATE:19540101Z 9 | DTEND;VALUE=DATE:19540102Z 10 | RRULE:FREQ=YEARLY;BYYEARDAY=-350 11 | SUMMARY:Just about a whole year left 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_29.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART;TZID=Europe/Berlin:20150105T170000 9 | DTEND;TZID=Europe/London:20150105T163000 10 | RRULE:FREQ=MONTHLY;BYDAY=1MO;COUNT=12 11 | SUMMARY:First Monday 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_30.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART;TZID=Europe/Berlin:20150105T170000 9 | DTEND;TZID=Europe/London:20150105T163000 10 | SUMMARY:Just one Monday 11 | END:VEVENT 12 | END:VCALENDAR 13 | -------------------------------------------------------------------------------- /test/sample_31.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART;TZID=Europe/Berlin:20150105T170000 9 | DTEND;TZID=Europe/London:20150105T163000 10 | SUMMARY:The fifth 11 | RDATE:20150205T160000,20150305T160000,20150405T150000,20150405T160000 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_32.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART;TZID=Europe/Berlin:20150105T170000 9 | DTEND;TZID=Europe/London:20150105T163000 10 | SUMMARY:The fifth 11 | RDATE;TZID=Europe/Berlin:20150205T170000,20150305T170000,20150405T170000 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_33.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART;TZID=Europe/Berlin:20150105T170000 9 | DTEND;TZID=Europe/London:20150105T163000 10 | SUMMARY:The fifth 11 | RDATE:20150205,20150305,20150405 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_34.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART;TZID=Europe/Berlin:20150105T170000 9 | DTEND;TZID=Europe/London:20150105T163000 10 | SUMMARY:The fifth 11 | RDATE;TZID=Europe/Berlin:20150205,20150305,20150405 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_35.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART:20150105T170000Z 9 | DTEND:20150105T173000Z 10 | SUMMARY:The fifth 11 | RDATE:20150105T175200Z 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_36.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | METHOD:PUBLISH 4 | PRODID:-//EN 5 | CALSCALE:GREGORIAN 6 | BEGIN:VEVENT 7 | DTSTAMP: 8 | DTSTART:20150105T170000Z 9 | DTEND:20150105T173000Z 10 | SUMMARY:The fifth 11 | RRULE:FREQ=MINUTELY;INTERVAL=10;UNTIL=20150105T220500Z 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/sample_37.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_37_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYEASTER=-2;BYMONTH=4;BYMONTHDAY=15;COUNT=24 9 | SUMMARY:Good Friday on April 15 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_37_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000229 15 | RRULE:FREQ=YEARLY;BYEASTER=1;BYMONTH=4;BYMONTHDAY=25;COUNT=48 16 | SUMMARY:Easter Monday on April 25 17 | END:VEVENT 18 | END:VCALENDAR 19 | -------------------------------------------------------------------------------- /test/sample_38.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | CALSCALE:GREGORIAN 4 | BEGIN:VEVENT 5 | DTSTAMP:20140324T005526Z 6 | UID:sample_38_ics_vevent_01@example.com 7 | DTSTART;VALUE=DATE:20000229 8 | RRULE:FREQ=YEARLY;BYEASTER=-2;BYMONTH=4;COUNT=10 9 | SUMMARY:Good Friday in April 10 | END:VEVENT 11 | BEGIN:VEVENT 12 | DTSTAMP:20140324T005526Z 13 | UID:sample_38_ics_vevent_02@example.com 14 | DTSTART;VALUE=DATE:20000229 15 | RRULE:FREQ=YEARLY;BYEASTER=1;BYMONTHDAY=25;COUNT=10 16 | SUMMARY:Easter Monday on the 25th 17 | END:VEVENT 18 | END:VCALENDAR 19 | -------------------------------------------------------------------------------- /test/sample_39.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | ## output scale 4 | CALSCALE:GREGORIAN 5 | BEGIN:VEVENT 6 | DTSTAMP:20140324T005526Z 7 | UID:sample_39_ics_vevent_02@example.com 8 | DTSTART;VALUE=DATE:20170625 9 | DURATION:P1D 10 | SUMMARY:HIJRI 1438-10-01 11 | END:VEVENT 12 | BEGIN:VEVENT 13 | DTSTAMP:20140324T005526Z 14 | UID:sample_39_ics_vevent_01@example.com 15 | DTSTART;VALUE=DATE;SCALE=HIJRI:14370229 16 | DURATION:P1D 17 | SUMMARY:HIJRI 1437-02-29 18 | END:VEVENT 19 | BEGIN:VEVENT 20 | DTSTAMP:20140324T005526Z 21 | UID:sample_39_ics_vevent_03@example.com 22 | DTSTART;VALUE=DATE;SCALE=HIJRI:14200101 23 | DURATION:P1D 24 | RRULE:FREQ=YEARLY;SCALE=HIJRI;BYMONTH=10;BYMONTHDAY=1;BYDAY=MO;COUNT=20 25 | SUMMARY:Recurring Hijri 26 | END:VEVENT 27 | BEGIN:VEVENT 28 | DTSTAMP:20140324T005526Z 29 | UID:sample_39_ics_vevent_04@example.com 30 | DTSTART;VALUE=DATE:2000-02-09 31 | DURATION:P1D 32 | RRULE:FREQ=MONTHLY;SCALE=HIJRI;COUNT=20 33 | SUMMARY:Monthly Hijri 34 | END:VEVENT 35 | END:VCALENDAR 36 | -------------------------------------------------------------------------------- /test/sample_40.ics: -------------------------------------------------------------------------------- 1 | BEGIN:VCALENDAR 2 | VERSION:2.0 3 | ## output scale 4 | CALSCALE:HIJRI.IA 5 | BEGIN:VEVENT 6 | DTSTAMP:20140324T005526Z 7 | UID:sample_40_ics_vevent_01@example.com 8 | DTSTART;VALUE=DATE;SCALE=HIJRI.IA:14200101 9 | DURATION:P1D 10 | RRULE:FREQ=YEARLY;SCALE=HIJRI.IA;BYMONTH=12;BYMONTHDAY=-1;COUNT=21 11 | SUMMARY:seeing if intercalary 12 | END:VEVENT 13 | END:VCALENDAR 14 | -------------------------------------------------------------------------------- /test/unroll_01.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## we know DTSTAMP lines differ so filter them out 4 | $ echse unroll --from 2000-01-01 --till 2012-01-01 -e "FREQ=MONTHLY;BYDAY=-1MO,-1TU,-1WE,-1TH,-1FR;BYSETPOS=-2" 5 | 2000-01-28 6 | 2000-02-28 7 | 2000-03-30 8 | 2000-04-27 9 | 2000-05-30 10 | 2000-06-29 11 | 2000-07-28 12 | 2000-08-30 13 | 2000-09-28 14 | 2000-10-30 15 | 2000-11-29 16 | 2000-12-28 17 | 2001-01-30 18 | 2001-02-27 19 | 2001-03-29 20 | 2001-04-27 21 | 2001-05-30 22 | 2001-06-28 23 | 2001-07-30 24 | 2001-08-30 25 | 2001-09-27 26 | 2001-10-30 27 | 2001-11-29 28 | 2001-12-28 29 | 2002-01-30 30 | 2002-02-27 31 | 2002-03-28 32 | 2002-04-29 33 | 2002-05-30 34 | 2002-06-27 35 | 2002-07-30 36 | 2002-08-29 37 | 2002-09-27 38 | 2002-10-30 39 | 2002-11-28 40 | 2002-12-30 41 | 2003-01-30 42 | 2003-02-27 43 | 2003-03-28 44 | 2003-04-29 45 | 2003-05-29 46 | 2003-06-27 47 | 2003-07-30 48 | 2003-08-28 49 | 2003-09-29 50 | 2003-10-30 51 | 2003-11-27 52 | 2003-12-30 53 | 2004-01-29 54 | 2004-02-26 55 | 2004-03-30 56 | 2004-04-29 57 | 2004-05-28 58 | 2004-06-29 59 | 2004-07-29 60 | 2004-08-30 61 | 2004-09-29 62 | 2004-10-28 63 | 2004-11-29 64 | 2004-12-30 65 | 2005-01-28 66 | 2005-02-25 67 | 2005-03-30 68 | 2005-04-28 69 | 2005-05-30 70 | 2005-06-29 71 | 2005-07-28 72 | 2005-08-30 73 | 2005-09-29 74 | 2005-10-28 75 | 2005-11-29 76 | 2005-12-29 77 | 2006-01-30 78 | 2006-02-27 79 | 2006-03-30 80 | 2006-04-27 81 | 2006-05-30 82 | 2006-06-29 83 | 2006-07-28 84 | 2006-08-30 85 | 2006-09-28 86 | 2006-10-30 87 | 2006-11-29 88 | 2006-12-28 89 | 2007-01-30 90 | 2007-02-27 91 | 2007-03-29 92 | 2007-04-27 93 | 2007-05-30 94 | 2007-06-28 95 | 2007-07-30 96 | 2007-08-30 97 | 2007-09-27 98 | 2007-10-30 99 | 2007-11-29 100 | 2007-12-28 101 | 2008-01-30 102 | 2008-02-28 103 | 2008-03-28 104 | 2008-04-29 105 | 2008-05-29 106 | 2008-06-27 107 | 2008-07-30 108 | 2008-08-28 109 | 2008-09-29 110 | 2008-10-30 111 | 2008-11-27 112 | 2008-12-30 113 | 2009-01-29 114 | 2009-02-26 115 | 2009-03-30 116 | 2009-04-29 117 | 2009-05-28 118 | 2009-06-29 119 | 2009-07-30 120 | 2009-08-28 121 | 2009-09-29 122 | 2009-10-29 123 | 2009-11-27 124 | 2009-12-30 125 | 2010-01-28 126 | 2010-02-25 127 | 2010-03-30 128 | 2010-04-29 129 | 2010-05-28 130 | 2010-06-29 131 | 2010-07-29 132 | 2010-08-30 133 | 2010-09-29 134 | 2010-10-28 135 | 2010-11-29 136 | 2010-12-30 137 | 2011-01-28 138 | 2011-02-25 139 | 2011-03-30 140 | 2011-04-28 141 | 2011-05-30 142 | 2011-06-29 143 | 2011-07-28 144 | 2011-08-30 145 | 2011-09-29 146 | 2011-10-28 147 | 2011-11-29 148 | 2011-12-29 149 | $ 150 | -------------------------------------------------------------------------------- /test/unroll_02.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## we know DTSTAMP lines differ so filter them out 4 | $ echse unroll --from 2000-01-01 --till 2002-12-31 -e "FREQ=MONTHLY;BYMONTH=3,6,9,12;BYMONTHDAY=15,16,17;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=1" 5 | 2000-03-15 6 | 2000-06-15 7 | 2000-09-15 8 | 2000-12-15 9 | 2001-03-15 10 | 2001-06-15 11 | 2001-09-17 12 | 2001-12-17 13 | 2002-03-15 14 | 2002-06-17 15 | 2002-09-16 16 | 2002-12-16 17 | $ 18 | -------------------------------------------------------------------------------- /test/unroll_03.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## we know DTSTAMP lines differ so filter them out 4 | $ echse unroll --from 2000-01-01 --till 2002-12-31 -e "FREQ=YEARLY;BYMONTH=3,6,9,12;BYMONTHDAY=15,16,17;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=1" 5 | 2000-03-15 6 | 2001-03-15 7 | 2002-03-15 8 | $ 9 | -------------------------------------------------------------------------------- /test/unroll_04.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## create inf-loop, unsatisfiable condition 4 | $ echse unroll --from 2000-01-01 --till 2002-12-31 -e "FREQ=MONTHLY;INTERVAL=3;BYMONTH=3,6,9,12;BYMONTHDAY=15,16,17;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=1" 5 | $ 6 | -------------------------------------------------------------------------------- /test/unroll_05.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## double shift 4 | $ echse unroll --from 2012-01-01 --till 2013-12-31 -e "FREQ=MONTHLY;BYMONTHDAY=1;SHIFT=-16,0B" 5 | 2012-01-16 6 | 2012-02-14 7 | 2012-03-16 8 | 2012-04-16 9 | 2012-05-16 10 | 2012-06-15 11 | 2012-07-16 12 | 2012-08-16 13 | 2012-09-17 14 | 2012-10-16 15 | 2012-11-15 16 | 2012-12-17 17 | 2013-01-16 18 | 2013-02-13 19 | 2013-03-18 20 | 2013-04-15 21 | 2013-05-16 22 | 2013-06-17 23 | 2013-07-16 24 | 2013-08-16 25 | 2013-09-16 26 | 2013-10-16 27 | 2013-11-15 28 | 2013-12-16 29 | $ 30 | -------------------------------------------------------------------------------- /test/unroll_06.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## double shift 4 | $ echse unroll --from 2012-01-01 --till 2013-12-31 -e "FREQ=YEARLY;BYMONTH=5,10;BYMONTHDAY=1;SHIFT=-16,0B" 5 | 2012-04-16 6 | 2012-09-17 7 | 2013-04-15 8 | 2013-09-16 9 | $ 10 | -------------------------------------------------------------------------------- /test/unroll_07.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## create inf-loop, unsatisfiable condition 4 | $ echse unroll --from 2012-01-01 --till 2013-12-31 -e "FREQ=MONTHLY;BYDAY=2FR;SHIFT=30" 5 | 2012-01-08 6 | 2012-02-12 7 | 2012-03-11 8 | 2012-04-08 9 | 2012-05-13 10 | 2012-06-10 11 | 2012-07-08 12 | 2012-08-12 13 | 2012-09-09 14 | 2012-10-14 15 | 2012-11-11 16 | 2012-12-09 17 | 2013-01-13 18 | 2013-02-10 19 | 2013-03-10 20 | 2013-04-07 21 | 2013-05-12 22 | 2013-06-09 23 | 2013-07-14 24 | 2013-08-11 25 | 2013-09-08 26 | 2013-10-13 27 | 2013-11-10 28 | 2013-12-08 29 | $ 30 | -------------------------------------------------------------------------------- /test/unroll_08.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## create inf-loop, unsatisfiable condition 4 | $ echse unroll --from 2012-01-01 --till 2013-12-31 -e "FREQ=MONTHLY;BYDAY=2FR;SHIFT=-30" 5 | 2012-01-11 6 | 2012-02-08 7 | 2012-03-14 8 | 2012-04-11 9 | 2012-05-09 10 | 2012-06-13 11 | 2012-07-11 12 | 2012-08-15 13 | 2012-09-12 14 | 2012-10-10 15 | 2012-11-14 16 | 2012-12-12 17 | 2013-01-09 18 | 2013-02-06 19 | 2013-03-13 20 | 2013-04-10 21 | 2013-05-15 22 | 2013-06-12 23 | 2013-07-10 24 | 2013-08-14 25 | 2013-09-11 26 | 2013-10-09 27 | 2013-11-13 28 | 2013-12-11 29 | $ 30 | -------------------------------------------------------------------------------- /test/unroll_09.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## create inf-loop, unsatisfiable condition 4 | $ echse unroll --from 2018-01-01 --till 2018-12-31 -e "FREQ=MONTHLY;BYMONTHDAY=1;SHIFT=-2B" 5 | 2018-01-30 6 | 2018-02-27 7 | 2018-03-29 8 | 2018-04-27 9 | 2018-05-30 10 | 2018-06-28 11 | 2018-07-30 12 | 2018-08-30 13 | 2018-09-27 14 | 2018-10-30 15 | 2018-11-29 16 | 2018-12-28 17 | $ 18 | -------------------------------------------------------------------------------- /test/unroll_10.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## use inverted shift semantics 4 | $ echse unroll --from 2018-01-01 --till 2018-12-31 -e "FREQ=MONTHLY;BYMONTHDAY=15;SHIFT=1B+" 5 | 2018-01-16 6 | 2018-02-16 7 | 2018-03-16 8 | 2018-04-17 9 | 2018-05-16 10 | 2018-06-18 11 | 2018-07-17 12 | 2018-08-16 13 | 2018-09-18 14 | 2018-10-16 15 | 2018-11-16 16 | 2018-12-18 17 | $ echse unroll --from 2018-01-01 --till 2018-12-31 -e "FREQ=MONTHLY;BYMONTHDAY=15;SHIFT=-1B-" 18 | 2018-01-12 19 | 2018-02-14 20 | 2018-03-14 21 | 2018-04-12 22 | 2018-05-14 23 | 2018-06-14 24 | 2018-07-12 25 | 2018-08-14 26 | 2018-09-13 27 | 2018-10-12 28 | 2018-11-14 29 | 2018-12-13 30 | $ 31 | -------------------------------------------------------------------------------- /test/unroll_11.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## use inverted shift semantics 4 | $ echse unroll --from 1970-01-01 --till 1981-12-31 -e "FREQ=MONTHLY;BYMONTH=2,4,6,8,10,12" 5 | 1970-02-01 6 | 1970-04-01 7 | 1970-06-01 8 | 1970-08-01 9 | 1970-10-01 10 | 1970-12-01 11 | 1971-02-01 12 | 1971-04-01 13 | 1971-06-01 14 | 1971-08-01 15 | 1971-10-01 16 | 1971-12-01 17 | 1972-02-01 18 | 1972-04-01 19 | 1972-06-01 20 | 1972-08-01 21 | 1972-10-01 22 | 1972-12-01 23 | 1973-02-01 24 | 1973-04-01 25 | 1973-06-01 26 | 1973-08-01 27 | 1973-10-01 28 | 1973-12-01 29 | 1974-02-01 30 | 1974-04-01 31 | 1974-06-01 32 | 1974-08-01 33 | 1974-10-01 34 | 1974-12-01 35 | 1975-02-01 36 | 1975-04-01 37 | 1975-06-01 38 | 1975-08-01 39 | 1975-10-01 40 | 1975-12-01 41 | 1976-02-01 42 | 1976-04-01 43 | 1976-06-01 44 | 1976-08-01 45 | 1976-10-01 46 | 1976-12-01 47 | 1977-02-01 48 | 1977-04-01 49 | 1977-06-01 50 | 1977-08-01 51 | 1977-10-01 52 | 1977-12-01 53 | 1978-02-01 54 | 1978-04-01 55 | 1978-06-01 56 | 1978-08-01 57 | 1978-10-01 58 | 1978-12-01 59 | 1979-02-01 60 | 1979-04-01 61 | 1979-06-01 62 | 1979-08-01 63 | 1979-10-01 64 | 1979-12-01 65 | 1980-02-01 66 | 1980-04-01 67 | 1980-06-01 68 | 1980-08-01 69 | 1980-10-01 70 | 1980-12-01 71 | 1981-02-01 72 | 1981-04-01 73 | 1981-06-01 74 | 1981-08-01 75 | 1981-10-01 76 | 1981-12-01 77 | $ 78 | -------------------------------------------------------------------------------- /test/unroll_12.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## use inverted shift semantics 4 | $ echse unroll --from 1970-01-01 --till 1981-12-31 -e "FREQ=YEARLY;BYMONTH=2,4,6,8,10,12" 5 | 1970-02-01 6 | 1970-04-01 7 | 1970-06-01 8 | 1970-08-01 9 | 1970-10-01 10 | 1970-12-01 11 | 1971-02-01 12 | 1971-04-01 13 | 1971-06-01 14 | 1971-08-01 15 | 1971-10-01 16 | 1971-12-01 17 | 1972-02-01 18 | 1972-04-01 19 | 1972-06-01 20 | 1972-08-01 21 | 1972-10-01 22 | 1972-12-01 23 | 1973-02-01 24 | 1973-04-01 25 | 1973-06-01 26 | 1973-08-01 27 | 1973-10-01 28 | 1973-12-01 29 | 1974-02-01 30 | 1974-04-01 31 | 1974-06-01 32 | 1974-08-01 33 | 1974-10-01 34 | 1974-12-01 35 | 1975-02-01 36 | 1975-04-01 37 | 1975-06-01 38 | 1975-08-01 39 | 1975-10-01 40 | 1975-12-01 41 | 1976-02-01 42 | 1976-04-01 43 | 1976-06-01 44 | 1976-08-01 45 | 1976-10-01 46 | 1976-12-01 47 | 1977-02-01 48 | 1977-04-01 49 | 1977-06-01 50 | 1977-08-01 51 | 1977-10-01 52 | 1977-12-01 53 | 1978-02-01 54 | 1978-04-01 55 | 1978-06-01 56 | 1978-08-01 57 | 1978-10-01 58 | 1978-12-01 59 | 1979-02-01 60 | 1979-04-01 61 | 1979-06-01 62 | 1979-08-01 63 | 1979-10-01 64 | 1979-12-01 65 | 1980-02-01 66 | 1980-04-01 67 | 1980-06-01 68 | 1980-08-01 69 | 1980-10-01 70 | 1980-12-01 71 | 1981-02-01 72 | 1981-04-01 73 | 1981-06-01 74 | 1981-08-01 75 | 1981-10-01 76 | 1981-12-01 77 | $ 78 | -------------------------------------------------------------------------------- /test/unroll_13.clit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/clitoris ## -*- shell-script -*- 2 | 3 | ## use inverted shift semantics 4 | $ echse unroll --from 2019-01-01 --till 2020-12-31 -e 'FREQ=MONTHLY;BYMONTH=3,5,9,12;BYMONTHDAY=10;SHIFT=-4B' 5 | 2019-03-05 6 | 2019-05-06 7 | 2019-09-04 8 | 2019-12-04 9 | 2020-03-04 10 | 2020-05-05 11 | 2020-09-04 12 | 2020-12-04 13 | $ 14 | -------------------------------------------------------------------------------- /version.mk.in: -------------------------------------------------------------------------------- 1 | VERSION = YUCK_SCMVER_VERSION 2 | PACKAGE_VERSION = $(VERSION) 3 | PACKAGE_STRING = $(PACKAGE) $(VERSION) 4 | --------------------------------------------------------------------------------