ci.c File Reference

#include <sys/types.h>
#include <string.h>
#include <sys/stat.h>
#include <pwd.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <stdio.h>

Include dependency graph for ci.c:

Go to the source code of this file.

Defines

#define SUFFIX   ",S"
#define SVCDIR   "SVC"
#define LINELEN   256
#define FIX   "fix $1 Fix.$1 > New.$1; mv New.$1 $1\n"
#define PATHLEN   128

Functions

 _PROTOTYPE (int main,(int argc, char **argv))
 _PROTOTYPE (void rundiff,(void))
 _PROTOTYPE (void logmsg,(FILE *fp))
 _PROTOTYPE (void fname,(char *src, char *dst))
 _PROTOTYPE (int lockcheck,(FILE *fp, int rev))
 _PROTOTYPE (void onintr,(int dummy))
 _PROTOTYPE (char *whoami,(void))
int main (int argc, char **argv)
void rundiff ()
void logmsg (FILE *fp)
void fname (char *src, char *dst)
void svcname (char *src, char *dst)
int lockcheck (FILE *fp, int rev)
void onintr (int dummy)
void clean ()
char * whoami ()

Variables

int unlocked = 0
int relock = 0
char file [PATHLEN]
char svc [PATHLEN]
char newsvc [PATHLEN]
char line [LINELEN]
char * p
FILEsvcfp
FILEorigfp
FILEnewfp
FILEsrcfp
int rev
int status
stat stb1 stb2
char original [] = "/tmp/cioXXXXXX"
char diffout [] = "/tmp/cidXXXXXX"


Define Documentation

#define FIX   "fix $1 Fix.$1 > New.$1; mv New.$1 $1\n"
 

Definition at line 21 of file ci.c.

Referenced by main().

#define LINELEN   256
 

Definition at line 18 of file ci.c.

Referenced by decode(), dodir(), extract(), getcommand(), getfile(), getline(), gettable(), main(), and read_line().

#define PATHLEN   128
 

Definition at line 29 of file ci.c.

Referenced by deliver(), main(), svcname(), updatebox(), wcs(), and wctxpn().

#define SUFFIX   ",S"
 

Definition at line 15 of file ci.c.

Referenced by fname(), and svcname().

#define SVCDIR   "SVC"
 

Definition at line 16 of file ci.c.

Referenced by svcname().


Function Documentation

_PROTOTYPE char *  whoami,
(void) 
 

_PROTOTYPE void  onintr,
(int dummy) 
 

_PROTOTYPE int  lockcheck,
(FILE *fp, int rev
 

_PROTOTYPE void  fname,
(char *src, char *dst) 
 

_PROTOTYPE void  logmsg,
(FILE *fp
 

_PROTOTYPE void  rundiff,
(void) 
 

_PROTOTYPE int  main,
(int argc, char **argv) 
 

void clean  ) 
 

Definition at line 327 of file ci.c.

References diffout, newsvc, original, strlen(), and unlink.

void fname char *  src,
char *  dst
 

Definition at line 263 of file ci.c.

References p, strcmp, strcpy(), strlen(), and SUFFIX.

int lockcheck FILE fp,
int  rev
 

Definition at line 300 of file ci.c.

References check, fgets(), fseek(), ftell(), lock, pos, sprintf(), strcmp, strlen(), and whoami().

Referenced by main().

void logmsg FILE fp  ) 
 

Definition at line 251 of file ci.c.

References ctime(), fprintf(), gets(), now, NULL, rev, stderr, strcmp, and time.

Referenced by domark(), logerror(), main(), printkline(), and printline().

int main int  argc,
char **  argv
 

Definition at line 59 of file ci.c.

References BUFSIZ, chmod, clean(), diffout, exit(), fclose(), ferror, fgets(), FIX, fname, fopen(), fprintf(), fputs(), LINELEN, link, lockcheck(), logmsg(), mktemp(), newfp, newsvc, NULL, origfp, original, p, perror(), relock, rev, rundiff(), setbuf(), SIG_IGN, SIGHUP, SIGINT, signal(), SIGTERM, srcfp, sscanf(), stat::st_mode, stat::st_size, stat, stb2, stderr, strcmp, strcpy(), strlen(), strncmp(), strrchr(), svc, svcfp, svcname(), unlink, unlocked, and whoami().

void onintr int  dummy  ) 
 

Definition at line 319 of file ci.c.

References clean(), exit(), fprintf(), and stderr.

void rundiff  ) 
 

Definition at line 220 of file ci.c.

