home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / DOOG / CBASE09.ZIP / CBASE.ZIP / ROLO.C < prev    next >
Text File  |  1989-08-31  |  16KB  |  576 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "rolo.c    1.1 - 89/08/31" */
  5.  
  6. #include <blkio.h>
  7. #include <cbase.h>
  8. #include <ctype.h>
  9. #include <errno.h>
  10. #include <stdio.h>
  11. /* #include <stdlib.h> */
  12. void exit();        /* delete if you have stdlib.h */
  13. #define EXIT_SUCCESS    (0)
  14. #define EXIT_FAILURE    (1)
  15. /* #include <string.h> */
  16. #include "rolo.h"
  17.  
  18. #define USAGE    ("Usage: rolo")
  19.  
  20. static void cardput(/*rolo_t *rlp*/);
  21.  
  22. /*man---------------------------------------------------------------------------
  23. NAME
  24.      rolo - card file
  25.  
  26. SYNOPSIS
  27.      rolo
  28.  
  29. DESCRIPTION
  30.      rolo is a rudimentary implementation of a card file program.  Its purpose
  31.      is to illustrate fundamental usage of the cbase library.  In order to
  32.      allow rolo to be compiled without any additional libraries, only a
  33.      minimal user interface has been implemented.
  34.  
  35. SEE ALSO
  36.      cbase.
  37.  
  38. ------------------------------------------------------------------------------*/
  39. int main(argc, argv)
  40. int argc;
  41. char *argv[];
  42. {
  43.     int        rs    = 0;
  44.     cbase_t *    cbp    = NULL;
  45.     rolo_t        rl    /*= {0}*/;
  46.     int        field    = 0;
  47.     int        c    = 0;
  48.     char        buf[256];
  49.     int        i    = 0;
  50.  
  51.     /* initialize storage */
  52.     memset((void *)&rl, 0, sizeof(rl));
  53.     memset((void *)buf, 0, sizeof(buf));
  54.  
  55.     /* process command line arguments */
  56.     if (argc != 1) {
  57.         printf("%s\n", USAGE);
  58.         bexit(EXIT_FAILURE);
  59.     }
  60.  
  61.     /* open cbase */
  62.     cbp = cbopen(ROLO, "r+", rl_fields, RL_FLDCNT);
  63.     if (cbp == NULL) {
  64.         if (errno == ENOENT) {
  65.             printf("The card file does not exist.  Creating.\n");
  66.             rs = cbcreate(ROLO, sizeof(rolo_t),
  67.                             rl_fields, RL_FLDCNT);
  68.             if (rs == -1) {
  69.                 fprintf(stderr, "*** Error creating rolo.  Error number %d.\n",  errno);
  70.                 bexit(EXIT_FAILURE);
  71.             }
  72.             cbp = cbopen(ROLO, "r+", rl_fields, RL_FLDCNT);
  73.             if (cbp == NULL) {
  74.                 printf("*** Error opening rolo.  Error number %d.\n", errno);
  75.                 bexit(EXIT_FAILURE);
  76.             }
  77.         } else {
  78.             printf("*** Error opening rolo.  Error number %d.\n", errno);
  79.             bexit(EXIT_FAILURE);
  80.         }
  81.     }
  82.  
  83.     printf("\n--------------------------\n");
  84.     printf("| Card File Demo Program |\n");
  85.     printf("--------------------------\n");
  86.  
  87.     /* main loop */
  88.     field = RL_CONTACT;
  89.     while (1) {
  90.         printf("\n\n");
  91.         printf("---------------------------\n");
  92.         printf("| I - Insert new card     |\n");
  93.         printf("| D - Delete current card |\n");
  94.         printf("| S - Search for card\n");
  95.         printf("| N - Next card\n");
  96.         printf("| P - Previous card\n");
  97.         printf("| F - First card\n");
  98.         printf("| L - Last card\n");
  99.         printf("| C - Change index field\n");
  100.         printf("| A - list All\n");
  101.         printf("| X - eXit                |\n");
  102.         printf("---------------------------\n");
  103.  
  104.         printf("Enter selection:  ");
  105.         c = getchar();
  106.         if (getchar() != '\n') {
  107.             while(getchar() != '\n') {
  108.             }
  109.             printf("\a");
  110.             continue;
  111.         }
  112.         c = toupper(c);
  113.         if (c == 'X') {
  114.             break;
  115.         }
  116.  
  117.         switch (c) {
  118.         case 'I':    /* Insert new card */
  119.             /* input new card */
  120.             memset((void *)&rl, 0, sizeof(rl));
  121.             printf("Contact:  ");
  122.             gets(buf);
  123.             strncpy(rl.rl_contact, buf, sizeof(rl.rl_contact));
  124.             rl.rl_contact[sizeof(rl.rl_contact) - 1] = '\0';
  125.             printf("Title:  ");
  126.             gets(buf);
  127.             strncpy(rl.rl_title, buf, sizeof(rl.rl_title));
  128.             rl.rl_title[sizeof(rl.rl_title) - 1] = '\0';
  129.             printf("Company:  ");
  130.             gets(buf);
  131.             strncpy(rl.rl_company, buf, sizeof(rl.rl_company));
  132.             rl.rl_company[sizeof(rl.rl_company) - 1] = '\0';
  133.             printf("Address (%d lines):  ",
  134.                  (int)(sizeof(rl.rl_addr)/sizeof(rl.rl_addr[0])));
  135.             for (i = 0; i < sizeof(rl.rl_addr)/sizeof(rl.rl_addr[0]); i++) {
  136.                 gets(buf);
  137.                 strncpy(rl.rl_addr[i], buf, sizeof(rl.rl_addr[0]));
  138.                 rl.rl_addr[i][sizeof(rl.rl_addr[0]) - 1] = '\0';
  139.             }
  140.             printf("Phone:  ");
  141.             gets(buf);
  142.             strncpy(rl.rl_phone, buf, sizeof(rl.rl_phone));
  143.             rl.rl_phone[sizeof(rl.rl_phone) - 1] = '\0';
  144.             printf("Fax:  ");
  145.             gets(buf);
  146.             strncpy(rl.rl_fax, buf, sizeof(rl.rl_fax));
  147.             rl.rl_fax[sizeof(rl.rl_fax) - 1] = '\0';
  148.             printf("Notes (%d lines):  ",
  149.                  (int)(sizeof(rl.rl_notes)/sizeof(rl.rl_notes[0])));
  150.             for (i = 0; i < sizeof(rl.rl_notes)/sizeof(rl.rl_notes[0]); i++) {
  151.                 gets(buf);
  152.                 strncpy(rl.rl_notes[i], buf, sizeof(rl.rl_notes[0]));
  153.                 rl.rl_notes[i][sizeof(rl.rl_notes[0]) - 1] = '\0';
  154.             }
  155.             /* insert new card in cbase */
  156.             rs = cblock(cbp, CB_WRLCK);
  157.             if (rs == -1) {
  158.                 if (errno == EAGAIN) {
  159.                     printf("cbase currently locked by another process.\n");
  160.                     break;
  161.                 }
  162.                 printf("*** Error write locking rolo.  Error number %d.\n", errno);
  163.                 bexit(EXIT_FAILURE);
  164.             }
  165.             rs = cbinsert(cbp, (void *)&rl);
  166.             if (rs == -1) {
  167.                 printf("*** Error inserting card.  Error number %d.\n", errno);
  168.                 bexit(EXIT_FAILURE);
  169.             }
  170.             rs = cblock(cbp, CB_UNLCK);
  171.             if (rs == -1) {
  172.                 printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  173.                 bexit(EXIT_FAILURE);
  174.             }
  175.             cardput(&rl);
  176.             break;    /* case 'I': */
  177.         case 'D':    /* Delete current card */
  178.             rs = cblock(cbp, CB_WRLCK);
  179.             if (rs == -1) {
  180.                 if (errno == EAGAIN) {
  181.                     printf("cbase currently locked by another process.\n");
  182.                     break;
  183.                 }
  184.                 printf("*** Error write locking rolo.  Error number %d.\n", errno);
  185.                 bexit(EXIT_FAILURE);
  186.             }
  187.             if (cbreccnt(cbp) == 0) {
  188.                 printf("\nThe card file is empty.\n");
  189.                 rs = cblock(cbp, CB_UNLCK);
  190.                 if (rs == -1) {
  191.                     printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  192.                     bexit(EXIT_FAILURE);
  193.                 }
  194.                 continue;
  195.             }
  196.             rs = cbkeysrch(cbp, RL_CONTACT, (void *)rl.rl_contact);
  197.             if (rs == -1) {
  198.                 printf("*** Error searching for key.  Error number %d.\n", errno);
  199.                 bexit(EXIT_FAILURE);
  200.             }
  201.             if (rs == 0) {
  202.                 printf("There is no current card.\n");
  203.             }
  204.             rs = cbdelcur(cbp, field);
  205.             if (rs == -1) {
  206.                 printf("*** Error deleting current card.  Error number %d.\n", errno);
  207.                 bexit(EXIT_FAILURE);
  208.             }
  209.             if (cbrcursor(cbp) == NULL) {
  210.                 memset((void *)&rl, 0, sizeof(rl));
  211.             } else {
  212.                 rs = cbgetr(cbp, (void *)&rl);
  213.                 if (rs == -1) {
  214.                     printf("*** Error reading card.  Error number %d.\n", errno);
  215.                     bexit(EXIT_FAILURE);
  216.                 }
  217.             }
  218.             rs = cblock(cbp, CB_UNLCK);
  219.             if (rs == -1) {
  220.                 printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  221.                 bexit(EXIT_FAILURE);
  222.             }
  223.             break;    /* case 'D': */
  224.         case 'S':    /* Search for card */
  225.             rs = cblock(cbp, CB_RDLCK);
  226.             if (rs == -1) {
  227.                 if (errno == EAGAIN) {
  228.                     printf("cbase currently write locked by another process.\n");
  229.                     break;
  230.                 }
  231.                 printf("*** Error read locking rolo.  Error number %d.\n", errno);
  232.                 bexit(EXIT_FAILURE);
  233.             }
  234.             if (field == RL_CONTACT) {
  235.                 printf("Enter contact name:  ");
  236.             } else {
  237.                 printf("Enter company name:  ");
  238.             }
  239.             if (fgets(buf, sizeof(buf), stdin) == NULL) {
  240.                 printf("*** Error reading input.\n");
  241.                 bexit(EXIT_FAILURE);
  242.             }
  243.             if (buf[strlen(buf) - 1] == '\n') {
  244.                 buf[strlen(buf) - 1] = '\0';
  245.             }
  246.             rs = cbkeysrch(cbp, field, (void *)buf);
  247.             if (rs == -1) {
  248.                 printf("*** Error searching for key.  Error number %d.\n", errno);
  249.                 bexit(EXIT_FAILURE);
  250.             }
  251.             if (rs == 0) {
  252.                 printf("\nNot found.\n");
  253.                 memset((void *)&rl, 0, sizeof(rl));
  254.                 rs = cblock(cbp, CB_UNLCK);
  255.                 if (rs == -1) {
  256.                     printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  257.                     bexit(EXIT_FAILURE);
  258.                 }
  259.                 continue;
  260.             }
  261.             rs = cbgetr(cbp, (void *)&rl);
  262.             if (rs == -1) {
  263.                 printf("*** Error reading card.  Error number %d.\n", errno);
  264.                 bexit(EXIT_FAILURE);
  265.             }
  266.             rs = cblock(cbp, CB_UNLCK);
  267.             if (rs == -1) {
  268.                 printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  269.                 bexit(EXIT_FAILURE);
  270.             }
  271.             cardput(&rl);
  272.             break;    /* case 'S': */
  273.         case 'N':    /* Next card */
  274.             rs = cblock(cbp, CB_RDLCK);
  275.             if (rs == -1) {
  276.                 if (errno == EAGAIN) {
  277.                     printf("cbase currently write locked by another process.\n");
  278.                     break;
  279.                 }
  280.                 printf("*** Error read locking rolo.  Error number %d.\n", errno);
  281.                 bexit(EXIT_FAILURE);
  282.             }
  283.             if (cbreccnt(cbp) == 0) {
  284.                 printf("\nThe card file is empty.\n");
  285.                 rs = cblock(cbp, CB_UNLCK);
  286.                 if (rs == -1) {
  287.                     printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  288.                     bexit(EXIT_FAILURE);
  289.                 }
  290.                 continue;
  291.             }
  292.             /* set record cursor */
  293.             rs = cbkeysrch(cbp, RL_CONTACT, (void *)rl.rl_contact);
  294.             if (rs == -1) {
  295.                 printf("*** Error searching for key.  Error number %d.\n", errno);
  296.                 bexit(EXIT_FAILURE);
  297.             }
  298.             if (rs == 0) {
  299.                 rs = cbsetrcur(cbp, NULL);
  300.                 if (rs == -1) {
  301.                     printf("*** Error setting record cursor.  Error number %d.\n", errno);
  302.                     bexit(EXIT_FAILURE);
  303.                 }
  304.             }
  305.             rs = cbkeyalign(cbp, field);
  306.             if (rs == -1) {
  307.                 printf("*** Error aligning key.  Error number %d.\n", errno);
  308.                 bexit(EXIT_FAILURE);
  309.             }
  310.             rs = cbkeynext(cbp, field);
  311.             if (rs == -1) {
  312.                 printf("*** Error finding next card.  Error number %d.\n", errno);
  313.                 bexit(EXIT_FAILURE);
  314.             }
  315.             if (cbrcursor(cbp) == NULL) {
  316.                 rs = cbkeynext(cbp, field);
  317.                 if (rs == -1) {
  318.                     printf("*** Error finding next card.  Error number %d.\n", errno);
  319.                     bexit(EXIT_FAILURE);
  320.                 }
  321.             }
  322.             rs = cbgetr(cbp, (void *)&rl);
  323.             if (rs == -1) {
  324.                 printf("*** Error reading card.  Error number %d.\n", errno);
  325.                 bexit(EXIT_FAILURE);
  326.             }
  327.             rs = cblock(cbp, CB_UNLCK);
  328.             if (rs == -1) {
  329.                 printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  330.                 bexit(EXIT_FAILURE);
  331.             }
  332.             cardput(&rl);
  333.             break;    /* case 'N': */
  334.         case 'P':    /* Previous card */
  335.             rs = cblock(cbp, CB_RDLCK);
  336.             if (rs == -1) {
  337.                 if (errno == EAGAIN) {
  338.                     printf("cbase currently write locked by another process.\n");
  339.                     break;
  340.                 }
  341.                 printf("*** Error read locking rolo.  Error number %d.\n", errno);
  342.                 bexit(EXIT_FAILURE);
  343.             }
  344.             if (cbreccnt(cbp) == 0) {
  345.                 printf("\nThe card file is empty.\n");
  346.                 rs = cblock(cbp, CB_UNLCK);
  347.                 if (rs == -1) {
  348.                     printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  349.                     bexit(EXIT_FAILURE);
  350.                 }
  351.                 continue;
  352.             }
  353.             /* set record cursor */
  354.             rs = cbkeysrch(cbp, RL_CONTACT, (void *)rl.rl_contact);
  355.             if (rs == -1) {
  356.                 printf("*** Error searching for key.  Error number %d.\n", errno);
  357.                 bexit(EXIT_FAILURE);
  358.             }
  359.             if (rs == 0) {
  360.                 rs = cbsetrcur(cbp, NULL);
  361.                 if (rs == -1) {
  362.                     printf("*** Error setting record cursor.  Error number %d.\n", errno);
  363.                     bexit(EXIT_FAILURE);
  364.                 }
  365.             }
  366.             rs = cbkeyalign(cbp, field);
  367.             if (rs == -1) {
  368.                 printf("*** Error aligning key.  Error number %d.\n", errno);
  369.                 bexit(EXIT_FAILURE);
  370.             }
  371.             rs = cbkeyprev(cbp, field);
  372.             if (rs == -1) {
  373.                 printf("*** Error finding previous card.  Error number %d.\n", errno);
  374.                 bexit(EXIT_FAILURE);
  375.             }
  376.             if (cbrcursor(cbp) == NULL) {
  377.                 rs = cbkeyprev(cbp, field);
  378.                 if (rs == -1) {
  379.                     printf("*** Error finding previous card.  Error number %d.\n", errno);
  380.                     bexit(EXIT_FAILURE);
  381.                 }
  382.             }
  383.             rs = cbgetr(cbp, (void *)&rl);
  384.             if (rs == -1) {
  385.                 printf("*** Error reading card.  Error number %d.\n", errno);
  386.                 bexit(EXIT_FAILURE);
  387.             }
  388.             rs = cblock(cbp, CB_UNLCK);
  389.             if (rs == -1) {
  390.                 printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  391.                 bexit(EXIT_FAILURE);
  392.             }
  393.             cardput(&rl);
  394.             break;    /* case 'P': */
  395.         case 'F':    /* First card */
  396.             rs = cblock(cbp, CB_RDLCK);
  397.             if (rs == -1) {
  398.                 if (errno == EAGAIN) {
  399.                     printf("cbase currently write locked by another process.\n");
  400.                     break;
  401.                 }
  402.                 printf("*** Error read locking rolo.  Error number %d.\n", errno);
  403.                 bexit(EXIT_FAILURE);
  404.             }
  405.             if (cbreccnt(cbp) == 0) {
  406.                 printf("\nThe card file is empty.\n");
  407.                 rs = cblock(cbp, CB_UNLCK);
  408.                 if (rs == -1) {
  409.                     printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  410.                     bexit(EXIT_FAILURE);
  411.                 }
  412.                 continue;
  413.             }
  414.             rs = cbkeyfirst(cbp, field);
  415.             if (rs == -1) {
  416.                 printf("*** Error finding first card.  Error number %d.\n", errno);
  417.                 bexit(EXIT_FAILURE);
  418.             }
  419.             rs = cbgetr(cbp, (void *)&rl);
  420.             if (rs == -1) {
  421.                 printf("*** Error reading card.  Error number %d.\n", errno);
  422.                 bexit(EXIT_FAILURE);
  423.             }
  424.             rs = cblock(cbp, CB_UNLCK);
  425.             if (rs == -1) {
  426.                 printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  427.                 bexit(EXIT_FAILURE);
  428.             }
  429.             cardput(&rl);
  430.             break;    /* case 'F': */
  431.         case 'L':    /* Last card */
  432.             rs = cblock(cbp, CB_RDLCK);
  433.             if (rs == -1) {
  434.                 if (errno == EAGAIN) {
  435.                     printf("cbase currently write locked by another process.\n");
  436.                     break;
  437.                 }
  438.                 printf("*** Error read locking rolo.  Error number %d.\n", errno);
  439.                 bexit(EXIT_FAILURE);
  440.             }
  441.             if (cbreccnt(cbp) == 0) {
  442.                 printf("\nThe card file is empty.\n");
  443.                 rs = cblock(cbp, CB_UNLCK);
  444.                 if (rs == -1) {
  445.                     printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  446.                     bexit(EXIT_FAILURE);
  447.                 }
  448.                 continue;
  449.             }
  450.             rs = cbkeylast(cbp, field);
  451.             if (rs == -1) {
  452.                 printf("*** Error finding last card.  Error number %d.\n", errno);
  453.                 bexit(EXIT_FAILURE);
  454.             }
  455.             rs = cbgetr(cbp, (void *)&rl);
  456.             if (rs == -1) {
  457.                 printf("*** Error reading card.  Error number %d.\n", errno);
  458.                 bexit(EXIT_FAILURE);
  459.             }
  460.             rs = cblock(cbp, CB_UNLCK);
  461.             if (rs == -1) {
  462.                 printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  463.                 bexit(EXIT_FAILURE);
  464.             }
  465.             cardput(&rl);
  466.             break;    /* case 'L': */
  467.         case 'C':    /* change index field */
  468.             printf("\n1. Contact name.\n");
  469.             printf("2. Company name.\n");
  470.             printf("Select new index field:  ");
  471.             c = getchar();
  472.             if (getchar() != '\n') {
  473.                 printf("\a");
  474.                 continue;
  475.             }
  476.             switch (c) {
  477.             case '1':
  478.                 field = RL_CONTACT;
  479.                 break;    /* case '1': */
  480.             case '2':
  481.                 field = RL_COMPANY;
  482.                 break;    /* case '2': */
  483.             default:
  484.                 printf("\a");
  485.                 continue;
  486.                 break;    /* default: */
  487.             }
  488.             break;    /* case 'C': */
  489.         case 'A':    /* list All */
  490.             rs = cblock(cbp, CB_RDLCK);
  491.             if (rs == -1) {
  492.                 if (errno == EAGAIN) {
  493.                     printf("cbase currently write locked by another process.\n");
  494.                     break;
  495.                 }
  496.                 printf("*** Error read locking rolo.  Error number %d.\n", errno);
  497.                 bexit(EXIT_FAILURE);
  498.             }
  499.             if (cbreccnt(cbp) == 0) {
  500.                 printf("\nThe card file is empty.\n");
  501.                 rs = cblock(cbp, CB_UNLCK);
  502.                 if (rs == -1) {
  503.                     printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  504.                     bexit(EXIT_FAILURE);
  505.                 }
  506.                 continue;
  507.             }
  508.             rs = cbsetkcur(cbp, field, NULL);
  509.             if (rs == -1) {
  510.                 printf("*** Error setting key cursor.  Error number %d.\n", errno);
  511.                 bexit(EXIT_FAILURE);
  512.             }
  513.             while (1) {
  514.                 rs = cbkeynext(cbp, field);
  515.                 if (rs == -1) {
  516.                     printf("*** Error finding next card.  Error number %d.\n", errno);
  517.                     bexit(EXIT_FAILURE);
  518.                 }
  519.                 if (cbkcursor(cbp, field) == NULL) {
  520.                     break;
  521.                 }
  522.                 rs = cbgetr(cbp, (void *)&rl);
  523.                 if (rs == -1) {
  524.                     printf("*** Error reading card.  Error number %d.\n", errno);
  525.                     bexit(EXIT_FAILURE);
  526.                 }
  527.                 cardput(&rl);
  528.             }
  529.             rs = cblock(cbp, CB_UNLCK);
  530.             if (rs == -1) {
  531.                 printf("*** Error unlocking rolo.  Error number %d.\n", errno);
  532.                 bexit(EXIT_FAILURE);
  533.             }
  534.             break;    /* case 'A': */
  535.         default:
  536.             printf("\a");
  537.             continue;
  538.             break;    /* default: */
  539.         }
  540.     }
  541.  
  542.     /* close cbase */
  543.     rs = cbclose(cbp);
  544.     if (rs == -1) {
  545.         printf("*** Error closing rolo.  Error number %d.\n", errno);
  546.         bexit(EXIT_FAILURE);
  547.     }
  548.  
  549.     bexit(EXIT_SUCCESS);
  550. }
  551.  
  552. static void cardput(rlp)
  553. rolo_t *rlp;
  554. {
  555.     int    i    = 0;
  556.     rolo_t    rl    /*= {0}*/;
  557.  
  558.     printf("\n-----------------------CARD-----------------------\n");
  559.     printf("| Contact:  %s\n", rlp->rl_contact);
  560.     printf("| Title:    %s\n", rlp->rl_title);
  561.     printf("| Company:  %s\n", rlp->rl_company);
  562.     printf("| Address:  %s\n", rlp->rl_addr[0]);
  563.     for (i = 1; i < sizeof(rl.rl_addr)/sizeof(rl.rl_addr[0]); i++) {
  564.         printf("|           %s\n", rlp->rl_addr[i]);
  565.     }
  566.     printf("| Phone:    %s\n", rlp->rl_phone);
  567.     printf("| Fax:      %s\n", rlp->rl_fax);
  568.     printf("| Notes:    %s\n", rlp->rl_notes[0]);
  569.     for (i = 1; i < sizeof(rl.rl_notes)/sizeof(rl.rl_notes[0]); i++) {
  570.         printf("|           %s\n", rlp->rl_notes[i]);
  571.     }
  572.     printf("--------------------------------------------------\n");
  573.  
  574.     return;
  575. }
  576.