home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / AZTEC-C / MINDER.ARK / MIND1.C < prev    next >
C/C++ Source or Header  |  1986-06-19  |  15KB  |  833 lines

  1. /* mind1
  2.  
  3.     module of reminder service
  4.  
  5.     1985 Mark E. Mallett
  6. */
  7.  
  8. #include "minder.h"
  9. #include "comnd.h"
  10. #include "setjmp.h"
  11.  
  12.  
  13.  
  14. /* Local definitions */
  15.  
  16.  
  17.  
  18.  
  19. /* External routines */
  20.  
  21.  
  22. /* External data */
  23.  
  24. extern    CFB    Inicfb;            /* CFB for initialization */
  25. extern    char    Tmpabf[];        /* Temp atom buffer */
  26. extern    CSB    Tmpcsb;            /* Temp command state block */
  27. extern    jmp_buf    Tmpenv;            /* setjmp environment buffer */
  28.  
  29.  
  30. /* Local routines */
  31.  
  32. extern    int    sdsdel();        /* disposition: delete */
  33. extern    int    sdskep();        /* disposition: keep */
  34. extern    int    sdsrsc();        /* disposition: reschedule */
  35.  
  36. extern    int    setack();        /* Set ACK parameter */
  37. extern    int    setadv();        /* Set ADVANCE-NOTICE value */
  38. extern    int    setat();        /* Set AT parameter */
  39. extern    int    setdis();        /* Set DISPOSITION */
  40. extern    int    setdon();        /* Done with definitions */
  41. extern    int    setfor();        /* Set FOR */
  42. extern    int    sethlp();        /* Set HELP command */
  43. extern    int    setmsg();        /* Set the event message */
  44. extern    int    setnam();        /* Set the event name */
  45. extern    int    setshw();        /* Show current settings */
  46. extern    int    shlcms();        /* Routine for help:command */
  47. extern    int    shlful();        /* Routine for help:full */
  48.  
  49.  
  50. /* Local data */
  51.  
  52.     /* Attribute command keyword and dispatch tables */
  53.  
  54.  
  55. BYTE        *Setktb[] =    {    /* Command keywords.. */
  56.             "ACKNOWLEDGE",    /* Toggle ack required */
  57.             "ADVANCE-NOTICE", /* Specify advance notice */
  58.             "AT",        /* Specify the event time */
  59.             "DISPOSITION",    /* Set message disposition */
  60.             "DONE",        /* Done. */
  61.             "FOR",        /* For who? */
  62.             "HELP",        /* Give help */
  63.             "MESSAGE",    /* Set a message */
  64.             "NAME",        /* Name the event */
  65.             "SHOW",        /* Show current settings */
  66.             NULL        /* Ends with a null pointer */
  67.                 };
  68.  
  69. int        (*Setdsp[])() = {
  70.             setack,        /* ACKNOWLEDGE */
  71.             setadv,        /* ADVANCE-NOTICE */
  72.             setat,        /* AT */
  73.             setdis,        /* DISPOSITION */
  74.             setdon,        /* DONE */
  75.             setfor,        /* FOR */
  76.             sethlp,        /* HELP */
  77.             setmsg,        /* MESSAGE */
  78.             setnam,        /* NAME */
  79.             setshw,        /* SHOW */
  80.             0        /* Ends with a zero for convenience */
  81.                 };
  82.  
  83.  
  84.     /* HELP keyword and dispatch tables */
  85.  
  86. BYTE         *Shltbl[] = {
  87.             "COMMAND",
  88.             "FULL",
  89.             NULL
  90.                  };
  91.  
  92. int        (*Shldsp[])() = {
  93.             shlcms,
  94.             shlful,
  95.             0
  96.                     };
  97.  
  98.  
  99.  
  100.     /* Keywords and dispatch for DISPOSITIONs */
  101.  
  102. BYTE        *Sdsktb[] =     {
  103.             "DELETE",    /* Delete the event */
  104.             "KEEP",        /* Keep it. */
  105.             "RESCHEDULE",    /* Reschedule it */
  106.             NULL        /* Ends with NULL */
  107.                 };
  108.  
  109. int        (*Sdsdsp[])() = {
  110.             sdsdel,        /* DELETE */
  111.             sdskep,        /* KEEP */
  112.             sdsrsc,        /* RESCHEDULE */
  113.             0        /* Ends with zero */
  114.                 };
  115.  
  116.  
  117.     /* Keywords for reschedule classes */
  118.  
  119. BYTE        *Schktb[] =     {
  120.             "Days",
  121.             "Weeks",
  122.             "Months",
  123.             "Years",
  124.             NULL
  125.                 };
  126.  
  127.  
  128.     /* Same thing, only for printing */
  129.  
  130. BYTE        *Rsuktb[] =    {
  131.             "Day",
  132.             "Week",
  133.             "Month",
  134.             "Year"
  135.                 };
  136.  
  137.  
  138.  
  139.  
  140.     /* COMND blocks */
  141.  
  142. static    CFB    Dancfb = {_CMNUM, _CFHPP|_CFSDH, 0, 10,
  143.               "Number of days of advance notice", 0};
  144. static    CFB    Deccfb = {_CMNUM, 0, 0, 10, 0, 0};
  145. CFB        Dtmcfb = {_CMDAT, _CFDTD|_CFDTT, 0, 0, 0, 0};
  146. CFB        Schcfb = {_CMKEY, _CFHPP, 0, &Schktb,
  147.                "Unit, ", 0};
  148. CFB        Sdkcfb = {_CMKEY, _CFHPP|_CFDPP, 0, &Sdsktb,
  149.                "Disposition, ", "DELETE"};
  150. CFB        Stkcfb = {_CMKEY, _CFHPP|_CFDPP, 0, &Setktb,
  151.                "Command, ", "DONE"};
  152. static    CFB    Shlcfb = {_CMKEY, _CFDPP, &Stkcfb, &Shltbl, 0, "FULL"};
  153.  
  154.  
  155. /* Other things */
  156.  
  157. static    int    Sdnflg = {FALSE};    /* Set done flag */
  158. /*
  159.  
  160. *//* evshw (EVTptr)
  161.  
  162.     Show event elements
  163.  
  164.  
  165. Accepts :
  166.  
  167.     EVTptr        Address of event block
  168.  
  169.  
  170. Returns :
  171.  
  172.  
  173. */
  174.  
  175. evshw (EVTptr)
  176.  
  177. EVT        *EVTptr;        /* Addr of event block */
  178.  
  179. {
  180. IND    int    m,d,y,hh,mm;        /* Date/time components */
  181.  
  182. cvided (EVTptr -> EVT_DTD, EVTptr -> EVT_DTM, &m, &d, &y, &hh, &mm);
  183.  
  184. printf ("Event \"%s\"           active at %02d/%02d/%04d %02d:%02d\n\n",
  185.      EVTptr -> EVT_NAM, m, d, y, hh, mm);
  186. printf ("      >>%s<<\n\n", EVTptr -> EVT_MSG);
  187.  
  188. if (EVTptr -> EVT_FRM != NULL)
  189.     printf ("From: %s\n", EVTptr -> EVT_FRM);
  190. if (EVTptr -> EVT_FOR != NULL)
  191.     printf ("For: %s\n", EVTptr -> EVT_FOR);
  192. if (EVTptr -> EVT_FLG & _EFACK)
  193.     printf ("Acknowledgement required\n");
  194. else
  195.     printf ("Automatic ");
  196.  
  197. printf ("Disposition: ");
  198. switch (EVTptr -> EVT_DIS)
  199.     {
  200.     case _EDDEL:
  201.     printf ("delete\n");
  202.     break;
  203.  
  204.     case _EDKEEP:
  205.     printf ("keep\n");
  206.     break;
  207.  
  208.     case _EDSCH:
  209.     printf ("reschedule in %d %s", EVTptr -> EVT_RSV,
  210.         Rsuktb[EVTptr -> EVT_RSU]);
  211.     if (EVTptr -> EVT_RSV != 1)
  212.         putchar('s');
  213.     printf ("\n");
  214.     break;
  215.  
  216.     default:
  217.     printf ("unknown\n");
  218.     }
  219.  
  220. if (EVTptr -> EVT_ADV)
  221.     {
  222.     printf ("%d day", EVTptr -> EVT_ADV);
  223.     if (EVTptr -> EVT_ADV != 1)
  224.     putchar ('s');
  225.     printf (" advance notice\n");
  226.     }
  227.  
  228. printf ("\n");
  229. }
  230. /*
  231.  
  232. *//* evdef (EVTptr)
  233.  
  234.         Define parameters of an event.
  235.  
  236. Accepts :
  237.  
  238.         EVTptr        Address of the event block
  239.  
  240. Returns :
  241.  
  242.  
  243. */
  244.  
  245. evdef (EVTptr)
  246.  
  247. EVT        *EVTptr;        /* Address of event block */
  248.  
  249. {
  250. IND    int        i;        /* Scratch */
  251. IND    BYTE        **kptr;        /* Points to kwd table entry */
  252.  
  253. printf ("Specify event parameters.  Type DONE to end.\n\n");
  254. Tmpcsb.CSB_PMT = "MIND-DEF> ";        /* Set prompt */
  255.  
  256. /* Enter command loop */
  257.  
  258. while (TRUE)                /* Forever */
  259.     {
  260.     if (COMND (&Tmpcsb, &Inicfb) != _CROK) /* eh? */
  261.     {
  262.     printf ("Fatal error initializing COMND\n");
  263.     exit();
  264.     }
  265.  
  266.     setjmp (Tmpenv);            /* Mark here for reparse */
  267.  
  268.     if (COMNDi (&Tmpcsb, &Stkcfb) != _CROK)    /* Collect keyword */
  269.     continue;
  270.  
  271.     kptr = (char **) (Tmpcsb.CSB_RVL._ADR);
  272.     i = kptr - (&Setktb[0]);        /* Get keyword index */
  273.     Sdnflg = FALSE;            /* Set not done. */
  274.     (*Setdsp[i])(EVTptr);        /* Process command */
  275.     if (Sdnflg)                /* If done flag was set */
  276.     break;                /*   exit command loop */
  277.     }
  278. }
  279. /*
  280.  
  281. *//* setack (EVTptr)
  282.  
  283.     Processes the ACKNOWLEDGE set-command.
  284.  
  285.  
  286. Accepts :
  287.  
  288.     EVTptr        Address of event block
  289.  
  290.  
  291. Returns :
  292.  
  293.  
  294. */
  295.  
  296. setack (EVTptr)
  297.  
  298. EVT        *EVTptr;        /* Addr of EVT block */
  299.  
  300. {
  301. if (!noise (&Tmpcsb, "flag toggled"))    /* Give guide words */
  302.     return;
  303.  
  304. if (!confrm (&Tmpcsb))            /* Confirm the command */
  305.     return;
  306.  
  307. if (EVTptr -> EVT_FLG & _EFACK)    /* ack required? */
  308.     {
  309.     printf ("Acknowledgement not required\n");
  310.     EVTptr -> EVT_FLG &= ~_EFACK;
  311.     }
  312. else
  313.     {
  314.     printf ("Acknowledgement now required\n");
  315.     EVTptr -> EVT_FLG |= _EFACK;
  316.     }
  317.  
  318. }
  319. /*
  320.  
  321. *//* setadv (EVTptr)
  322.  
  323.     Processes the ADVANCE-NOTICE set-command.
  324.  
  325.  
  326. Accepts :
  327.  
  328.     EVTptr        Address of event block
  329.  
  330.  
  331. Returns :
  332.  
  333.  
  334. */
  335.  
  336. setadv (EVTptr)
  337.  
  338. EVT        *EVTptr;        /* Addr of EVT block */
  339.  
  340. {
  341. if (!noise (&Tmpcsb, "in"))        /* Give guide words */
  342.     return;
  343.  
  344. if (COMNDi (&Tmpcsb, &Dancfb) != _CROK)    /* Get # days */
  345.     return;
  346.  
  347. if (!confrm (&Tmpcsb))            /* Confirm the command */
  348.     return;
  349.  
  350. EVTptr -> EVT_ADV = Tmpcsb.CSB_RVL._INT;    /* Save # of days */
  351.  
  352. }
  353. /*
  354.  
  355. *//* setat (EVTptr)
  356.  
  357.     Processes the AT set-command.
  358.  
  359.  
  360. Accepts :
  361.  
  362.     EVTptr        Address of event block
  363.  
  364.  
  365. Returns :
  366.  
  367.  
  368. */
  369.  
  370. setat (EVTptr)
  371.  
  372. EVT        *EVTptr;        /* Addr of EVT block */
  373.  
  374. {
  375. IND    int    *rslptr;        /* Result pointer */
  376. IND    int    id, it;            /* Internal date and time */
  377.  
  378. rslptr = &Tmpabf[0];            /* Where the result is stored */
  379. if (!noise (&Tmpcsb, "date/time"))    /* Give guide words */
  380.     return;
  381.  
  382. if (COMNDi (&Tmpcsb, &Dtmcfb) != _CROK)    /* Get date/time */
  383.     return;
  384.  
  385. id = rslptr[0];                /* Pick up date and time */
  386. it = rslptr[1];
  387. if (!confrm (&Tmpcsb))            /* Confirm the command */
  388.     return;
  389.  
  390. EVTptr -> EVT_DTD = id;            /* Store date */
  391. EVTptr -> EVT_DTM = 0;            /* Store time */
  392.  
  393. }
  394. /*
  395.  
  396. *//* setdis (EVTptr)
  397.  
  398.     Processes the DISPOSITION set-command.
  399.  
  400.  
  401. Accepts :
  402.  
  403.     EVTptr        Address of event block
  404.  
  405.  
  406. Returns :
  407.  
  408.  
  409. */
  410.  
  411. setdis (EVTptr)
  412.  
  413. EVT        *EVTptr;        /* Addr of EVT block */
  414.  
  415. {
  416. IND    char    **kptr;            /* Keyword ptr ptr */
  417. IND    int    i;            /* Index */
  418.  
  419. if (!noise (&Tmpcsb, "is"))        /* Give guide words */
  420.     return;
  421.  
  422. if (COMNDi (&Tmpcsb, &Sdkcfb) != _CROK)    /* Get disposition keyword */
  423.     return;
  424.  
  425. kptr = (char **) (Tmpcsb.CSB_RVL._ADR);
  426. i = kptr - (&Sdsktb[0]);        /* Get keyword index */
  427. (*Sdsdsp[i])(EVTptr);            /* Process command */
  428.  
  429. }
  430. /*
  431.  
  432. *//* setdon (EVTptr)
  433.  
  434.     Processes the DONE set-command.
  435.  
  436.  
  437. Accepts :
  438.  
  439.     EVTptr        Address of event block
  440.  
  441.  
  442. Returns :
  443.  
  444.  
  445. */
  446.  
  447. setdon (EVTptr)
  448.  
  449. EVT        *EVTptr;        /* Addr of EVT block */
  450.  
  451. {
  452. IND    int    cplflg;            /* TRUE if complete def */
  453.  
  454. if (!noise (&Tmpcsb, "with definitions")) /* Give guide words */
  455.     return;
  456.  
  457. if (!confrm (&Tmpcsb))            /* Confirm the command */
  458.     return;
  459.  
  460. /* Check out the event, make sure all fields are filled */
  461.  
  462. cplflg = TRUE;                /* Presume complete def */
  463.  
  464. if (EVTptr -> EVT_MSG == NULL)
  465.     notdon (&cplflg, "message");
  466. if (EVTptr -> EVT_FOR == NULL)
  467.     notdon (&cplflg, "recipient (FOR)");
  468. if (EVTptr -> EVT_DTD == 0)
  469.     notdon (&cplflg, "time (AT)");
  470.  
  471. if (cplflg)
  472.     Sdnflg = TRUE;
  473. printf ("\n");
  474. }
  475.  
  476.  
  477. /* notdon - subservient to "setdon" routine */
  478.  
  479. notdon (flg, msg)
  480.  
  481. int        *flg;
  482. char        *msg;
  483.  
  484. {
  485. if (*flg)
  486.     printf ("\n  ** Event is incomplete **\n\nMust supply: ");
  487. else
  488.     printf (", ");
  489.  
  490. printf ("%s", msg);
  491. *flg = FALSE;
  492. }
  493. /*
  494.  
  495. *//* setfor (EVTptr)
  496.  
  497.     Processes the FOR set-command.
  498.  
  499.  
  500. Accepts :
  501.  
  502.     EVTptr        Address of event block
  503.  
  504.  
  505. Returns :
  506.  
  507.  
  508. */
  509.  
  510. setfor (EVTptr)
  511.  
  512. EVT        *EVTptr;        /* Addr of EVT block */
  513.  
  514. {
  515.     char    whoto[50];        /* For name buffer */
  516.  
  517. if (!noise (&Tmpcsb, "recipient"))    /* Give guide words */
  518.     return;
  519.  
  520. if (!getuqs(&Tmpcsb, "user name", whoto))
  521.     return;
  522.  
  523. if (!confrm (&Tmpcsb))            /* Confirm the command */
  524.     return;
  525.  
  526. if (EVTptr -> EVT_FOR != NULL)        /* If any old name */
  527.     free (EVTptr -> EVT_FOR);        /* Free old name storage */
  528. EVTptr -> EVT_FOR = newstr(whoto);    /* Remember new name */
  529. }
  530. /*
  531.  
  532. *//* sethlp()
  533.  
  534.     the HELP command
  535.  
  536.     (taken from lbbhlp.c)
  537.  
  538.  
  539. */
  540.  
  541. sethlp()
  542.  
  543. {
  544. int        i;            /* Command index */
  545. char        **kptr;            /* Keyword ptr ptr */
  546.  
  547. if (!noise (&Tmpcsb, "on subject"))    /* Give guidance */
  548.     return;
  549. if (COMNDi (&Tmpcsb, &Shlcfb) != _CROK)    /* Get keyword */
  550.     return;
  551.  
  552. kptr = (char **) Tmpcsb.CSB_RVL._ADR;    /* Get returned pointer */
  553. if (Tmpcsb.CSB_CFB == &Stkcfb)        /* If matched command keyword */
  554.     {
  555.     i = kptr - &Setktb[0];        /* Get index */
  556.     return (shlcms(i));            /* Process the thing */
  557.     }
  558. i = kptr - &Shltbl[0];            /* Get index */
  559.  
  560. (*Shldsp[i])(-1);            /* Process it */
  561.  
  562. }
  563. /*
  564. *//* shlcms
  565.  
  566.     HELP COMMAND
  567.  
  568. */
  569.  
  570. shlcms(inx)
  571.  
  572. int        inx;
  573.  
  574. {
  575. IND    int    i;            /* Scratch */
  576. IND    char    **kptr;            /* Ptr to kwd ptr */
  577.     char    kbuf[50];        /* Keyword buffer */
  578.  
  579. if ((i = inx) == -1)            /* If not command keyword */
  580.     {
  581.     if (!noise (&Tmpcsb, "named"))    /* Guide again */
  582.         return;
  583.  
  584.     if (COMNDi (&Tmpcsb, &Stkcfb) != _CROK)    /* Collect keyword */
  585.     return;
  586.  
  587.     kptr = (char **) (Tmpcsb.CSB_RVL._ADR);
  588.     i = kptr - (&Setktb[0]);        /* Get keyword index */
  589.     }
  590.  
  591. if (!confrm(&Tmpcsb))            /* Get confirmation */
  592.     return;
  593.  
  594. strcpy (kbuf, "DEF-");            /* Prefix for definition helpname */
  595. strcat (kbuf, Setktb[i]);        /* Add command name */
  596. givhlp (kbuf);                /* Give help for it. */
  597.  
  598. }
  599. /*
  600. *//* shlful
  601.  
  602.     HELP FULL
  603.  
  604. */
  605.  
  606. shlful()
  607.  
  608. {
  609. if (!confrm(&Tmpcsb))            /* Get confirmation */
  610.     return;
  611.  
  612. givhlp ("DEF-*FULL*");            /* Give the full help */
  613. }
  614. /*
  615.  
  616. *//* setmsg (EVTptr)
  617.  
  618.     Processes the MESSAGE set-command.
  619.  
  620.  
  621. Accepts :
  622.  
  623.     EVTptr        Address of event block
  624.  
  625.  
  626. Returns :
  627.  
  628.  
  629. */
  630.  
  631. setmsg (EVTptr)
  632.  
  633. EVT        *EVTptr;        /* Addr of EVT block */
  634.  
  635. {
  636.     char    evmsg[100];        /* Event message buffer */
  637.  
  638. if (!noise (&Tmpcsb, "text is"))    /* Give guide words */
  639.     return;
  640.  
  641. if (!getrol (&Tmpcsb, "message text", evmsg))
  642.     return;
  643.  
  644. if (!confrm (&Tmpcsb))            /* Confirm the command */
  645.     return;
  646.  
  647. if (EVTptr -> EVT_MSG != NULL)        /* If any old message */
  648.     free (EVTptr -> EVT_MSG);        /*  get rid of it */
  649. EVTptr -> EVT_MSG = newstr(evmsg);    /* Save new message */
  650. }
  651. /*
  652.  
  653. *//* setnam (EVTptr)
  654.  
  655.     Processes the NAME set-command.
  656.  
  657.  
  658. Accepts :
  659.  
  660.     EVTptr        Address of event block
  661.  
  662.  
  663. Returns :
  664.  
  665.  
  666. */
  667.  
  668. setnam (EVTptr)
  669.  
  670. EVT        *EVTptr;        /* Addr of EVT block */
  671.  
  672. {
  673. IND    EVT    *EVTcptr;        /* EVT check-pointer */
  674.     char    evname[50];        /* Event name buffer */
  675.  
  676. if (!noise (&Tmpcsb, "new name"))    /* Give guide words */
  677.     return;
  678.  
  679. if (!getuqs(&Tmpcsb, "event name", evname))
  680.     return;
  681.  
  682. if (!confrm (&Tmpcsb))            /* Confirm the command */
  683.     return;
  684.  
  685. EVTcptr = findev(evname);        /* See if name exists */
  686. if (EVTcptr != NULL)            /* If so */
  687.     if (EVTcptr != EVTptr)        /* If different one */
  688.     {
  689.     printf ("Event %s already exists; name remains %s\n",
  690.          evname, EVTptr -> EVT_NAM);
  691.     return;
  692.     }
  693. if (EVTptr -> EVT_NAM != NULL)        /* If any old name */
  694.     free (EVTptr -> EVT_NAM);        /* Free old name storage */
  695. EVTptr -> EVT_NAM = newstr(evname);    /* Remember new name */
  696. }
  697. /*
  698.  
  699. *//* setshw (EVTptr)
  700.  
  701.     Processes the SHOW command.
  702.  
  703.  
  704. Accepts :
  705.  
  706.     EVTptr        Address of event block
  707.  
  708. Returns :
  709.  
  710.  
  711. */
  712.  
  713. setshw (EVTptr)
  714.  
  715. EVT        *EVTptr;        /* Address of event block */
  716.  
  717. {
  718. if (!noise (&Tmpcsb, "event definitions"))    /* Give guide words */
  719.     return;
  720.  
  721. if (!confrm (&Tmpcsb))            /* Confirm the command */
  722.     return;
  723.  
  724. evshw (EVTptr);                /* Show it */
  725. }
  726. /*
  727.  
  728. *//* sdsdel (EVTptr)
  729.  
  730.     Processes the DELETE disposition
  731.  
  732.  
  733. Accepts :
  734.  
  735.     EVTptr        Address of event block
  736.  
  737.  
  738. Returns :
  739.  
  740.  
  741. */
  742.  
  743. sdsdel (EVTptr)
  744.  
  745. EVT        *EVTptr;        /* Addr of EVT block */
  746.  
  747. {
  748. if (!confrm (&Tmpcsb))            /* Confirm the command */
  749.     return;
  750.  
  751. EVTptr -> EVT_DIS = _EDDEL;        /* Set disposition type */
  752. }
  753. /*
  754.  
  755. *//* sdskep (EVTptr)
  756.  
  757.     Processes the KEEP disposition
  758.  
  759.  
  760. Accepts :
  761.  
  762.     EVTptr        Address of event block
  763.  
  764.  
  765. Returns :
  766.  
  767.  
  768. */
  769.  
  770. sdskep (EVTptr)
  771.  
  772. EVT        *EVTptr;        /* Addr of EVT block */
  773.  
  774. {
  775. if (!confrm (&Tmpcsb))            /* Confirm the command */
  776.     return;
  777.  
  778. EVTptr -> EVT_DIS = _EDKEEP;        /* Set disposition type */
  779. }
  780. /*
  781.  
  782. *//* sdsrsc (EVTptr)
  783.  
  784.     Processes the RESCHEDULE disposition
  785.  
  786.  
  787. Accepts :
  788.  
  789.     EVTptr        Address of event block
  790.  
  791.  
  792. Returns :
  793.  
  794.  
  795. */
  796.  
  797. sdsrsc (EVTptr)
  798.  
  799. EVT        *EVTptr;        /* Addr of EVT block */
  800.  
  801. {
  802. IND    int    units, value;        /* Units and value */
  803. IND    char    **kptr;            /* Ptr ptr */
  804.  
  805. if (!noise (&Tmpcsb, "in"))        /* Give guide */
  806.     return;
  807.  
  808. if (COMNDi (&Tmpcsb, &Deccfb) != _CROK)    /* Get number */
  809.     return;
  810. value = Tmpcsb.CSB_RVL._INT;        /* Get the value */
  811.  
  812. if (!noise (&Tmpcsb, "units"))        /* Guide */
  813.     return;
  814.  
  815. if (COMNDi (&Tmpcsb, &Schcfb) != _CROK)    /* Get units */
  816.     return;
  817. kptr = (char **) (Tmpcsb.CSB_RVL._ADR);
  818. units = kptr - (&Schktb[0]);        /* Get keyword index */
  819.  
  820. if (!confrm (&Tmpcsb))            /* Confirm the command */
  821.     return;
  822.  
  823. EVTptr -> EVT_DIS = _EDSCH;        /* Set disposition type */
  824. EVTptr -> EVT_RSU = units;        /* Remember units */
  825. EVTptr -> EVT_RSV = value;        /* Reschedule value */
  826.  
  827. /* Remember original day-of-month */
  828.  
  829. cvided (EVTptr -> EVT_DTM, 0, &units, &value, &units, &units, &units);
  830. EVTptr -> EVT_RSO = value;        /* just for february... */
  831.  
  832. }
  833.