Created first project saving it and reading from .pit file!

This commit is contained in:
Mike Dvorkin
2010-07-14 22:30:53 -07:00
parent dab0f2f9bb
commit cafced4b36
18 changed files with 310 additions and 62 deletions

View File

@@ -1,21 +1,45 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include "pit.h"
#include "project.h"
#include "task.h"
PTable projects;
PTable tasks;
PTable notes;
PTable activities;
PTable users;
static int usage() {
printf("usage...\n");
return 1;
}
void die(char *msg)
{
fprintf(stderr, "pit (fatal): %s\n", msg);
exit(0);
}
void die_with_errno(char *prefix)
{
fprintf(stderr, "pit (fatal): %s: ", prefix);
perror(NULL);
exit(0);
}
int main(int argc, char *argv[]) {
int i;
char *commands[] = { "project", "task", "note", "log" };
/***
int i;
printf("argc: %d\n", argc);
for(i = 0; i < argc; i++) {
printf("argv[%d]: [%s]\n", i, argv[i]);
}
***/
if (argc > 1) {
if (strstr(commands[0], argv[1]) == commands[0]) {