home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-29 | 42.3 KB | 2,213 lines |
- head 1.12;
- access;
- symbols
- stage1:1.8;
- locks; strict;
- comment @ * @;
-
-
- 1.12
- date 94.04.30.00.29.27; author peteric; state Exp;
- branches;
- next 1.11;
-
- 1.11
- date 94.04.29.23.46.46; author peteric; state Exp;
- branches;
- next 1.10;
-
- 1.10
- date 94.04.27.11.37.54; author peteric; state Exp;
- branches;
- next 1.9;
-
- 1.9
- date 94.03.26.11.28.03; author peteric; state Exp;
- branches;
- next 1.8;
-
- 1.8
- date 94.03.10.21.28.26; author peteric; state Exp;
- branches;
- next 1.7;
-
- 1.7
- date 94.03.07.12.44.14; author peteric; state Exp;
- branches;
- next 1.6;
-
- 1.6
- date 94.03.01.23.18.45; author peteric; state Exp;
- branches;
- next 1.5;
-
- 1.5
- date 94.02.27.19.34.47; author peteric; state Exp;
- branches;
- next 1.4;
-
- 1.4
- date 94.02.13.16.44.05; author peteric; state Exp;
- branches;
- next 1.3;
-
- 1.3
- date 94.02.12.20.32.53; author peteric; state Exp;
- branches;
- next 1.2;
-
- 1.2
- date 94.02.12.20.00.20; author peteric; state Exp;
- branches;
- next 1.1;
-
- 1.1
- date 94.02.12.19.51.34; author peteric; state Exp;
- branches;
- next ;
-
-
- desc
- @main routine for ftree family tree formatter.
- @
-
-
- 1.12
- log
- @Included Amiga Version string.
- @
- text
- @/*************************************************************************
- *
- * $RCSFile$
- *
- * $Author: peteric $
- *
- * $Date: 1994/04/29 23:46:46 $
- *
- * $Revision: 1.11 $
- *
- * Purpose: Main routine for ftree family tree formatter.
- *
- * $Log: main.c,v $
- * Revision 1.11 1994/04/29 23:46:46 peteric
- * Added 'datewidth' initialisation.
- *
- * Revision 1.10 1994/04/27 11:37:54 peteric
- * New options added (-M - multipage, -q - quick). Sorted out
- * a couple of uninitialised variables in the person & marriage
- * structures & reorganised into structure order. Added option
- * to specify size of page in inches. Deleted 'mparent' and
- * 'fparent' links - these can be got from the 'parents' links.
- * Set up 'married flag from makemarried & ensure it is set for
- * both parents (previously only set for parent who was a child
- * of someone on the tree!).
- * Changed 'con' name to more standard '-' name when output to stdout
- * wanted. Added macro 'dbprintf_note' for messages wanted on-screen
- * and in the log file. Changed the log file name to ram:debug.ftree
- * for Amiga use.
- * Moved some code for setting person & marriage widths into layout.c
- * Adjusted the code which determined the vertical space to do it
- * properly - i.e. not assume the 'person' font size is close enough for
- * all the other fonts.
- * Made the program exit if an input file not found.
- * Modified some default options settings - reduced margin for paper area
- * mainly.
- *
- * Revision 1.9 1994/03/26 11:28:03 peteric
- * Minor changes to include loadfont() calls.
- *
- * Revision 1.8 1994/03/10 21:28:26 peteric
- * Multiple pages working!
- *
- * Revision 1.7 1994/03/07 12:44:14 peteric
- * Passed on as first Version.
- *
- * Revision 1.6 1994/03/01 23:18:45 peteric
- * added landscape version of a4 paper size.
- *
- * Revision 1.5 94/02/27 19:34:47 19:34:47 peteric (Peter Ivimey-Cook)
- * added initialisations for extended structures, added new font handling code
- * and new font types, improved error message system
- *
- * Revision 1.4 1994/02/13 16:44:05 peteric
- * Various changes; include new nextmarriage() to support multiple
- * marriages & corrected some of the setup code; now -sX works!
- *
- * Revision 1.3 1994/02/12 20:32:53 peteric
- * added function comments.
- *
- * Revision 1.2 94/02/12 20:00:20 20:00:20 peteric (Peter Ivimey-Cook)
- * added in comments etc.
- *
- *
- *
- *************************************************************************/
-
- #include <stdlib.h>
- #include <stdarg.h>
- #include <string.h>
-
- #ifdef amiga
- #define DEBUGFILE "ram:debug.ftree"
- #else
- #define DEBUGFILE "debug.ftree"
- #endif
-
- /*
- * this forces the global definitions in ftree.h
- * to be declarations.
- */
- #define EXTERN
-
- #include "ftree.h"
-
- /*
- * Amiga style revision code for the ';version' command.
- */
- static char amiga_revision[] = "$VER: ftree 0.3 (29.04.94) $";
-
- papersize_t papersizes[] =
- {
- /* Name X pts Y pts (1 pts = 1/72") */
- { "11x17", 792, 1224 },
- { "a0", 2380, 3368 },
- { "a1", 1684, 2380 },
- { "a2", 1190, 1684 },
- { "a3", 842, 1190 },
- { "a4", 595, 842 },
- { "a4l", 842 , 595 },
- { "a5", 421, 595 },
- { "a6", 297, 421 },
- { "a7", 210, 297 },
- { "a8", 148, 210 },
- { "a9", 105, 148 },
- { "a10", 74, 105 },
- { "archA", 648, 864 },
- { "archB", 864, 1296 },
- { "archC", 1296, 1728 },
- { "archD", 1728, 2592 },
- { "archE", 2592, 3456 },
- { "b0", 2836, 4008 },
- { "b1", 2004, 2836 },
- { "b2", 1418, 2004 },
- { "b3", 1002, 1418 },
- { "b4", 709, 1002 },
- { "b5", 501, 709 },
- { "flsa", 612, 936 },
- { "flse", 612, 936 },
- { "halfletter", 396, 612 },
- { "ledger", 1224, 792 },
- { "legal", 612, 1008 },
- { "letter", 612, 792 },
- { "note", 540, 720 }
- };
-
- int numpapersizes = sizeof(papersizes) / sizeof(papersize_t);
-
- /*(
- *************************************************************
- *
- * Function: main
- *
- *
- * Inputs:
- * argc - arg count
- * argv - arg strings
- *
- * Outputs:
- * int - return code - 0 if OK, <>0 if error
- *
- * Error Handling:
- *
- *
- * Description:
- *
- * Main routine. Sets up initial settings, scans
- * argv array and defaults file for option settings, calls parse
- * routine to read input file & print routine to print out the
- * result.
- *
- *************************************************************
- )*/
- int main(int argc, char **argv)
- {
- options_t opts;
- int ch, quick;
- double vspace;
- FILE *f;
- extern char *optarg;
- extern int optind;
- #ifdef DEBUG
- #ifdef YYDEBUG
- extern int yydebug;
- #endif
- #ifdef FLEXDEBUG
- extern int yy_flex_debug;
- yy_flex_debug = 0;
- #endif
- #ifdef YYDEBUG
- yydebug = 0;
- #endif
- debug = 0;
- #endif
-
- verbose = FALSE;
- quick = FALSE;
- reading_file = FALSE;
- if ((psfontpath = getenv("PSFONTPATH")) == NULL)
- psfontpath = "";
-
- opts.startperson = NULL;
- opts.printoccupation = TRUE;
- opts.printids = FALSE;
- opts.outputfile = "tree.ps";
- opts.rmargin = INCH * 0.3;
- opts.lmargin = INCH * 0.3;
- opts.bmargin = INCH * 0.3;
- opts.tmargin = INCH * 0.3;
- opts.multipage = FALSE;
- opts.titlefont.size = 17.0; /* drawing title */
- opts.titlefont.linespc = 18;
- opts.titlefont.font = "ZapfChancery";
- opts.titlegreylevel = 0.9;
- opts.personfont.size = 8.0; /* names */
- opts.personfont.linespc = 9;
- opts.personfont.font = "Times-Roman";
- opts.datefont.size = 6.0; /* dates */
- opts.datefont.linespc = 7;
- opts.datefont.font = "Times-Roman";
- opts.symfont.size = 8.0; /* extra-ordinary symbols */
- opts.symfont.linespc = 9;
- opts.symfont.font = "Helvetica";
- opts.identfont.size = 7.0; /* ID codes */
- opts.identfont.linespc = 7;
- opts.identfont.font = "Times-Italic";
- opts.titlestr = "Family Tree";
- opts.maxlevel = 10;
- opts.vspace = 1.00 * INCH;
- opts.pagewidth = 0;
- opts.pageheight = 0;
- opts.papertype = "a4";
- opts.landscape = FALSE;
- opts.marrlines = 4;
- opts.bblx = opts.bbly = 0;
- opts.bbux = opts.bbuy = 0;
- opts.ticklen = 0.1*INCH;
- opts.tree_gap = (int)(0.1*INCH);
- opts.afmconst = 0.6;
- proot = NULL;
- mroot = NULL;
- glob_opts = &opts;
-
- /*
- * set up the default options.
- */
- f = fopen("ftree.options", "r");
- if (f)
- {
- parse(f, "ftree.options");
- fclose(f);
- }
-
- while((ch = getopt(argc, argv, "MP:F:hldDp:t:o:s:vL:q")) != EOF)
- {
- switch(ch)
- {
- case 'd':
- #ifdef DEBUG
- debug = 1;
- #else
- fprintf(stderr, "Debugging option not available.\n");
- #endif
- break;
-
- case 'D':
- #ifdef DEBUG
- debug = 1;
- #if YYDEBUG
- yy_flex_debug = 1;
- #endif
- #if YYDEBUG
- yydebug = 1;
- #endif
- #else
- fprintf(stderr, "Debugging option not available.\n");
- #endif
- break;
-
- case 's':
- opts.startperson = cvid(optarg);
- break;
-
- case 'q':
- quick = TRUE;
- break;
-
- case 'P':
- opts.papertype = optarg;
- break;
-
- case 'F':
- opts.personfont.font = optarg;
- break;
-
- case 'x':
- opts.printoccupation = FALSE;
- break;
-
- case 'M':
- opts.multipage = TRUE;
- break;
-
- case 'v':
- verbose = TRUE;
- break;
-
- case 'L':
- opts.maxlevel = atoi(optarg);
- break;
-
- case 'l':
- opts.landscape = TRUE;
- break;
-
- case 'o':
- opts.outputfile = optarg;
- break;
-
- case 'p':
- sscanf(optarg, "%f", &opts.personfont.size);
- break;
-
- case 't':
- opts.titlestr = optarg;
- break;
-
- case 'h':
- default:
- usage();
- exit(1);
- }
- }
-
- setpapertype(&opts);
-
- dbprintf_note(("main: loading source files\n"));
-
- if (optind == argc)
- parse(stdin, "stdin");
- else
- {
- for (; optind < argc; optind++)
- {
- f = fopen(argv[optind], "r");
- if (f != NULL)
- {
- parse(f, argv[optind]);
- fclose(f);
- }
- else
- {
- perror("opening file");
- exit(1);
- }
- }
- }
-
- dbprintf_note(("main: setting up line spacing\n"));
-
- /*
- * set up the line spacing given a point size. For small
- * sizes p+1 is good enough. For larger sizes the usual is
- * p * 1.1, which at small sizes is too close when l is
- * an integer.
- *
- * Use p+1 for now; most point sizes will be small (or very
- * small).
- */
- opts.personfont.linespc = (int)(opts.personfont.size + 1);
- opts.titlefont.linespc = (int)(opts.titlefont.size + 1);
- opts.identfont.linespc = (int)(opts.identfont.size + 1);
- opts.datefont.linespc = (int)(opts.datefont.size + 1);
- opts.symfont.linespc = (int)(opts.symfont.size + 1);
-
- /*
- * check vertical space OK. We lie about marrlines (should start at 6)
- * because the [no issue] message never appears with a marriage spike,
- * and not including it makes it look better...
- */
- opts.marrlines = 5; /* basic - two names, two dates, "no issue", x in middle, */
- vspace = 4; /* a bit of a gap... */
- vspace += opts.personfont.linespc * 3;
- vspace += opts.datefont.linespc * 2;
- vspace += opts.symfont.linespc;
-
- if (opts.printoccupation)
- {
- opts.marrlines++;
- vspace += opts.personfont.linespc;
- }
- if (opts.printids)
- {
- opts.marrlines += 2;
- vspace += opts.identfont.linespc * 2;
- }
- if (vspace > opts.vspace)
- {
- opts.vspace = vspace;
- warnmsg("vertical space btw. generations insufficient, adjusting to %.2gi.\n",
- (double)vspace / (double)INCH);
- }
-
- dbprintf_note(("main: loading fonts\n"));
-
- if (!quick)
- {
- /*
- * load the fonts we wish to use.
- */
- loadfont(&opts.personfont);
- loadfont(&opts.titlefont);
- loadfont(&opts.identfont);
- loadfont(&opts.datefont);
- loadfont(&opts.symfont);
- }
-
- dbprintf_note(("main: determining root\n"));
-
- if (opts.startperson == NULL)
- {
- if (mroot != NULL)
- {
- person_t *p;
- if (mroot->husband != NULL)
- opts.startperson = mroot->husband->id;
- else
- opts.startperson = mroot->wife->id;
- p = findperson(opts.startperson);
- warnmsg("no start person selected, selecting last defined -- %s %s (%lx)\n",
- p->firstname, p->family, opts.startperson);
- }
- else
- {
- warnmsg("no marriages found, exiting\n");
- exit(0);
- }
- }
-
- dbprintf_note(("main: determining person/marriage widths\n"));
-
- setpersonwidths(&opts, proot);
- setmarriagewidths(&opts, mroot);
-
- dbprintf_note(("main: printing tree\n"));
-
- if (proot || mroot)
- {
- print(&opts);
- }
- dbprintf_note(("main: finished.\n"));
- return (0);
- }
-
-
- /*(
- *************************************************************
- *
- * Function: usage
- *
- *
- * Inputs:
- * none.
- *
- * Outputs:
- * none (text).
- *
- * Error Handling:
- * none.
- *
- * Description:
- *
- * Prints out a message describing the valid options
- * to the program and the version number and date the program
- * was compiled.
- *
- *************************************************************
- )*/
-
- void usage(void)
- {
- int i, w;
- printf("ftree version " VERSION " (" __DATE__ ")\n");
- printf("Usage: ftree [-hlMqvx] [-P psize] [-L maxl] [-t ttl] [-s pers] [-o psfile] [-F font] [infile ...]\n");
- printf("Where:\n");
- printf(" -F font - select font 'font' to write with\n");
- printf(" -L <size> - set maximum # generations to print\n");
- printf(" -M - print out multipage plot chart\n");
- printf(" -P psize - set the paper size to 'psize'\n");
- printf(" -h - print this help message\n");
- printf(" -l - print in landscape mode\n");
- printf(" -o psfile - specify output file name ('-' == stdout)\n");
- printf(" -p <size> - standard font point size\n");
- printf(" -q - quick mode; approximate font sizes\n");
- printf(" -s pers - specify 'root' person of tree\n");
- printf(" -t ttl - title string of tree\n");
- printf(" -v - comment more verbosely.\n");
- printf(" -x - do not print occupations\n");
- printf(" psfile is the name of a PostScript output file.\n");
- printf(" infile is the name of the tree file.\n");
- printf("Allowable paper types are:\n ");
- w = 2;
- for(i = 0; i < numpapersizes; i++)
- {
- printf("%s,", papersizes[i].str);
- w += strlen(papersizes[i].str) + 2;
- if (w > 72)
- {
- w = 2;
- printf("\n ");
- }
- }
- printf(" or <w>x<h>\n");
- printf("where <w> and <h> are the width and height in inches\n");
- printf("Example font names are: (case is important)\n");
- printf(" Times-Roman, Helvetica, Courier, Utopia, ZapfChancery\n");
- }
-
- /*(
- *************************************************************
- *
- * Function: parse
- *
- *
- * Inputs:
- * fp - pointer to the text file to read
- * filename - the name of the file referenced by fp.
- *
- * Outputs:
- * none.
- *
- * Error Handling:
- * handles by yyerror - generally a message
- * is written to the standard error file.
- *
- * Description:
- *
- * calls the lex/yacc functions to parse the input
- * file for people, options and marriage definitions. The data
- * is accumulated as parsing proceeds into a pair of linked lists
- * and the options structure.
- *
- * This routine is not reentrant, but it may be
- * called more than once.
- *
- *************************************************************
- )*/
-
- void parse(FILE *fp, char *filename)
- {
- static int first_call = 1;
- extern FILE *yyin;
-
- current_filename = filename;
- yyin = fp;
- lineno = 1;
-
- if (first_call)
- first_call = 0;
- else
- yyrestart(yyin);
-
- reading_file = TRUE;
- yyparse();
- reading_file = FALSE;
- }
-
- /*(
- *************************************************************
- *
- * Function: yyerror
- *
- *
- * Inputs:
- * str - a string describing the error.
- *
- * Outputs:
- * none.
- *
- * Description:
- *
- * Prints out an error message on the standard
- * error stream, containing the file, line number and message
- * passed.
- *
- *************************************************************
- )*/
-
- void yyerror(char *str)
- {
- errmsg("%s\n",str);
- }
-
- /*(
- *************************************************************
- *
- * Function: makemarriage
- *
- *
- * Inputs:
- * prev_marr - pointer to previous marriage struct, or NULL
- * husb - ID code of husband for this marriage
- * wife - ID code of wife for this marriage
- * when - date (if known) of marriage
- * state - state (div, sep etc) of marriage
- * hint - left/right ness of children - may be (is) ignored
- * first_child - pointer to person rec for first (oldest) child
- * last_child - pointer to person rec for last (youngest) child
- *
- * Outputs:
- * marriage_t * - pointer to new marriage record.
- *
- * Error Handling:
- *
- *
- * Description:
- *
- * Constructs & checks the marriage record constructed during
- * the parse and if OK adds it to the list of marriages. Also if
- * prev_marr is non-NULL adds this marriage onto the end of the list
- * of marriages.
- *
- *************************************************************
- )*/
-
- marriage_t *makemarriage(marriage_t *prev_marr, id_t husb, id_t wife, date_t when,
- enum mstate_t state, enum mhint_t hint, person_t *first_child,
- person_t *last_child)
- {
- person_t *p;
- marriage_t *m;
-
- dbprintf(("ENTER: makemarriage\n"));
- m = malloc(sizeof *m);
- if (!m)
- {
- errmsg("ran out of memory in makemarriage\n");
- return NULL;
- }
- m->h.left = NULL;
- m->h.right = NULL;
- m->h.type = HT_MARRIAGE;
- m->h.level = 0;
- m->h.xpos = 0;
- m->h.ypos = 0;
- m->h.width = 0;
-
- m->nextmarriage = NULL;
- m->next = NULL;
- m->prev = NULL;
- m->husband = findperson(husb);
- m->wife = findperson(wife);
- m->backlink = NULL;
- m->firstchild = first_child;
- m->lastchild = last_child;
- m->when = when;
- m->state = state;
- m->hint = hint;
- m->chartref = NULL;
- m->children = 0;
- m->legal = TRUE;
- m->datewidth = 0;
-
- if (m->husband == NULL)
- {
- warnmsg("no father known for marriage (%lx) (%lx)\n", husb, wife);
- }
- else
- {
- switch (m->husband->sex)
- {
-
- case S_FEMALE:
- warnmsg("'father' in marriage (%lx) to (%lx) is female!\n", husb, wife);
- break;
- case S_UNKNOWN:
- warnmsg("in marriage (%lx) to (%lx) the father is of unknown sex\n", husb, wife);
- break;
- default:
- break;
- }
- dbprintf(("makemarriage: set married flag for %s %s\n", m->husband->firstname, m->husband->family));
- m->husband->married = TRUE;
- m->husband->fullname = TRUE;
- }
- if (m->wife == NULL)
- {
- warnmsg("no mother known for marriage (%lx) (%lx)\n", husb, wife);
- }
- else
- {
- switch (m->wife->sex)
- {
- case S_MALE:
- warnmsg("'mother' in marriage (%lx) to (%lx) is male!\n", husb, wife);
- break;
- case S_UNKNOWN:
- warnmsg("in marriage (%lx) to (%lx) the mother is of unknown sex\n", husb, wife);
- break;
- default:
- break;
- }
- dbprintf(("makemarriage: set married flag for %s %s\n", m->wife->firstname, m->husband->family));
- m->wife->married = TRUE;
- m->wife->fullname = TRUE;
- }
-
- /*
- * link in previous marriage, if any
- */
- if (prev_marr)
- {
- prev_marr->next = m;
- m->prev = prev_marr;
- }
-
- /*
- * link into global list
- */
- m->nextmarriage = mroot;
- mroot = m;
-
- p = first_child;
- while(p)
- {
- if (p->parents != NULL)
- {
- warnmsg("%s %s already has a mother or father\n", p->firstname, p->family);
- if (p->parents->husband)
- warnmsg(" father was: '%s %s'\n", p->parents->husband->firstname, p->parents->husband->family);
- if (p->parents->wife)
- warnmsg(" mother was: '%s %s'\n", p->parents->wife->firstname, p->parents->wife->family);
- warnmsg("now:\n");
- if (m->husband)
- warnmsg(" father is : '%s %s'\n", m->husband->firstname, m->husband->family);
- if (m->wife)
- warnmsg(" mother is : '%s %s'\n", m->wife->firstname, m->wife->family);
- }
-
- p->parents = m;
- p = p->nextchild;
- }
- dbprintf(("LEAVE: makemarriage\n"));
-
- return m;
- }
-
- /*(
- *************************************************************
- *
- * Function: makeperson
- *
- *
- * Inputs:
- * person - pointer to template person data
- *
- * Outputs:
- * none.
- *
- * Error Handling:
- * none.
- *
- * Description:
- *
- * Copies and validates the data pointed to by
- * person into a new record, which is added to the list of
- * known people.
- *
- *************************************************************
- )*/
-
- void makeperson(person_t *person)
- {
- person_t *p;
-
- dbprintf(("ENTER: makeperson\n"));
- p = malloc(sizeof *p);
- if (!p)
- {
- errmsg("ran out of memory in makeperson\n");
- return;
- }
- p->h.left = NULL;
- p->h.right = NULL;
- p->h.type = HT_PERSON;
- p->h.level = 0;
- p->h.width = 0;
- p->h.xpos = p->h.ypos = 0;
-
- p->nextperson = NULL;
- p->parents = NULL;
- p->nextchild = NULL;
- p->lastchild = NULL;
- strcpy(p->firstname, person->firstname);
- strcpy(p->family, person->family);
- strcpy(p->occupation, person->occupation);
- p->living = person->living;
- p->sex = person->sex;
- p->married = FALSE;
- p->firstmarriage = NULL;
- p->lastmarriage = NULL;
- p->fullname = FALSE;
- p->born = person->born;
- p->bapt = person->bapt;
- p->died = person->died;
-
- if (idcmp(person->id, NOID))
- {
- if (p->family[0] != '\0' && p->firstname[0] != '\0')
- p->id = makeid(p);
- else
- errmsg("you must provide both names if no specific ID is given\n");
- }
- else
- {
- p->id = person->id;
- }
- if (findperson(p->id))
- {
- errmsg("ID '%lx' not unique; please specify an ID code for %s %s.\n",
- p->id,
- p->firstname[0] ? p->firstname : "(noname)",
- p->family[0] ? p->family : "(noname)");
- return;
- }
-
- /*
- * link in this person to the people list.
- */
- p->nextperson = proot;
- proot = p;
- dbprintf(("LEAVE: makeperson\n"));
-
- return;
- }
-
- /*(
- *************************************************************
- *
- * Function: setpapertype
- *
- *
- * Inputs:
- * opts - current options settings, esp:
- * opts->papertype
- *
- * Outputs:
- * none.
- *
- * Error Handling:
- *
- *
- * Description:
- *
- * Uses opts->papertype to define the page size,
- * and thus set up the pageheight & pagewidth settings. If
- * landscape mode has been requested, also swaps width & height
- * to the 'orthogonal' view.
- *
- *************************************************************
- )*/
-
- void setpapertype(options_t *opts)
- {
- int i;
-
- for (i = 0; i < numpapersizes; i++)
- {
- if (stricmp(opts->papertype, papersizes[i].str) == 0)
- {
- opts->pagewidth = (int)(papersizes[i].xsz);
- opts->pageheight = (int)(papersizes[i].ysz);
- opts->papertype = papersizes[i].str;
- break;
- }
- }
- if (i == numpapersizes)
- {
- float x, y;
- if (sscanf(opts->papertype, "%fx%f", &x, &y) == 2)
- {
- opts->pagewidth = x * INCH;
- opts->pageheight = y * INCH;
- }
- else
- {
- errmsg("paper type/size not understood: '%s'\n", opts->papertype);
- exit(1);
- }
- }
- if (opts->landscape)
- {
- int t;
- t = opts->pagewidth;
- opts->pagewidth = opts->pageheight;
- opts->pageheight = t;
- }
- }
-
- /*(
- ***********************************************************************
- *
- * Function: makeid
- *
- *
- * Inputs:
- * p - pointer to a person structure
- *
- * Outputs:
- * id_t - id code generated from the data in *p
- *
- * Error Handling:
- * family & firstname can be empty.
- *
- * Description:
- *
- * Uses a simple checksum to generate an ID code for the person
- * pointed to by p. Shifts are used to spread out the number. across the
- * 32 bit code.
- *
- ***********************************************************************
- )*/
-
- id_t makeid(person_t *p)
- {
- id_t id;
- char *q;
-
- id = 0;
- q = p->family;
- if (q)
- {
- while(*q)
- id += (long)(*q++);
- }
- dbprintf(("after family id = %lx\n", id));
- id <<= 4;
- q = p->firstname;
- if (q)
- {
- while(*q)
- id += (long)(*q++);
- }
- dbprintf(("after first id = %lx\n", id));
- id <<= 4;
- id += p->born.day;
- id += p->born.month;
- id += p->born.year;
- dbprintf(("after born id = %lx\n", id));
- id <<= 4;
- id += p->died.day;
- id += p->died.month;
- id += p->died.year;
- dbprintf(("after died id = %lx\n", id));
- id <<= 4;
- id += p->bapt.day;
- id += p->bapt.month;
- id += p->bapt.year;
- dbprintf(("after bapt id = %lx\n", id));
-
- id <<= 4;
- id += p->sex;
- id += p->living;
-
- id |= 0xC0000000L; /* this segments 'generated' from 'assigned' ID's */
-
- dbprintf(("makeid: return id %lx for %s %s\n", id,
- p->firstname[0] ? p->firstname : "(none)",
- p->family[0] ? p->family : "(none)"));
- return id;
- }
-
- /*(
- ***********************************************************************
- *
- * Function: cvid
- *
- *
- * Inputs:
- * str - an id string [A-Z][0-9]
- *
- * Outputs:
- * id_t - id code number
- *
- * Error Handling:
- *
- *
- * Description:
- *
- * Converts an id string into a number, making for easier
- * comparison etc.
- *
- ***********************************************************************
- )*/
-
- id_t cvid(const char *str)
- {
- id_t code = 0;
-
- code |= (*str++) - 'A' + 10;
- while(*str)
- {
- code <<= 4;
- code |= (*str++) - '0';
- }
- /* dbprintf(("cvid(%s): id = %lx\n", str, code)); */
-
- return code;
- }
-
- /*(
- *************************************************************
- *
- * Function: _dprintf
- *
- *
- * Inputs:
- * str - printf() style format string
- * ... - args as required by str
- *
- * Outputs:
- * none.
- *
- * Error Handling:
- * none.
- *
- * Description:
- *
- * if debug mode is active, prints out the
- * string as fprintf(stderr, str) would. If not active,
- * does nothing.
- *
- *************************************************************
- )*/
- #ifdef DEBUG
- #include <stdarg.h>
-
- static FILE *debugfile = 0;
-
- void _dprintf(char *str, ...)
- {
- va_list ap;
-
- va_start(ap, str);
- if (debug)
- {
- if (debugfile == 0)
- debugfile = fopen(DEBUGFILE, "w");
-
- vfprintf(debugfile, str, ap);
- fflush(debugfile);
- }
- va_end(ap);
- }
-
- #endif
-
- @
-
-
- 1.11
- log
- @Added 'datewidth' initialisation.
- @
- text
- @d7 1
- a7 1
- * $Date: 1994/04/27 11:37:54 $
- d9 1
- a9 1
- * $Revision: 1.10 $
- d14 3
- d85 5
- @
-
-
- 1.10
- log
- @New options added (-M - multipage, -q - quick). Sorted out
- a couple of uninitialised variables in the person & marriage
- structures & reorganised into structure order. Added option
- to specify size of page in inches. Deleted 'mparent' and
- 'fparent' links - these can be got from the 'parents' links.
- Set up 'married flag from makemarried & ensure it is set for
- both parents (previously only set for parent who was a child
- of someone on the tree!).
- Changed 'con' name to more standard '-' name when output to stdout
- wanted. Added macro 'dbprintf_note' for messages wanted on-screen
- and in the log file. Changed the log file name to ram:debug.ftree
- for Amiga use.
- Moved some code for setting person & marriage widths into layout.c
- Adjusted the code which determined the vertical space to do it
- properly - i.e. not assume the 'person' font size is close enough for
- all the other fonts.
- Made the program exit if an input file not found.
- Modified some default options settings - reduced margin for paper area
- mainly.
- @
- text
- @d7 1
- a7 1
- * $Date: 1994/03/26 11:28:03 $
- d9 1
- a9 1
- * $Revision: 1.9 $
- d14 21
- d634 1
- @
-
-
- 1.9
- log
- @Minor changes to include loadfont() calls.
- @
- text
- @d7 1
- a7 1
- * $Date: 1994/03/10 21:28:26 $
- d9 1
- a9 1
- * $Revision: 1.8 $
- d14 3
- d48 6
- d128 2
- a129 1
- int ch;
- d148 1
- d150 3
- d157 4
- a160 4
- opts.rmargin = INCH * 0.4;
- opts.lmargin = INCH * 0.4;
- opts.bmargin = INCH * 0.4;
- opts.tmargin = INCH * 0.4;
- d164 1
- a164 1
- opts.titlefont.font = "Zapf-Chancery";
- d190 1
- a190 1
- opts.afmconst = 0.45;
- d205 1
- a205 1
- while((ch = getopt(argc, argv, "MP:F:hldDp:t:o:s:vL:")) != EOF)
- d234 4
- a285 9
- /*
- * calculate the number of lines needed to print a marriage.
- */
- opts.marrlines = 5; /* basic - two names, two dates, x in middle */
- if (opts.printoccupation)
- opts.marrlines++;
- if (opts.printids)
- opts.marrlines += 2;
-
- d287 2
- d303 1
- d305 2
- d310 2
- d328 3
- a330 2
- * check vertical space OK. Note this isn't strictly correct, as the
- * dates are printed a point size smaller...
- d332 12
- a343 1
- if ((opts.personfont.linespc * opts.marrlines) >= opts.vspace)
- d345 8
- a352 2
- warnmsg("vertical space btw. generations insufficient, adjusting.\n");
- opts.vspace = (opts.personfont.linespc * opts.marrlines) + 1;
- d355 13
- a367 8
- /*
- * load the fonts we wish to use.
- */
- loadfont(&opts.personfont);
- loadfont(&opts.titlefont);
- loadfont(&opts.identfont);
- loadfont(&opts.datefont);
- loadfont(&opts.symfont);
- d369 2
- d391 6
- a396 8
- {
- marriage_t *m = mroot;
- while(m)
- {
- m->width = widthofmarriage(&opts, m);
- m = m->nextmarriage;
- }
- }
- d402 1
- d435 1
- a435 1
- printf("Usage: ftree [-vlhx] [-P psize] [-L maxl] [-t ttl] [-s pers] [-o psfile] [-F font] [infile ...]\n");
- d439 1
- d443 1
- a443 1
- printf(" -o psfile - specify output file name ('con' == stdout)\n");
- d445 1
- d456 1
- a456 1
- printf("%s%s", papersizes[i].str, i < (numpapersizes-1) ? ", " : "\n");
- d458 1
- a458 1
- if (w > 76)
- d464 2
- d584 1
- d591 8
- a598 2
- m->firstchild = NULL;
- m->lastchild = NULL;
- d600 4
- d605 3
- a607 2
- m->chartref = NULL;
- m->level = 0;
- d610 4
- a613 2
- m->husband = findperson(husb);
- m->wife = findperson(wife);
- d622 1
- d632 3
- d653 3
- d657 1
- a657 6
- m->firstchild = first_child;
- m->lastchild = last_child;
- m->xpos = 0;
- m->ypos = 0;
- m->width = 0;
- m->when = when;
- a660 2
- m->next = NULL;
- m->prev = NULL;
- d676 1
- a676 1
- if ((p->mparent != NULL) || (p->fparent != NULL))
- d678 5
- a682 5
- warnmsg("%s %s (%lx) already has a mother or father\n", p->firstname, p->family, p->id);
- if (p->mparent)
- warnmsg(" father was: '%s %s' (%lx)\n", p->mparent->firstname, p->mparent->family, p->mparent->id);
- if (p->fparent)
- warnmsg(" mother was: '%s %s' (%lx)\n", p->fparent->firstname, p->fparent->family, p->fparent->id);
- d685 1
- a685 1
- warnmsg(" father is : '%s %s' (%lx)\n", m->husband->firstname, m->husband->family, m->husband->id);
- d687 1
- a687 1
- warnmsg(" mother is : '%s %s' (%lx)\n", m->wife->firstname, m->wife->family, m->wife->id);
- a689 2
- p->mparent = m->husband;
- p->fparent = m->wife;
- d693 1
- d726 1
- d733 7
- d741 1
- a741 2
- p->mparent = NULL;
- p->fparent = NULL;
- d744 4
- a747 3
- p->parents = NULL;
- p->left = NULL;
- p->right = NULL;
- d749 4
- d754 1
- d756 1
- a756 8
- p->living = person->living;
- p->fullname = FALSE;
- p->level = 0;
- p->width = 0;
- p->xpos = p->ypos = 0;
- strcpy(p->occupation, person->occupation);
- strcpy(p->family, person->family);
- strcpy(p->firstname, person->firstname);
- d782 3
- d829 2
- a830 2
- int x, y;
- if (sscanf(opts->papertype, "%dx%d", &x, &y) == 2)
- d832 2
- a833 3
- opts->pagewidth = x;
- opts->pageheight = y;
- opts->papertype = "special";
- d956 1
- a956 1
- dbprintf(("cvid(%s): id = %lx\n", str, code));
- d998 1
- a998 1
- debugfile = fopen("debug.ftree", "w");
- @
-
-
- 1.8
- log
- @Multiple pages working!
- @
- text
- @d3 1
- a3 1
- * $Name$
- d7 1
- a7 1
- * $Date: 1994/03/07 12:44:14 $
- d9 1
- a9 1
- * $Revision: 1.7 $
- d14 3
- a268 15
- * set up the line spacing given a point size. For small
- * sizes p+1 is good enough. For larger sizes the usual is
- * p * 1.1, which at small sizes is too close when l is
- * an integer.
- *
- * Use p+1 for now; most point sizes will be small (or very
- * small).
- */
- opts.personfont.linespc = (int)(opts.personfont.size + 1);
- opts.titlefont.linespc = (int)(opts.titlefont.size + 1);
- opts.identfont.linespc = (int)(opts.identfont.size + 1);
- opts.datefont.linespc = (int)(opts.datefont.size + 1);
- opts.symfont.linespc = (int)(opts.symfont.size + 1);
-
- /*
- a276 10
- /*
- * check vertical space OK. Note this isn't strictly correct, as the
- * dates are printed a point size smaller...
- */
- if ((opts.personfont.linespc * opts.marrlines) >= opts.vspace)
- {
- warnmsg("vertical space btw. generations insufficient, adjusting.\n");
- opts.vspace = (opts.personfont.linespc * opts.marrlines) + 1;
- }
-
- d296 34
- d350 9
- a500 30
- void errmsg(const char *str, ...)
- {
- va_list ap;
-
- va_start(ap, str);
- if (reading_file)
- fprintf(stderr, "%s: %d: ", current_filename, lineno);
- fprintf(stderr, "error: ");
- vfprintf(stderr, str, ap);
- va_end(ap);
-
- if (++errors > 5)
- {
- fprintf(stderr, "ftree: error: too many errors; exiting.\n");
- exit(1);
- }
- }
-
- void warnmsg(const char *str, ...)
- {
- va_list ap;
-
- va_start(ap, str);
- if (reading_file)
- fprintf(stderr, "%s: %d: ", current_filename, lineno);
- fprintf(stderr, "warning: ");
- vfprintf(stderr, str, ap);
- va_end(ap);
- }
-
- d504 1
- a504 1
- * Function:
- d508 8
- a515 1
- *
- d518 1
- a518 1
- *
- d525 4
- a528 1
- *
- a596 1
- m->height = 0;
- d602 1
- d604 1
- d606 2
- a682 1
- p->width = 0;
- d689 1
- a723 185
- * Function: findmarriage1
- *
- *
- * Inputs:
- * id - the ID to look for
- *
- * Outputs:
- * marriage_t * - pointer to a marriage struct or NULL
- *
- * Error Handling:
- *
- *
- * Description:
- *
- * Finds the marriage in which one person has the
- * ID code 'id'.
- *
- *************************************************************
- )*/
-
- marriage_t *findmarriage1(id_t id)
- {
- marriage_t *m;
-
- if (id == NOID)
- {
- dbprintf(( "findmarriage1: no id\n"));
- return NULL;
- }
- m = mroot;
- while(m)
- {
- if (((m->husband != NULL) && idcmp(id, m->husband->id)) ||
- ((m->wife != NULL) && idcmp(id, m->wife->id)))
- {
- dbprintf(( "findmarriage1: found match %lx\n", id));
- break;
- }
- m = m->nextmarriage;
- }
- return m;
- }
-
- /*(
- *************************************************************
- *
- * Function: findmarriage2
- *
- *
- * Inputs:
- * id - the ID to look for
- *
- * Outputs:
- * marriage_t * - pointer to a marriage struct or NULL
- *
- * Error Handling:
- *
- *
- * Description:
- *
- * Finds the marriage in which one person has the
- * ID code 'id'.
- *
- *************************************************************
- )*/
-
- marriage_t *findmarriage2(id_t hid, id_t wid)
- {
- marriage_t *m;
-
- if (hid == NOID || wid == NOID)
- {
- dbprintf(( "findmarriage2: no id\n"));
- return NULL;
- }
- m = mroot;
- while(m)
- {
- if (((m->husband != NULL) && idcmp(hid, m->husband->id)) ||
- ((m->wife != NULL) && idcmp(wid, m->wife->id)))
- {
- dbprintf(( "findmarriage2: found match h%lx/w%lx\n", hid, wid));
- break;
- }
- m = m->nextmarriage;
- }
- return m;
- }
-
- /*(
- *************************************************************
- *
- * Function: nextmarriage
- *
- *
- * Inputs:
- * m - pointer to previously found marriage
- *
- * Outputs:
- * marriage_t * - pointer to next marriage, or NULL
- *
- * Error Handling:
- * Returns NULL if no marriage, or ID is unset.
- *
- * Description:
- *
- *
- *
- *************************************************************
- )*/
-
- marriage_t *nextmarriage(marriage_t *m, id_t id)
- {
- if (id == NOID)
- {
- dbprintf(( "nextmarriage: ERROR no id\n"));
- return NULL;
- }
-
- /*
- * starting at the current (assumed) match, find the next one...
- */
- m = m->nextmarriage;
- while(m)
- {
- if (((m->husband != NULL) && idcmp(id, m->husband->id)) ||
- ((m->wife != NULL) && idcmp(id, m->wife->id)))
- {
- dbprintf(( "nextmarriage: found match %lx\n", id));
- break;
- }
- m = m->nextmarriage;
- }
- return m;
- }
-
- /*(
- *************************************************************
- *
- * Function: findperson
- *
- *
- * Inputs:
- * id - person id code
- *
- * Outputs:
- * person_t * - pointer to a person record
- *
- * Error Handling:
- * Checks that id is non-null. returns NULL if
- * person not found.
- *
- * Description:
- *
- * Returns (a pointer to) the person record for
- * the person who matches the id code.
- *
- *************************************************************
- )*/
-
- person_t *findperson(id_t id)
- {
- person_t *p;
- p = proot;
-
- if (id == NULL)
- {
- dbprintf(( "findperson: no id\n"));
- return NULL;
- }
- while(p)
- {
- if (idcmp(id, p->id))
- {
- dbprintf(( "findperson: found match %lx\n", p->id));
- break;
- }
- p = p->nextperson;
- }
- return p;
- }
-
- /*(
- *************************************************************
- *
- d755 2
- a756 2
- opts->pagewidth = (int)(papersizes[i].xsz * 0.96);
- opts->pageheight = (int)(papersizes[i].ysz * 0.96);
- d759 15
- @
-
-
- 1.7
- log
- @Passed on as first Version.
- @
- text
- @d7 1
- a7 1
- * $Date: 1994/03/01 23:18:45 $
- d9 1
- a9 1
- * $Revision: 1.6 $
- d14 3
- d140 5
- a144 4
- opts.rmargin = INCH * 0.5;
- opts.lmargin = INCH * 0.5;
- opts.bmargin = INCH * 0.5;
- opts.tmargin = INCH * 0.5;
- d172 2
- d188 1
- a188 1
- while((ch = getopt(argc, argv, "P:F:hldDp:t:o:s:vL:")) != EOF)
- d230 4
- d549 1
- a1094 3
- if (debugfile == 0)
- debugfile = fopen("debug.ftree", "w");
-
- d1098 3
- @
-
-
- 1.6
- log
- @added landscape version of a4 paper size.
- @
- text
- @d7 1
- a7 1
- * $Date: 94/02/27 19:34:47 $
- d9 1
- a9 1
- * $Revision: 1.5 $
- d13 4
- a16 1
- * $Log: main.c,v $
- d522 1
- a522 1
- void makemarriage(marriage_t *prev_marr, id_t husb, id_t wife, date_t when,
- d533 1
- a533 1
- return;
- d622 2
- @
-
-
- 1.5
- log
- @added initialisations for extended structures, added new font handling code
- and new font types, improved error message system
- @
- text
- @d7 1
- a7 1
- * $Date: 1994/02/13 16:44:05 $
- d9 1
- a9 1
- * $Revision: 1.4 $
- d13 5
- a17 1
- * $Log: main.c,v $
- d53 1
- @
-
-
- 1.4
- log
- @Various changes; include new nextmarriage() to support multiple
- marriages & corrected some of the setup code; now -sX works!
- @
- text
- @d7 1
- a7 1
- * $Date: 1994/02/12 20:32:53 $
- d9 1
- a9 1
- * $Revision: 1.3 $
- d14 4
- a27 1
- #include <stdio.h>
- d29 2
- d32 4
- d42 1
- d80 1
- a80 1
- * Function:
- d84 2
- a85 1
- *
- d88 1
- a88 1
- *
- d95 4
- a98 1
- *
- d124 1
- d133 16
- a148 10
- opts.title.size = 17.0;
- opts.title.linespc = 18;
- opts.title.font = "Zapf-Chancery";
- opts.titlegreylevel = 0.80;
- opts.person.size = 9.0;
- opts.person.linespc = 10;
- opts.person.font = "Times-Roman";
- opts.ident.size = 8.0;
- opts.ident.linespc = 9;
- opts.ident.font = "Times-Italic";
- d201 1
- a201 1
- opts.startperson = optarg;
- d209 1
- a209 1
- opts.person.font = optarg;
- d233 1
- a233 1
- opts.person.size = atof(optarg);
- d247 14
- a260 3
- opts.person.linespc = (int)(opts.person.size + 1);
- opts.title.linespc = (int)(opts.title.size + 1);
- opts.ident.linespc = (int)(opts.ident.size + 1);
- d265 1
- a265 1
- opts.marrlines = 5; /* basic - two names, two dates, x in middle */
- d275 1
- a275 1
- if (opts.person.linespc * opts.marrlines >= opts.vspace)
- d277 2
- a278 2
- fprintf(stderr, "warning: vertical space btw. generations insufficient, adjusting.\n");
- opts.vspace = (opts.person.linespc * opts.marrlines) + 1;
- d310 1
- a310 1
- fprintf(stderr, "warning: no start person selected, selecting last defined -- %s %s (%s)\n",
- d315 1
- a315 1
- fprintf(stderr, "warning: no marriages found, exiting\n");
- a319 1
-
- d351 1
- d384 1
- a384 1
- printf(" Times-Roman, Helvetica, Courier, Utopia\n");
- d431 1
- d433 1
- d459 2
- a460 2
- extern int lineno;
- extern char *current_filename;
- d462 16
- a477 1
- fprintf(stderr, "%s: %d: %s\n", current_filename, lineno, str);
- d480 12
- d514 3
- a516 2
- void makemarriage(char *husb, char *wife, date_t when, enum mstate_t state,
- person_t *first_child, person_t *last_child)
- d524 1
- a524 1
- yyerror("ran out of memory in makemarriage");
- d529 3
- a531 1
- m->next = NULL;
- d533 1
- d538 1
- a538 2
- if (verbose)
- fprintf(stderr, "warning: no father known for marriage (%s) (%s)\n", husb, wife);
- d545 1
- a545 1
- fprintf(stderr, "warning: 'father' in marriage (%s) to (%s) is female!\n", husb, wife);
- d548 1
- a548 1
- fprintf(stderr, "warning: in marriage (%s) to (%s) the father is of unknown sex\n", husb, wife);
- d556 1
- a556 2
- if (verbose)
- fprintf(stderr, "warning: no mother known for marriage (%s) (%s)\n", husb, wife);
- d563 1
- a563 1
- fprintf(stderr, "warning: 'mother' in marriage (%s) to (%s) is male!\n", husb, wife);
- d566 1
- a566 1
- fprintf(stderr, "warning: in marriage (%s) to (%s) the mother is of unknown sex\n", husb, wife);
- d579 11
- a589 1
- m->next = mroot;
- d597 1
- a597 1
- fprintf(stderr, "ftree: warning: %s %s (%s) already has a mother or father\n", p->firstname, p->family, p->id);
- d599 1
- a599 1
- fprintf(stderr, " father was: '%s %s' (%s)\n", p->mparent->firstname, p->mparent->family, p->mparent->id);
- d601 2
- a602 2
- fprintf(stderr, " mother was: '%s %s' (%s)\n", p->fparent->firstname, p->fparent->family, p->fparent->id);
- fprintf(stderr, "now:\n");
- d604 1
- a604 1
- fprintf(stderr, " father is : '%s %s' (%s)\n", m->husband->firstname, m->husband->family, m->husband->id);
- d606 1
- a606 1
- fprintf(stderr, " mother is : '%s %s' (%s)\n", m->wife->firstname, m->wife->family, m->wife->id);
- d611 1
- d619 1
- a619 1
- * Function:
- d623 1
- a623 1
- *
- d626 1
- a626 1
- *
- d629 1
- a629 1
- *
- d633 3
- a635 1
- *
- d639 1
- d647 1
- a647 1
- yyerror("ran out of memory in makeperson");
- d654 4
- d664 1
- d669 1
- a669 1
- if (strcmp(person->id, "(blank)") == 0)
- d672 1
- a672 9
- {
- sprintf(p->id, "%s %s", p->firstname, p->family);
- if (findperson(p->id))
- {
- fprintf(stderr,"%s: %d: generated ID '%s' not unique; please specify an ID code.\n",
- current_filename, lineno, p->id);
- return;
- }
- }
- d674 1
- a674 1
- yyerror("you must provide both names if no specific ID is given");
- d678 1
- a678 1
- strcpy(p->id, person->id);
- d680 9
- d699 1
- a699 1
- * Function:
- d703 1
- a703 1
- *
- d706 1
- a706 1
- *
- d713 2
- a714 1
- *
- d719 1
- a719 1
- marriage_t *findmarriage(char*id)
- d723 1
- a723 1
- if (id == NULL)
- d725 1
- a725 1
- dbprintf(( "findmarriage: no id\n"));
- d731 2
- a732 2
- if (((m->husband != NULL) && (strcmp(id, m->husband->id) == 0)) ||
- ((m->wife != NULL) && (strcmp(id, m->wife->id) == 0)))
- d734 1
- a734 1
- dbprintf(( "findmarriage: found match %s\n", id));
- d737 1
- a737 1
- m = m->next;
- d745 1
- a745 1
- * Function:
- d749 1
- a749 1
- *
- d752 1
- a752 1
- *
- d759 45
- d805 1
- d809 2
- a810 1
- marriage_t *nextmarriage(marriage_t *m, char *id)
- d812 1
- a812 1
- if (id == NULL || m == NULL)
- d821 1
- a821 1
- m = m->next;
- d824 2
- a825 2
- if (((m->husband != NULL) && (strcmp(id, m->husband->id) == 0)) ||
- ((m->wife != NULL) && (strcmp(id, m->wife->id) == 0)))
- d827 1
- a827 1
- dbprintf(( "nextmarriage: found match %s\n", id));
- d830 1
- a830 1
- m = m->next;
- d838 1
- a838 1
- * Function:
- d842 1
- a842 1
- *
- d845 1
- a845 1
- *
- d848 2
- a849 1
- *
- d853 2
- a854 1
- *
- d858 2
- a859 1
- person_t *findperson(char*id)
- d871 1
- a871 1
- if (strcmp(id, p->id) == 0)
- d873 1
- a873 1
- dbprintf(( "findperson: found match %s\n", p->id));
- d884 1
- a884 1
- * Function:
- d888 2
- a889 1
- *
- d892 1
- a892 1
- *
- d899 4
- a902 1
- *
- d906 1
- d931 1
- a931 1
- *************************************************************
- d933 1
- a933 1
- * Function:
- d937 1
- a937 1
- *
- d940 6
- d947 3
- d951 64
- d1020 38
- d1059 3
- d1068 2
- d1074 3
- d1080 2
- a1081 1
- vfprintf(stderr, str, ap);
- d1087 1
- @
-
-
- 1.3
- log
- @added function comments.
- @
- text
- @d7 1
- a7 1
- * $Date: 94/02/12 20:00:20 $
- d9 1
- a9 1
- * $Revision: 1.2 $
- d13 4
- a16 1
- * $Log: main.c,v $
- d33 30
- a62 30
- { "11x17", 792, 1224 },
- { "a0", 2380, 3368 },
- { "a1", 1684, 2380 },
- { "a2", 1190, 1684 },
- { "a3", 842, 1190 },
- { "a4", 595, 842 },
- { "a5", 421, 595 },
- { "a6", 297, 421 },
- { "a7", 210, 297 },
- { "a8", 148, 210 },
- { "a9", 105, 148 },
- { "a10", 74, 105 },
- { "archA", 648, 864 },
- { "archB", 864, 1296 },
- { "archC", 1296, 1728 },
- { "archD", 1728, 2592 },
- { "archE", 2592, 3456 },
- { "b0", 2836, 4008 },
- { "b1", 2004, 2836 },
- { "b2", 1418, 2004 },
- { "b3", 1002, 1418 },
- { "b4", 709, 1002 },
- { "b5", 501, 709 },
- { "flsa", 612, 936 },
- { "flse", 612, 936 },
- { "halfletter", 396, 612 },
- { "ledger", 1224, 792 },
- { "legal", 612, 1008 },
- { "letter", 612, 792 },
- { "note", 540, 720 }
- d95 2
- a96 1
- #if YYDEBUG
- d99 7
- d107 1
- d121 1
- d135 1
- d153 1
- a153 1
- while((ch = getopt(argc, argv, "P:F:hldp:t:o:s:vL:")) != EOF)
- d160 11
- d227 22
- d268 1
- a268 1
- if (opts.startperson == NULL && mroot != NULL)
- d270 11
- a280 3
- person_t *p;
- if (mroot->husband != NULL)
- opts.startperson = mroot->husband->id;
- d282 4
- a285 9
- opts.startperson = mroot->wife->id;
- p = findperson(opts.startperson);
- fprintf(stderr, "warning: no start person selected, selecting last defined -- %s %s (%s)\n",
- p->firstname, p->family, opts.startperson);
- }
- else
- {
- fprintf(stderr, "warning: no start person selected and no marriages, exiting\n");
- exit(0);
- d300 1
- a300 1
- * Function:
- d304 1
- a304 1
- *
- d307 1
- a307 1
- *
- d310 1
- a310 1
- *
- d314 3
- a316 1
- *
- d323 2
- a324 2
- printf("ftree version 1.0 (" __DATE__ ")\n");
- printf("Usage: ftree [-hx] [-t ttl] [-s pers] [-o psfile] [-F font] [infile ...]\n");
- a325 1
- printf(" -h - print this help message\n");
- d327 1
- d329 2
- a330 3
- printf(" -H hspace - set horizontal space to 'hspc'\n");
- printf(" -V vspace - set vertical space to 'vspc'\n");
- printf(" -s pers - specify 'root' person of tree\n");
- a331 2
- printf(" -x - do not print occupations\n");
- printf(" -l - print in landscape mode\n");
- d333 1
- d335 2
- d358 1
- a358 1
- * Function:
- d362 2
- a363 1
- *
- d366 1
- a366 1
- *
- d369 2
- a370 1
- *
- d374 7
- a380 1
- *
- d405 1
- a405 1
- * Function:
- d409 1
- a409 1
- *
- d412 1
- a412 4
- *
- *
- * Error Handling:
- *
- d416 3
- a418 1
- *
- d584 1
- a608 1
- strcpy(p->occupation, person->occupation);
- @
-
-
- 1.2
- log
- @added in comments etc.
- @
- text
- @d5 1
- a5 1
- * $Author$
- d7 1
- a7 1
- * $Date$
- d9 1
- a9 1
- * $Revision$
- d13 4
- a16 1
- * $Log$
- d64 21
- d247 21
- d303 21
- a335 1
- #if 0
- a337 1
- #endif
- d342 21
- d372 22
- d483 21
- d554 21
- d599 67
- d688 21
- d732 21
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d1 16
- a16 3
- /*
- * main.c
- */
- @
-