Date:2012-04-17 13:21:14 (11 years 11 months ago)
Author:Werner Almesberger
Commit:0565adf11f9045872f18c6adb93282513b8022b0
Message:genex: changed default orientation back to landscape; option -p for portrait

Since -l and -L are already taken, it's easier to make landscape the
default. genex will typically be invoked from some wrapper anyway.
Files: genex/genex.c (4 diffs)
genex/pdf.c (2 diffs)
genex/pdf.h (1 diff)

Change Details

genex/genex.c
2323static void usage(const char *name)
2424{
2525    fprintf(stderr,
26"usage: %s [-d] [-P] [-L libdir ...] [-l lib ...] hierarchy\n"
26"usage: %s [-d] [-p] [-P] [-L libdir ...] [-l lib ...] hierarchy\n"
2727" %*s [descriptions ...]\n\n"
2828" -d dump the tree instead of generating a PDF\n"
2929" -L libdir search all libraries in the specified directory\n"
3030" -l lib search the specified component library\n"
31" -p use portrait orientation; default: landscape\n"
3132" -P generate Postscript instead of PDF (mainly for debugging)\n"
3233    , name, (int) strlen(name), "");
3334    exit(1);
...... 
3839{
3940    FILE *file;
4041    int c;
41    int dump = 0, postscript = 0;
42    int dump = 0, postscript = 0, portrait = 0;
4243    char **arg;
4344
44    while ((c = getopt(argc, argv, "dL:l:P")) != EOF)
45    while ((c = getopt(argc, argv, "dL:l:Pp")) != EOF)
4546        switch (c) {
4647        case 'd':
4748            dump = 1;
...... 
5556        case 'P':
5657            postscript = 1;
5758            break;
59        case 'p':
60            portrait = 1;
61            break;
5862        default:
5963            usage(*argv);
6064        }
...... 
8892    if (dump)
8993        dump_tree();
9094    else
91        make_pdf(!postscript);
95        make_pdf(!postscript, portrait);
9296    return 0;
9397}
genex/pdf.c
3030    } name, path, lib, comment;
3131    int comment_line_skip;
3232} landscape = {
33    .file_setup = "",
33    .file_setup = "%%Orientation: Landscape",
3434    .overlay_setup = "90 rotate",
3535    .comp_setup = "",
3636    .left = 20,
...... 
211211}
212212
213213
214void make_pdf(int pdf)
214void make_pdf(int pdf, int use_portrait)
215215{
216216    FILE *out;
217217    int res;
218218
219    if (0)
220        format = landscape;
221    else
219    if (use_portrait)
222220        format = portrait;
221    else
222        format = landscape;
223223    if (pdf)
224224        out = popen(
225225            "gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=- "
genex/pdf.h
1212#ifndef PDF_H
1313#define PDF_H
1414
15void make_pdf(int pdf);
15void make_pdf(int pdf, int use_portrait);
1616
1717#endif /* !PDF_H */

Archive Download the corresponding diff file

Branches:
master



interactive