home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / EDRETINF.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.7 KB  |  61 lines

  1. /**
  2. *
  3. * Name        EDRETINF -- Return the current cursor & video info.
  4. *
  5. * Synopsis    error = edretinf(pdata, pinfo, pfield_loc,
  6. *                 field_height, field_width);
  7. *
  8. *        int error           Returned error code.
  9. *        void *pdata           Unused; see below.
  10. *        CUR_INFO *pinfo        Pointer to structure to be filled
  11. *                       in.
  12. *        const LOC *pfield_loc  Pointer to proposed field
  13. *                       location.
  14. *        int field_height       Height and width of the field
  15. *        int field_width        which is to be displayed.
  16. *
  17. * Description    EDRETINF will return information about the cursor and
  18. *        the video page in which an edit field is to be
  19. *        displayed.  The information will be placed in the
  20. *        area pointed to by pinfo.  The parameter pdata is
  21. *        never used; its inclusion in the calling sequence is
  22. *        to ensure calling sequence compatibility with WNRETINF.
  23. *
  24. * Returns    int error    ED_NO_ERROR - No error occured.
  25. *                ED_ILL_DIM  - Field will not fit on
  26. *                          active display page.
  27. *
  28. * Version    6.00 (C)Copyright Blaise Computing Inc.  1989
  29. *
  30. **/
  31. #include <bscreens.h>
  32. #include <bedit.h>
  33.  
  34. int edretinf(pdata, pinfo, pfield_loc, field_height, field_width)
  35. void      *pdata;
  36. CUR_INFO  *pinfo;
  37. const LOC *pfield_loc;
  38. int       field_height;
  39. int       field_width;
  40. {
  41.     int mode, columns, act_page;
  42.  
  43.         /* Supress unused parameter compiler warnings.        */
  44.     ((char *) pdata)++;
  45.  
  46.     mode = columns = act_page = 0;
  47.     scmode(&mode, &columns, &act_page);
  48.     pinfo->off = sccurst(&(pinfo->row),
  49.              &(pinfo->col),
  50.              &(pinfo->size.high),
  51.              &(pinfo->size.low));
  52.  
  53.     if (utrange(pfield_loc->row, 0, scrows() - field_height) ||
  54.     utrange(pfield_loc->col, 0, columns - field_width))
  55.     {
  56.     return(ED_ILL_DIM);
  57.     }
  58.  
  59.     return(ED_NO_ERROR);
  60. }
  61.