References clean(), close, creat, diffout, dup2, execlp, exit(), fork, fprintf(), original, perror(), status, stderr, and wait.

Referenced by main().

void svcname char *  src,
char *  dst
 

Definition at line 272 of file ci.c.

References access, NULL, p, PATHLEN, strcat(), strcpy(), strncpy(), strrchr(), SUFFIX, and SVCDIR.

Referenced by main().

char* whoami  ) 
 

Definition at line 335 of file ci.c.

References getpwuid(), getuid, NULL, and passwd::pw_name.

Referenced by lockcheck(), main(), and updatebox().


Variable Documentation

char diffout[] = "/tmp/cidXXXXXX"
 

Definition at line 47 of file ci.c.

Referenced by clean(), main(), and rundiff().

char file[PATHLEN]
 

Definition at line 34 of file ci.c.

char line[LINELEN]
 

Definition at line 37 of file ci.c.

FILE * newfp
 

Definition at line 41 of file ci.c.

char newsvc[PATHLEN]
 

Definition at line 36 of file ci.c.

Referenced by clean(), and main().

FILE* origfp
 

Definition at line 41 of file ci.c.

Referenced by main().

char original[] = "/tmp/cioXXXXXX"
 

Definition at line 46 of file ci.c.

Referenced by clean(), main(), rundiff(), strcat(), strcpy(), and strlen().

char* p
 

Definition at line 38 of file ci.c.

