cal.c File Reference

#include <stdlib.h>
#include <string.h>
#include <stdio.h>

Include dependency graph for cal.c:

Go to the source code of this file.

Defines

#define do3months   domonth
#define IO_SUCCESS   0
#define IO_ERROR   1
#define EOS   0
#define ENTRY_SIZE   3
#define DAYS_PER_WEEK   7
#define WEEKS_PER_MONTH   6
#define MONTHS_PER_LINE   3
#define MONTH_SPACE   3

Functions

 _PROTOTYPE (int main,(int argc, char **argv))
 _PROTOTYPE (void doyear,(int year))
 _PROTOTYPE (void domonth,(int year, int month))
 _PROTOTYPE (void output,(int nmonths))
 _PROTOTYPE (void calendar,(int year, int month, int indx))
 _PROTOTYPE (void usage,(char *s))
 _PROTOTYPE (int date,(int year, int month, int week, int wday))
 _PROTOTYPE (int getdate,(int week, int wday))
 _PROTOTYPE (static int Jan1,(int year))
int main (int argc, argv)
void doyear (int year)
void domonth (int year, int month)
void output (int nmonths)
void calendar (int year, int month, int indx)
void usage (char *s)
int date (int year, int month, int week, int wday)
void setmonth (int year, int month)
int getdate (int week, int wday)
static int Jan1 (int year)

Variables

char * badarg = {"Bad argument\n"}
char * how = {"Usage: cal [month] year\n"}
char layout [MONTHS_PER_LINE][WEEKS_PER_MONTH][DAYS_PER_WEEK][ENTRY_SIZE]
char outline [(MONTHS_PER_LINE *DAYS_PER_WEEK *ENTRY_SIZE)+(MONTHS_PER_LINE *MONTH_SPACE)+1]
char * weekday = " S M Tu W Th F S"
char * monthname []
struct {
   char *   f_name
   FILE *   f_fp
   int   f_type
   char *   word
   int   type
   int   val
   char *   name
   CMD   code
   void(*   fn )()
   ARGT   argt
   char *   name
   char *   nm
   char   type
   char   flags
   char *   value
   const char *   name
   signed char   fat_bits
   int   tracks
   unsigned short   heads
   unsigned short   sectors
   device_t *   dev
   int   nr_partitions
   int   free_regions
   int   used_regions
   int   sectors
   int   nr_regions
   int   biosdrive
   region_t   regions [NR_REGIONS]
   int   this_month
   int   feb
   int   sept
   int   days_in_month
   int   dow_first
   int   o_file
   int   o_field
   WINDOW *   win
   char   erase
   char   kill
   char   werase
   unsigned   baudr
   int   speedcode
   u16_t   vendor
   u16_t   device
info
static int day_month []


Define Documentation

#define DAYS_PER_WEEK   7
 

Definition at line 13 of file cal.c.

Referenced by calendar(), and output().

#define do3months   domonth
 

Definition at line 7 of file cal.c.

Referenced by main().

#define ENTRY_SIZE   3
 

Definition at line 12 of file cal.c.

Referenced by output().

#define EOS   0
 

Definition at line 10 of file cal.c.

#define IO_ERROR   1
 

Definition at line 9 of file cal.c.

Referenced by usage().

#define IO_SUCCESS   0
 

Definition at line 8 of file cal.c.

Referenced by main().

#define MONTH_SPACE   3
 

Definition at line 16 of file cal.c.

Referenced by output().

#define MONTHS_PER_LINE   3
 

Definition at line 15 of file cal.c.

Referenced by doyear().

#define WEEKS_PER_MONTH   6
 

Definition at line 14 of file cal.c.

Referenced by calendar(), and output().


Function Documentation

_PROTOTYPE static int  Jan1,
(int year) 
 

_PROTOTYPE int  getdate,
(int week, int wday) 
 

_PROTOTYPE int  date,
(int year, int month, int week, int wday) 
 

_PROTOTYPE void  usage,
(char *s
 

_PROTOTYPE void  calendar,
(int year, int month, int indx) 
 

_PROTOTYPE void  output,
(int nmonths) 
 

_PROTOTYPE void  domonth,
(int year, int month
 

_PROTOTYPE void  doyear,
(int year) 
 

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

void calendar int  year,
int  month,
int  indx
 

Definition at line 150 of file cal.c.

References DAYS_PER_WEEK, getdate(), layout, setmonth(), and WEEKS_PER_MONTH.

Referenced by domonth(), doyear(), and main().

int date int  year,
int  month,
int  week,
int  wday
 

Definition at line 222 of file cal.c.

References getdate(), and setmonth().

Referenced by dos_copydir(), getlday(), main(), timestamp(), and writeit().

void domonth int  year,
int  month
 

Definition at line 110 of file cal.c.

References badarg, calendar(), monthname, output, printf, usage, and weekday.

void doyear int  year  ) 
 

Definition at line 82 of file cal.c.

References badarg, calendar(), month, monthname, MONTHS_PER_LINE, output, printf, usage, and weekday.

Referenced by main().

int getdate int  week,
int  wday
 

Definition at line 284 of file cal.c.

References if().

Referenced by calendar(), and date().

static int Jan1 int  year  )  [static]
 

Definition at line 301 of file cal.c.

References day.

Referenced by setmonth().

int main int  argc,
argv 
 

Definition at line 47 of file cal.c.

References atoi, do3months, doyear(), how, IO_SUCCESS, strlen(), and usage.

void output int  nmonths  ) 
 

