[BACK]Return to man_argv.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Annotation of mandoc/man_argv.c, Revision 1.8

1.8     ! kristaps    1: /*     $Id: man_argv.c,v 1.7 2011/03/22 14:33:05 kristaps Exp $ */
1.1       kristaps    2: /*
1.5       schwarze    3:  * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
1.1       kristaps    4:  *
                      5:  * Permission to use, copy, modify, and distribute this software for any
                      6:  * purpose with or without fee is hereby granted, provided that the above
                      7:  * copyright notice and this permission notice appear in all copies.
                      8:  *
                      9:  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10:  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11:  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12:  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13:  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14:  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15:  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     16:  */
1.2       kristaps   17: #ifdef HAVE_CONFIG_H
                     18: #include "config.h"
                     19: #endif
                     20:
1.1       kristaps   21: #include <assert.h>
                     22:
1.7       kristaps   23: #include "man.h"
1.3       kristaps   24: #include "mandoc.h"
1.1       kristaps   25: #include "libman.h"
1.5       schwarze   26: #include "libmandoc.h"
1.1       kristaps   27:
1.8     ! kristaps   28: enum margserr
1.1       kristaps   29: man_args(struct man *m, int line, int *pos, char *buf, char **v)
                     30: {
1.5       schwarze   31:        char     *start;
1.1       kristaps   32:
                     33:        assert(*pos);
1.5       schwarze   34:        *v = start = buf + *pos;
                     35:        assert(' ' != *start);
1.1       kristaps   36:
1.5       schwarze   37:        if ('\0' == *start)
1.1       kristaps   38:                return(ARGS_EOLN);
                     39:
1.6       kristaps   40:        *v = mandoc_getarg(m->parse, v, line, pos);
1.5       schwarze   41:        return('"' == *start ? ARGS_QWORD : ARGS_WORD);
1.1       kristaps   42: }

CVSweb