#include <argp.h>
#include <pwd.h>
#include <string>
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include "incron.h"
#include "incrontab.h"
Classes | |
struct | arguments |
incrontab arguments More... | |
Defines | |
#define | INCRON_DEFAULT_EDITOR "vim" |
Enumerations | |
enum | InCronTab_Operation_t { OPER_NONE, OPER_LIST, OPER_REMOVE, OPER_EDIT } |
incrontab operations More... | |
Functions | |
static error_t | parse_opt (int key, char *arg, struct argp_state *state) |
Parses the program options (arguments). | |
bool | copy_from_file (const char *path, const char *user) |
Copies a file to an user table. | |
bool | remove_table (const char *user) |
Removes an user table. | |
bool | list_table (const char *user) |
Lists an user table. | |
bool | edit_table (const char *user) |
Allows to edit an user table. | |
int | main (int argc, char **argv) |
Variables | |
const char * | argp_program_version = INCRON_TAB_NAME " " INCRON_VERSION |
const char * | argp_program_bug_address = INCRON_BUG_ADDRESS |
static char | doc [] = "incrontab - incron table manipulator\n(c) Lukas Jelinek, 2006, 2007" |
static char | args_doc [] = "FILE" |
static struct argp_option | options [] |
static struct argp | argp = { options, parse_opt, args_doc, doc } |
Program arguments. |
inotify cron system
Copyright (C) 2006, 2007 Lukas Jelinek, <lukas@aiken.cz>
This program is free software; you can use it, redistribute it and/or modify it under the terms of the GNU General Public License, version 2 (see LICENSE-GPL).
#define INCRON_DEFAULT_EDITOR "vim" |
bool copy_from_file | ( | const char * | path, | |
const char * | user | |||
) |
Copies a file to an user table.
[in] | path | path to file |
[in] | user | user name |
bool edit_table | ( | const char * | user | ) |
Allows to edit an user table.
[in] | user | user name |
bool list_table | ( | const char * | user | ) |
Lists an user table.
[in] | user | user name |
int main | ( | int | argc, | |
char ** | argv | |||
) |
static error_t parse_opt | ( | int | key, | |
char * | arg, | |||
struct argp_state * | state | |||
) | [static] |
Parses the program options (arguments).
[in] | key | argument key (name) |
[in] | arg | argument value |
[out] | state | options setting |
bool remove_table | ( | const char * | user | ) |
Removes an user table.
[in] | user | user name |
const char* argp_program_bug_address = INCRON_BUG_ADDRESS |
const char* argp_program_version = INCRON_TAB_NAME " " INCRON_VERSION |
char args_doc[] = "FILE" [static] |
char doc[] = "incrontab - incron table manipulator\n(c) Lukas Jelinek, 2006, 2007" [static] |
struct argp_option options[] [static] |
Initial value:
{ {"list", 'l', 0, 0, "List the current table" }, {"remove", 'r', 0, 0, "Remove the table completely" }, {"edit", 'e', 0, 0, "Edit the table" }, {"user", 'u', "USER", 0, "Override the current user" }, { 0 } }