Referenced by __ivaliduser(), _Arguments__GetEnv(), _atn(), _catch(), _cls(), _exp(), _ext_str_cvt(), _ini(), _install(), _new(), _wrf(), _wrz(), _wsi(), _wsl(), _wsr(), _wsz(), ack_emit_instruction(), add_z_1(), add_z_2(), addent(), addenv(), addFlagsFromEnvVar(), addkey(), addpath(), alloc(), allocate(), andor(), append(), applicable(), apply_add(), argify(), arp_timeout(), asciirecv(), asciisend(), asciisize(), asin_acos(), atan(), atapi_sendpacket(), gzfilebuf::attach(), auth(), autorename(), basename(), bk_word(), bottom_line(), c_complete(), c_list(), calloc(), cap(), cat(), catch(), cdcmd(), ceol(), cfline(), cgienv(), check_for_tc(), chkinvok(), chkmail(), chkmap(), chkname(), ckmalloc(), cmdline(), cmdputs(), cmdtxt(), cnvtfile(), columns(), command(), compare(), compretval(), concat(), connect(), cons(), constant(), copy(), copy_array(), copyargs(), crnlcat(), crypt(), cvt(), cvtline(), cxsize(), d_clean(), daemonloop(), dec(), decode(), decurl(), Defdev(), delete_string(), delword(), dhcp_gettag(), dhcp_settag(), digit_convert(), display(), do_case(), do_chkm(), do_clean(), do_copy(), do_extract_currentfile(), do_forward(), do_hist(), do_line(), do_memset(), do_search(), do_svrctl(), do_visit(), do_writefile(), doall(), doauth(), docmds1(), doconfig(), docrc(), dodbgfile(), dodecl(), dodefine(), dodefn(), dodo(), dodump(), doevent(), doexp(), dofor(), doformat(), dofuncn(), DOgetreply(), doif(), doinclude(), dolev(), dologfile(), dolst(), donames(), doprint(), doproxyauth(), dopushdef(), doreturn(), dowhile(), dump_line(), dumpbitmap(), dup_line(), dyndep(), eat_dir(), echo(), emalloc(), encode64(), encrypt(), environ(), equal(), eth_arrive(), evalcmd(), evalcommand(), evaluate(), exec_one(), execute(), exgmark(), exitshell(), exp(), expand(), expandarg(), expbackq(), exportcmd(), expr(), expr1(), expr10(), expr2(), expr3(), expr4(), expr5(), expr6(), expr7(), expr8(), expr9(), f(), fast(), fef4(), fef8(), fif4(), fif8(), fill_buffer(), fill_window(), gzfilebuf::fillbuf(), find(), find_final_state(), find_word(), findauth(), flush(), fmode(), fmtdate(), fname(), forkshell(), format(), fprintf(), free_symbols(), freearea(), freecell(), freesp_inode(), ftpget(), ftppasv(), fts_alloc(), fts_build(), fts_children(), fts_close(), fts_get_stream(), fts_lfree(), fts_load(), fts_open(), fts_padjust(), fts_read(), fts_safe_changedir(), fts_set(), fts_sort(), fts_stat(), fxp_getstat(), garbage(), generate(), get_line(), get_list(), get_mem_map(), get_stack_ptr(), get_string(), get_token(), getcell(), getcomm(), getcwd(), getenv(), getgrent(), getids(), getline(), getloadavg(), getnetbyaddr(), getnetbyname(), getnetent(), getofmt(), getprotobyname(), getprotobynumber(), getprotoent(), getpwent(), getrequest(), getservbyname(), getservbyport(), getservent(), gettext(), gettok(), getuser(), getvar(), getw(), give_prompt(), gnu_emit_instruction(), gnu_load(), go(), gooddefine(), grow(), growstackblock(), gz_open(), h_search(), hard(), hashfun(), implmacros(), inc(), indx(), inet_ntoa(), initialize(), initialize_states(), initkeys(), initkwds(), inittty(), input(), insert_char(), inspect(), ipeth_restart_send(), ipeth_send(), is_escape(), itoa(), kputc(), last_argument(), last_fname(), level1(), level2(), lexi(), link1(), load(), load_update(), loadbitmap(), log_unused(), long2str(), lookup(), lookup_op(), macro(), main(), makeargs(), makedir(), makenames(), maketarget(), malloc(), match(), mcfind(), member(), merge(), mimetype(), mkbase(), mkcell(), mkloader(), mkstr(), modify(), move_to_char(), msort(), myMalloc(), n_or_rn_search(), new_state(), newcell(), next_screen(), nextblock(), ngf4(), ngf8(), node0(), node1(), node2(), node3(), node4(), not_provided_option(), nxdomain(), offset(), gzfilebuf::open(), options(), output(), pack_names(), parse(), parse_time(), parsefname(), pastat(), path_add(), Path_Dir_File(), pci_slot_name(), permissions(), perror(), pfgets(), pipeline(), popen(), pr_comm(), preadbuffer(), predef(), primary(), prin1(), prin1n(), prin2(), prin2n(), print(), Print(), print1(), print_actions(), print_conflicts(), print_date(), print_name(), print_nulls(), print_page(), print_proc_summary(), print_procs(), procargs(), process_arp_pkt(), processrequest(), procheader(), provided_option(), proxy(), purl(), putenv(), putw(), range_parse(), rd_arhdr(), re_compile(), read_line(), read_list(), read_registers(), read_write(), readcmd(), readline(), readoptions(), reallocf(), recvfile(), redraw(), regatoi(), regcomp(), remove_conflicts(), reposition(), rhscomp(), rl_readv(), rl_writev(), rotate(), run(), safe_malloc(), save_reductions(), save_shifts(), savestr(), sbe_schk(), sbe_tbent(), scan_profile(), scan_quoted(), scanflags(), scrollb(), scrollf(), search(), secondary(), sendfile(), set_defaults(), set_option(), setarea(), setmark(), setoption(), setvar(), shell(), shortprint(), show_cores(), show_part(), show_shifts(), showtop(), simple(), sinh_cosh(), skip_drive(), skipit(), slow(), sole_reduction(), splitenv(), stalloc(), std_err(), store(), strerror(), string_file(), stripspaces(), strsave(), subvpath(), svcname(), tainted(), tan(), tanh(), tar(), tel_in(), tel_out(), test11c(), test37b(), test3c(), test3d(), test9a(), test9b(), test9c(), test9d(), test9e(), test9f(), tmpfil(), tmrs_clrtimer(), token_actions(), tomark(), tryexec(), umaskcmd(), unesc(), ungetc(), uniq(), unused_rules(), variating_option(), varvalue(), virtual_copy(), vm_init(), wcgetsec(), wcs(), wctxpn(), wordlist(), wr_arhdr(), writev(), wrt_fd(), wtmp(), and xfopen().

int relock = 0
 

Definition at line 33 of file ci.c.

Referenced by main().

int rev
 

Definition at line 43 of file ci.c.

Referenced by drawtext(), fxp_probe(), fxp_report_link(), logmsg(), and main().

FILE* srcfp
 

Definition at line 42 of file ci.c.

Referenced by main().

int status
 

Definition at line 44 of file ci.c.

struct stat stb1 stb2
 

Definition at line 45 of file ci.c.

Referenced by main().

char svc[PATHLEN]
 

Definition at line 35 of file ci.c.

Referenced by main().

FILE* svcfp
 

Definition at line 40 of file ci.c.

Referenced by extract(), and main().

int unlocked = 0
 

Definition at line 32 of file ci.c.

Referenced by main().


Generated on Fri Apr 14 23:06:18 2006 for minix by  doxygen 1.4.6