Definition at line 123 of file cal.c.

References DAYS_PER_WEEK, ENTRY_SIZE, i, layout, month, MONTH_SPACE, outline, outp, p, sprintf(), and WEEKS_PER_MONTH.

void setmonth int  year,
int  month
 

Definition at line 235 of file cal.c.

References i, and Jan1().

Referenced by calendar(), and date().

void usage char *  s  ) 
 

Definition at line 181 of file cal.c.

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


Variable Documentation

char* badarg = {"Bad argument\n"}
 

Definition at line 18 of file cal.c.

Referenced by domonth(), and doyear().

int day_month[] [static]
 

Initial value:

 {      
                  0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
}

Definition at line 218 of file cal.c.

int days_in_month
 

Definition at line 214 of file cal.c.

int dow_first
 

Definition at line 215 of file cal.c.

int feb
 

Definition at line 212 of file cal.c.

char* how = {"Usage: cal [month] year\n"}
 

Definition at line 19 of file cal.c.

Referenced by do_abort(), main(), and shutdown().

struct { ... } info [static]
 

char layout[MONTHS_PER_LINE][WEEKS_PER_MONTH][DAYS_PER_WEEK][ENTRY_SIZE]
 

Definition at line 24 of file cal.c.

Referenced by calendar(), and output().

char* monthname[]
 

Initial value:

 {
             "???",             
             "Jan", "Feb", "Mar", "Apr", "May", "Jun",
             "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}

Definition at line 30 of file cal.c.

Referenced by domonth(), and doyear().

char outline[(MONTHS_PER_LINE *DAYS_PER_WEEK *ENTRY_SIZE)+(MONTHS_PER_LINE *MONTH_SPACE)+1]
 

Definition at line 27 of file cal.c.

Referenced by copy_ident(), goto_actions(), output(), output_base(), output_check(), output_debug(), output_prefix(), output_rule_data(), output_semantic_actions(), output_stored_text(), output_stype(), output_table(), output_trailing_text(), output_yydefred(), and write_section().

int sept
 

Definition at line 213 of file cal.c.

int this_month
 

Definition at line 211 of file cal.c.

char* weekday = " S M Tu W Th F S"
 

Definition at line 29 of file cal.c.

Referenced by domonth(), and doyear().


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