* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
-#include "args.h"
#include "util.h"
+#include "args.h"
#include "conf.h"
#include "date.h"
#include "cal.h"
#include "view.h"
+#include "print.h"
/* Config parser */
static void on_config(const char *group, const char *name, const char *key, const char *value)
/* Control-C handler, so we don't hose the therminal */
static void on_sigint(int signum)
{
- view_exit();
+ if (PRINT)
+ print_exit();
+ else
+ view_exit();
exit(0);
}
conf_setup(".lackeyrc", on_config);
/* Initialize */
- args_init();
util_init();
- conf_init();
date_init();
cal_init();
- /* Run args main */
- args_main();
+ /* Common main */
+ args_start();
+ conf_start();
- /* Run view main */
- view_init();
- view_main();
- view_exit();
+ /* Mode main */
+ if (PRINT) {
+ print_init();
+ print_main();
+ print_exit();
+ }
+ else {
+ view_init();
+ view_main();
+ view_exit();
+ }
return 0;
}