# 2.11BSD#431 - /usr/src/usr.bin/uucp/getprm.c

##### Functions

    getprm            X

##### Macros

    LQUOTE            X
    RQUOTE            X

       1: #ifndef lint
       2: static char sccsid[] = "@(#)getprm.c	5.4 (Berkeley) 10/9/85";
       3: #endif
       4:
       5: #include "uucp.h"
       6:
       7: #define LQUOTE  '('
       8: #define RQUOTE ')'
       9:
      10: /*LINTLIBRARY*/
      11:
      12: /*
      13:  *	get next parameter from s
      14:  *
      15:  *	return - pointer to next character in s
      16:  */
      17:
      18: char *
      19: getprm(s, prm)
      20: register char *s, *prm;
      21: {
      22:     register char *c;
      23:
      24:     while (*s == ' ' || *s == '\t' || *s == '\n')
      25:         s++;
      26:
      27:     *prm = '\0';
      28:     if (*s == '\0')
      29:         return NULL;
      30:
      31:     if (*s == '>' || *s == '<' || *s == '|'
      32:       || *s == ';' || *s == '&') {
      33:         *prm++ = *s++;
      34:         *prm = '\0';
      35:         return s;
      36:     }
      37:
      38:     /* look for quoted argument */
      39:     if (*s == LQUOTE) {
      40:         if ((c = index(s + 1, RQUOTE)) != NULL) {
      41:             c++;
      42:             while (c != s)
      43:                 *prm++ = *s++;
      44:             *prm = '\0';
      45:             return s;
      46:         }
      47:     }
      48:
      49:     /* look for `  ` string */
      50:     if (*s == '`') {
      51:         if ((c = index(s + 1, '`')) != NULL) {
      52:             c++;
      53:             while (c != s)
      54:                 *prm++ = *s++;
      55:             *prm = '\0';
      56:             return s;
      57:         }
      58:     }
      59:
      60:     while (*s != ' ' && *s != '\t' && *s != '<'
      61:         && *s != '>' && *s != '|' && *s != '\0'
      62:         && *s != '&' && *s != ';' && *s != '\n')
      63:         *prm++ = *s++;
      64:     *prm = '\0';
      65:
      66:     return s;
      67: }

#### Defined functions

getprm defined in line 18; used 6 times

- in /usr/src/usr.bin/uucp/uux.c line 59, 168-170(2), 221
- in /usr/src/usr.bin/uucp/uuxqt.c line 75, 272

#### Defined variables

sccsid defined in line 2; never used

#### Defined macros

LQUOTE defined in line 7; used 1 times

- in line 39

RQUOTE defined in line 8; used 1 times

- in line 40

Last modified: 1987-02-17 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 465 |