init
This commit is contained in:
commit
416ef34ffd
7 files changed
+212
No files matched your search
@@ -0,0 +1,6 @@
|
||||
#ifndef CONFIG_H_
|
||||
#define CONFIG_H_
|
||||
|
||||
#define NC_EVENTS_FILE "/etc/nc/events"
|
||||
|
||||
#endif
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../include/argparse.h"
|
||||
|
||||
static const char *const usages[] = {
|
||||
"nc -c -r DATE EVENT_NAME",
|
||||
NULL,
|
||||
};
|
||||
|
||||
#define PERM_READ (1<<0)
|
||||
#define PERM_WRITE (1<<1)
|
||||
#define PERM_EXEC (1<<2)
|
||||
|
||||
int main (int argc, const char **argv) {
|
||||
int
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../include/libcolor.h"
|
||||
|
||||
#include "config.h"
|
||||
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../include/libcolor.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
char printevents() {
|
||||
FILE *fp;
|
||||
|
||||
char filename[100], contents;
|
||||
|
||||
fp = fopen(NC_EVENTS_FILE, "r");
|
||||
if (fp == NULL) {
|
||||
printf(TXT_BOLD COL_RED "events file does not exist\n");
|
||||
printf("ensure the events file defined in config.h exists\n" COL_RESET TXT_RESET);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
contents = fgetc(fp);
|
||||
while (contents != EOF) {
|
||||
printf ("%c", contents);
|
||||
contents = fgetc(fp);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
exit(0);
|
||||
}
|
||||
Reference in new issue
Block a user