home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 216.lha / EdLib_v1.0 / man < prev    next >
Text File  |  1996-02-15  |  19KB  |  741 lines

  1. Here are the man pages for the library functions:
  2. This is for edlib version 1.0 04/08/88
  3.  
  4. BINTOINT(3)                Library Functions               BINTOINT(3)
  5.  
  6.  
  7.  
  8. NAME
  9.      bintoint - give the binary value of a string of binary digits
  10.  
  11. SYNOPSIS
  12.      #include <edlib.h>
  13.  
  14.      int bintoint(number)
  15.      char *number;
  16.  
  17. DESCRIPTION
  18.      Bintoint takes a string that may have been read in with scanf(3)
  19.      or from the console, and treats it as if it were a binary number.
  20.      The integer value of the binary number is returned. Bintoint
  21.      stops at the first character that is not a '1' or a '0'. If the
  22.      first character in the string is not a binary digit, then a value
  23.      of 0 is returned.
  24.  
  25. AUTHOR
  26.      Edwin Hoogerbeets 01/08/88
  27.  
  28. SEE ALSO
  29.      dectoint(3), hextoint(3), toint(3)
  30.  
  31.  
  32.  
  33. GETOPT(3)                  Library Functions                 GETOPT(3)
  34.  
  35.  
  36.  
  37. NAME
  38.      getopt - get option letter from argv
  39.  
  40. SYNOPSIS
  41.      #include <edlib.h>
  42.  
  43.      int getopt(argc, argv, optstring)
  44.      inta argc;
  45.  
  46.      char **optstring;
  47.  
  48.      extern char *optarg;
  49.      extern int optind;
  50.  
  51. DESCRIPTION
  52.      Getopt returns the next option letter in argv that matches a
  53.      letter in optstring.  Optstring is a string of recognized
  54.      option letters; if a letter is followed by a colon, the
  55.      option is expected to have an argument that may or may not
  56.      be separated from it by white space.  Optarg is set to point
  57.      to the start of the option argument on return from getopt.
  58.  
  59.      Getopt places in optind the argv index of the next argument
  60.      to be processed.  Because optind is external, it is normally
  61.      initialized to zero automatically before the first call to
  62.      getopt.
  63.  
  64.      When an option that is not in the list occurs, a NULL is
  65.      returned and the optarg pointer is set to point to the
  66.      first character of the null terminated string. This is done
  67.      so that options may be specified with other parameters
  68.      interspersed between them.
  69.  
  70. DIAGNOSTICS
  71.      Getopt prints an error message on stderr and returns a ques-
  72.      tion mark (?) when it encounters an option letter not
  73.      included in optstring.
  74.  
  75. EXAMPLE
  76.      The following code fragment shows how one might process the
  77.      arguments for a command that can take the mutually exclusive
  78.      options a and b, and the options f and o, both of which
  79.      require arguments:
  80.  
  81.           main(argc, argv)
  82.           int argc;
  83.           char **argv;
  84.           {
  85.                int c;
  86.                extern int optind;
  87.                extern char *optarg;
  88.                .
  89.                .
  90.                .
  91.                 while ((c = getopt(argc, argv, "abf:o:")) != EOF)
  92.                     switch (c) {
  93.                     case `a':
  94.                          if (bflg)
  95.                               errflg++;
  96.                          else
  97.                               aflg++;
  98.                          break;
  99.                     case `b':
  100.                          if (aflg)
  101.                               errflg++;
  102.                          else
  103.                               bproc();
  104.                          break;
  105.                     case `f':
  106.                          ifile = optarg;
  107.                          break;
  108.                     case `o':
  109.                          ofile = optarg;
  110.                          break;
  111.                     case `?':
  112.                     default:
  113.                          errflg++;
  114.                          break;
  115.                     }
  116.                if (errflg) {
  117.                     fprintf(stderr, "Usage: ...");
  118.                     exit(2);
  119.                }
  120.                for (; optind < argc; optind++) {
  121.                     .
  122.                     .
  123.                     .
  124.                }
  125.                .
  126.                .
  127.                .
  128.           }
  129.  
  130. HISTORY
  131.      Written by Henry Spencer, working from a Bell Labs manual
  132.      page.  Modified by Keith Bostic to behave more like the Sys-
  133.      tem V version. Ported to the Amiga and modified to take
  134.      options anywhere by Edwin (Deepthot) Hoogerbeets.
  135.  
  136. BUGS
  137.      It is not obvious how `-' standing alone should be treated;
  138.      this version treats it as a non-option argument, which is
  139.      not always right.
  140.  
  141.      Option arguments are allowed to begin with `-'; this is rea-
  142.      sonable but reduces the amount of error checking possible.
  143.      Getopt is quite flexible but the obvious price must be paid:
  144.      there is much it could do that it doesn't, like checking
  145.      mutually exclusive options, checking type of option argu-
  146.      ments, etc.
  147.  
  148.  
  149.  
  150.  
  151. DECTOINT(3)                Library Functions               DECTOINT(3)
  152.  
  153.  
  154.  
  155.  
  156.  
  157. NAME
  158.      dectoint - give the decimal value of a string of decimal digits
  159.  
  160. SYNOPSIS
  161.      #include <edlib.h>
  162.  
  163.      int dectoint(number)
  164.      char *number;
  165.  
  166. DESCRIPTION
  167.      Dectoint takes a string that may have been read in with scanf(3)
  168.      or from the console, and treats it as if it were a decimal number.
  169.      The integer value of the decimal number is returned. Dectoint
  170.      stops at the first character that is not a decimal digit. If the
  171.      first character in the string is not a decimal digit, then a value
  172.      of 0 is returned.
  173.  
  174. AUTHOR
  175.      Edwin Hoogerbeets 01/08/88
  176.  
  177. SEE ALSO
  178.      bintoint(3), hextoint(3), toint(3)
  179.  
  180.  
  181.  
  182. HEXTOINT(3)                Library Functions               HEXTOINT(3)
  183.  
  184.  
  185.  
  186.  
  187.  
  188. NAME
  189.      hextoint - give the decimal value of a string of decimal digits
  190.  
  191. SYNOPSIS
  192.      #include <edlib.h>
  193.  
  194.      int hextoint(number)
  195.      char *number;
  196.  
  197. DESCRIPTION
  198.      Hextoint takes a string that may have been read in with scanf(3)
  199.      or from the console, and treats it as if it were a hexadecimal
  200.      number. The integer value of the hexadecimal number is returned.
  201.      Hextoint stops at the first character that is not a hexadecimal
  202.      digit. If the first character in the string is not a hexadecimal
  203.      digit, then a value of 0 is returned.
  204.  
  205. AUTHOR
  206.      Edwin Hoogerbeets 01/08/88
  207.  
  208. SEE ALSO
  209.      bintoint(3), dectoint(3), toint(3)
  210.  
  211.  
  212.  
  213. ISBDIGIT(3)                Library Functions               ISBDIGIT(3)
  214.  
  215.  
  216.  
  217. NAME
  218.      isbdigit - tell whether given character is a binary digit
  219.  
  220. SYNOPSIS
  221.      #include <edlib.h>
  222.  
  223.      int isbdigit(c)
  224.      char c;
  225.  
  226. DESCRIPTION
  227.      Isbdigit returns a 1 if the given characters is either a '1'
  228.      or a '0'. Isbdigit returns a 0 for all other characters.
  229.  
  230. AUTHOR
  231.      Edwin Hoogerbeets 01/08/88
  232.  
  233. SEE ALSO
  234.      isdigit(3), isodigit(3), isxdigit(3)
  235.  
  236.  
  237.  
  238. ISCSYM(3)                  Library Functions                 ISCSYM(3)
  239.  
  240.  
  241.  
  242. NAME
  243.      iscsym - tell whether given character could be found in a C
  244.      symbol
  245.  
  246. SYNOPSIS
  247.      #include <edlib.h>
  248.  
  249.      int iscsym(c)
  250.      char c;
  251.  
  252. DESCRIPTION
  253.      Iscsym tells whether it is possible that the given character
  254.      could appear in a C symbol. A C symbol might be the name of a
  255.      variable, structure, reserved word or a function. Not all
  256.      characters that are valid in a C symbol may be the first
  257.      character of an identifier in most implementations of C. In
  258.      most versions, the characters allowed after the first character
  259.      are the upper and lower case alphabetic characters, the digits
  260.      '0' to '9' and the underscore (_).
  261.  
  262. AUTHOR
  263.      Edwin Hoogerbeets 01/08/88
  264.  
  265. SEE ALSO
  266.      iscsymf(3)
  267.  
  268. BUGS
  269.      This function depends on the C compiler used, and thus the
  270.      characters that are valid in a C symbol may be different, even
  271.      on the same machine.
  272.  
  273.  
  274.  
  275. ISCSYMF(3)                 Library Functions                ISCSYMF(3)
  276.  
  277.  
  278.  
  279. NAME
  280.      iscsymf - tell whether given character could be found as the
  281.      first character of a C symbol
  282.  
  283. SYNOPSIS
  284.      #include <edlib.h>
  285.  
  286.      int iscsymf(c)
  287.      char c;
  288.  
  289. DESCRIPTION
  290.      Iscsymf tells whether it is possible that the given character
  291.      could appear as the first character of a C symbol. A C symbol
  292.      might be the the name of a variable, structure, reserved word
  293.      or a functions. Not all characters that are valid in a C symbol
  294.      may be the first character of an identifier in most implementations
  295.      of C. In most versions, the characters allowed as the first
  296.      character are the upper and lower case alphbetic characters and
  297.      the underscore (_).
  298.  
  299. AUTHOR
  300.      Edwin Hoogerbeets 01/08/88
  301.  
  302. SEE ALSO
  303.      iscsym(3)
  304.  
  305. BUGS
  306.      This function depends on the C compiler used, and thus the
  307.      characters that are valid as the intial character in a C symbol
  308.      may be different, even on the same machine.
  309.  
  310.  
  311.  
  312.  
  313. ISODIGIT(3)                Library Functions               ISODIGIT(3)
  314.  
  315.  
  316.  
  317. NAME
  318.      isodigit - tell whether given character is an octal digit
  319.  
  320. SYNOPSIS
  321.      #include <edlib.h>
  322.  
  323.      int isodigit(c)
  324.      char c;
  325.  
  326. DESCRIPTION
  327.      Isodigit returns a 1 if the given characters is an octal digit.
  328.      Isodigit returns a 0 for all other characters.
  329.  
  330. AUTHOR
  331.      Edwin Hoogerbeets 01/08/88
  332.  
  333. SEE ALSO
  334.      isdigit(3), isbdigit(3), isxdigit(3)
  335.  
  336.  
  337.  
  338. STOUPPER(3)                Library Functions               STOUPPER(3)
  339.  
  340.  
  341.  
  342. NAME
  343.      stoupper - convert a string to only upper case characters
  344.  
  345. SYNOPSIS
  346.      #include <edlib.h>
  347.  
  348.      char *stoupper(str)
  349.      char *str;
  350.  
  351. DESCRIPTION
  352.      Stoupper takes a pointer to a null terminated string and
  353.      converts each lower case character into its upper case
  354.      equivalent. All other characters are left untouched.
  355.  
  356. AUTHOR
  357.      Edwin Hoogerbeets 01/08/88
  358.  
  359. SEE ALSO
  360.      stolower(3)
  361.  
  362.  
  363.  
  364. STOLOWER(3)                Library Functions               STOLOWER(3)
  365.  
  366.  
  367.  
  368. NAME
  369.      stolower - convert a string to only lower case characters
  370.  
  371. SYNOPSIS
  372.  
  373.  
  374.      char *stolower(str)
  375.      char *str;
  376.  
  377. DESCRIPTION
  378.      Stolower takes a pointer to a null terminated string and
  379.      converts each upper case character into its lower case
  380.      equivalent. All other characters are left untouched.
  381.  
  382. AUTHOR
  383.      Edwin Hoogerbeets 01/08/88
  384.  
  385. SEE ALSO
  386.      stoupper(3)
  387.  
  388.  
  389.  
  390.  
  391. STRCSPN(3)                 Library Functions                STRCSPN(3)
  392.  
  393.  
  394.  
  395. NAME
  396.      strcspn - find the length of the longest intial segment of a
  397.      string that consists of characters not from a certain set.
  398.  
  399. SYNOPSIS
  400.      #include <edlib.h>
  401.  
  402.      int strcspn(str, charset)
  403.      char *str, *charset;
  404.  
  405. DESCRIPTION
  406.      Strcspn searches the null terminated string 'str' for characters
  407.      in the set 'charset'. The length of the longest intial string
  408.      that consists of characters not from 'charset' is returned. If no
  409.      characters of 'str' are also members of 'charset', then the
  410.      length of 'str' is returned. If 'charset' is null then this
  411.      will also cause the full length of 'str' to be returned.
  412.  
  413.      This function is also known as instr.
  414.  
  415. AUTHOR
  416.      Daniel J. Barrett.
  417.      barrett@cs.jhu.edu or ins_adjb@jhunix.UUCP
  418.  
  419. SEE ALSO
  420.      strspn(3)
  421.  
  422.  
  423.  
  424. STRICMP(3)                 Library Functions                STRICMP(3)
  425.  
  426.  
  427.  
  428. NAME
  429.      stricmp - compare two strings with case insensitivity
  430.  
  431. SYNOPSIS
  432.      #include <edlib.h>
  433.  
  434.      int stricmp(str1,str2)
  435.      char *str1,*str2;
  436.  
  437. DESCRIPTION
  438.      Stricmp lexographically compares the two null terminated strings.
  439.      It returns a number less than zero if the first differing
  440.      character of str1 is less than that of str2, zero if the two
  441.      strings are equal, and a number greater than zero if the
  442.      first differing character in str1 is greater than the
  443.      corresponding character of str2. Stricmp works like strcmp(3)
  444.      except that all alphabetic characters are treated as lower case
  445.      for the purposes of the comparison.
  446.  
  447. AUTHOR
  448.      Edwin Hoogerbeets 01/08/88
  449.  
  450. SEE ALSO
  451.      strcmp(3), strncmp(3), strnicmp(3)
  452.  
  453.  
  454.  
  455. STRNICMP(3)                Library Functions               STRNICMP(3)
  456.  
  457.  
  458.  
  459. NAME
  460.      strnicmp - compare two strings with case insensitivity up to
  461.      a certain length
  462.  
  463. SYNOPSIS
  464.      #include <edlib.h>
  465.  
  466.      int strnicmp(str1,str2,len)
  467.      char *str1,*str2;
  468.      int len;
  469.  
  470. DESCRIPTION
  471.      Strnicmp lexographically compares the two null terminated
  472.      strings up to the length 'len'. It returns a number less than
  473.      zero if the first differing character of str1 is less than that
  474.      of str2, zero if the two strings are equal, and a number greater
  475.      than zero if the first differing character in str1 is greater
  476.      than the corresponding character of str2. Strnicmp works like
  477.      strncmp(3) except that all alphabetic characters are treated as
  478.      lower case for the purposes of the comparison.
  479.  
  480. AUTHOR
  481.      Edwin Hoogerbeets 01/08/88
  482.  
  483. SEE ALSO
  484.      strcmp(3), strncmp(3), stricmp(3)
  485.  
  486.  
  487.  
  488. STRPBRK(3)                 Library Functions                STRPBRK(3)
  489.  
  490.  
  491.  
  492. NAME
  493.      strpbrk - find the first occurance of a character of a set in
  494.      a string
  495.  
  496. SYNOPSIS
  497.      #include <edlib.h>
  498.  
  499.      char *strpbrk(str, charset)
  500.      char *str, *charset;
  501.  
  502. DESCRIPTION
  503.      Strpbrk searches forwards through the null terminated string
  504.      'str' for occurances of a character included in the character
  505.      set 'charset'. The 'charset' variable is null terminated string
  506.      that is treated as a character set. Therefore, repetition and
  507.      order are ignored. Strpbrk returns a pointer to the first
  508.      character of 'charset' that is found in 'str'.
  509.  
  510. DIAGNOSTICS
  511.      If no character in 'charset' is found in 'str', then a null
  512.      pointer (NULL) is returned.
  513.  
  514. AUTHOR
  515.      Daniel J. Barrett.
  516.      barrett@cs.jhu.edu or ins_adjb@jhunix.UUCP
  517.  
  518. SEE ALSO
  519.      strrpbrk(3), strcspn(3), strspn(3)
  520.  
  521.  
  522.  
  523. STRPOS(3)                  Library Functions                 STRPOS(3)
  524.  
  525.  
  526.  
  527. NAME
  528.      strpos - give the first position of a character withing a string
  529.  
  530. SYNOPSIS
  531.      #include <edlib.h>
  532.  
  533.      int strpos(string,key)
  534.      char *string;
  535.      char key;
  536.  
  537. DESCRIPTION
  538.      Strpos searches the null terminated string 'string' for the
  539.      first occurance of the character 'key'. The position of this
  540.      character is returned. The terminating null character is
  541.      considered to be part of the string for the purposes of this
  542.      search. Thus, using strpos to find the null will give the
  543.      same result as a strlen(3).
  544.  
  545.      Some implementations of C use a variant called scnstr.
  546.  
  547. DIAGNOSTICS
  548.      Strpos returns a -1 if the character is not found in the string.
  549.  
  550. AUTHOR
  551.      Edwin Hoogerbeets 01/08/88
  552.  
  553. SEE ALSO
  554.      strrpos(3)
  555.  
  556.  
  557.  
  558. STRRPBRK(3)                Library Functions               STRRPBRK(3)
  559.  
  560.  
  561.  
  562. NAME
  563.      strrpbrk - find the last occurance of a character of a set in
  564.      a string
  565.  
  566. SYNOPSIS
  567.      #include <edlib.h>
  568.  
  569.      char *strrpbrk(str, charset)
  570.      char *str, *charset;
  571.  
  572. DESCRIPTION
  573.      Strrpbrk searches backwards through the null terminated string
  574.      'str' for occurances of a character included in the character
  575.      set 'charset'. The 'charset' variable is null terminated string
  576.      that is treated as a character set. Therefore, repetition and
  577.      order are ignored. Strrpbrk returns a pointer to the last
  578.      character of 'charset' that is found in 'str'.
  579.  
  580. DIAGNOSTICS
  581.      If no character in 'charset' is found in 'str', then a null
  582.      pointer (NULL) is returned.
  583.  
  584. AUTHOR
  585.      Edwin Hoogerbeets 01/08/88 modified from strpbrk(3) by:
  586.      Daniel J. Barrett.
  587.      barrett@cs.jhu.edu or ins_adjb@jhunix.UUCP
  588.  
  589. SEE ALSO
  590.      strpbrk(3), strcspn(3), strspn(3)
  591.  
  592.  
  593.  
  594. STRRPOS(3)                 Library Functions                STRRPOS(3)
  595.  
  596.  
  597.  
  598. NAME
  599.      strrpos - give the last position of a character withing a string
  600.  
  601. SYNOPSIS
  602.      #include <edlib.h>
  603.  
  604.      int strrpos(string,key)
  605.      char *string;
  606.      char key;
  607.  
  608. DESCRIPTION
  609.      Strrpos searches the null terminated string 'string' for the
  610.      last occurance of the character 'key'. The position of this
  611.      character is returned. The terminating null character is
  612.      considered to be part of the string for the purposes of this
  613.      search. Thus, using strrpos to find the null will give the
  614.      same result as a strlen(3).
  615.  
  616. DIAGNOSTICS
  617.      Strrpos returns a -1 if the character is not found in the
  618.      string.
  619.  
  620. AUTHOR
  621.      Edwin Hoogerbeets 01/08/88
  622.  
  623. SEE ALSO
  624.      strpos(3)
  625.  
  626.  
  627.  
  628. STRSPN(3)                  Library Functions                 STRSPN(3)
  629.  
  630.  
  631.  
  632. NAME
  633.      strspn - find the length of the longest intial segment
  634.      of a string that consists of characters from a certain set.
  635.  
  636. SYNOPSIS
  637.      #include <edlib.h>
  638.  
  639.      int strspn(str, charset)
  640.      char *str, *charset;
  641.  
  642. DESCRIPTION
  643.      Strspn searches the null terminated string 'str' for characters
  644.      in the set 'charset'. The length of the longest intial string
  645.      that consists of characters from 'charset' is returned. If all
  646.      characters of 'str' are also members of 'charset', then the
  647.      length of 'str' is returned. If 'charset' is null then this
  648.      function will return a zero as none of the characters in 'str'
  649.      could possibly be in the set.
  650.  
  651.      This function is also known as notstr.
  652.  
  653. AUTHOR
  654.      Daniel J. Barrett.
  655.      barrett@cs.jhu.edu or ins_adjb@jhunix.UUCP
  656.  
  657. SEE ALSO
  658.      strcspn(3)
  659.  
  660.  
  661.  
  662. STRTOK(3)                  Library Functions                 STRTOK(3)
  663.  
  664.  
  665.  
  666. NAME
  667.      strtok - search a string for tokens delimited by characters
  668.      from a set
  669.  
  670. SYNOPSIS
  671.      #include <edlib.h>
  672.  
  673.      char *strtok(buf, separators)
  674.      char *buf, *separators;
  675.  
  676. DESCRIPTION
  677.      Strtok searches the null terminated string 'buf' for tokens
  678.      delimited by characters from the character set 'separators'.
  679.      The null terminated string 'separators' is treated as a set.
  680.      Thus, repetition and order are ignored. Strtok replaces the
  681.      separator character with a null byte and returns a pointer to
  682.      the beginning of the token, effectively singling out the first
  683.      token. Subsequent calls to strtok with the parameter 'buf' set
  684.      to NULL returns the next token after the previous one using the
  685.      same string as previous invocations. The character set
  686.      'separators' may be different at each invocation.
  687.  
  688. DIAGNOSTICS
  689.      If no token is found, a NULL pointer is returned.
  690.  
  691. EXAMPLE
  692.      Here is an example program demonstrating strtok(3).
  693.  
  694.      #include <stdio.h>
  695.  
  696.      extern char *strtok();
  697.      char tokesep[] = " \n\t\rx";
  698.  
  699.      main()
  700.      {
  701.              char buf[BUFSIZ], *tokep;
  702.  
  703.              while (fgets(buf, sizeof(buf), stdin)) {
  704.                      tokep = strtok(buf, tokesep);
  705.                      do {
  706.                              printf("Token is %s\n", tokep);
  707.                              tokep = strtok((char *)NULL, tokesep);
  708.                      }while (tokep);
  709.              }
  710.      }
  711.  
  712. AUTHOR
  713.      Daniel J. Barrett.
  714.      barrett@cs.jhu.edu or ins_adjb@jhunix.UUCP
  715.  
  716.  
  717.  
  718. TOINT(3)                   Library Functions                  TOINT(3)
  719.  
  720.  
  721.  
  722. NAME
  723.      toint - return the hexadecimal value of a character
  724.  
  725. SYNOPSIS
  726.      #include <edlib.h>
  727.  
  728.      int toint(c)
  729.      char c;
  730.  
  731. DESCRIPTION
  732.      Toint treats the character 'c' as a hexadecimal character and
  733.      returns its integer equivalent.
  734.  
  735. DIAGNOSTICS
  736.      
  737.      returned.
  738.  
  739. AUTHOR
  740.      Edwin Hoogerbeets 01/08/88
  741.