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

Diff for /mandoc/mdoc_argv.c between version 1.31 and 1.36

version 1.31, 2009/10/28 19:21:59 version 1.36, 2010/03/31 07:42:04
Line 14 
Line 14 
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF   * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */   */
   #ifdef HAVE_CONFIG_H
   #include "config.h"
   #endif
   
 #include <sys/types.h>  #include <sys/types.h>
   
 #include <assert.h>  #include <assert.h>
Line 40 
Line 44 
   
 #define MULTI_STEP       5  #define MULTI_STEP       5
   
 static  int              argv_a2arg(int, const char *);  static  int              argv_a2arg(enum mdoct, const char *);
 static  int              args(struct mdoc *, int, int *,  static  int              args(struct mdoc *, int, int *,
                                 char *, int, char **);                                  char *, int, char **);
 static  int              argv(struct mdoc *, int,  static  int              argv(struct mdoc *, int,
Line 214  static int mdoc_argflags[MDOC_MAX] = {
Line 218  static int mdoc_argflags[MDOC_MAX] = {
  * one mandatory value, an optional single value, or no value.   * one mandatory value, an optional single value, or no value.
  */   */
 int  int
 mdoc_argv(struct mdoc *m, int line, int tok,  mdoc_argv(struct mdoc *m, int line, enum mdoct tok,
                 struct mdoc_arg **v, int *pos, char *buf)                  struct mdoc_arg **v, int *pos, char *buf)
 {  {
         char             *p, sv;          char             *p, sv;
Line 268  mdoc_argv(struct mdoc *m, int line, int tok,
Line 272  mdoc_argv(struct mdoc *m, int line, int tok,
                 return(ARGV_ERROR);                  return(ARGV_ERROR);
   
         if (NULL == (arg = *v))          if (NULL == (arg = *v))
                 arg = mandoc_calloc(1, sizeof(struct mdoc_arg));                  arg = *v = mandoc_calloc(1, sizeof(struct mdoc_arg));
   
         arg->argc++;          arg->argc++;
         arg->argv = mandoc_realloc          arg->argv = mandoc_realloc
Line 326  mdoc_zargs(struct mdoc *m, int line, int *pos, 
Line 330  mdoc_zargs(struct mdoc *m, int line, int *pos, 
   
   
 int  int
 mdoc_args(struct mdoc *m, int line,  mdoc_args(struct mdoc *m, int line, int *pos,
                 int *pos, char *buf, int tok, char **v)                  char *buf, enum mdoct tok, char **v)
 {  {
         int               fl, c, i;          int               fl, c, i;
         struct mdoc_node *n;          struct mdoc_node *n;
   
         fl = (0 == tok) ? 0 : mdoc_argflags[tok];          fl = mdoc_argflags[tok];
   
         if (MDOC_It != tok)          if (MDOC_It != tok)
                 return(args(m, line, pos, buf, fl, v));                  return(args(m, line, pos, buf, fl, v));
Line 397  args(struct mdoc *m, int line, int *pos, 
Line 401  args(struct mdoc *m, int line, int *pos, 
          * follows the pattern of [[::delim::][ ]+]+.           * follows the pattern of [[::delim::][ ]+]+.
          */           */
   
         if ((fl & ARGS_DELIM) && mdoc_iscdelim(buf[*pos])) {          if ((fl & ARGS_DELIM) && mdoc_iscdelim(buf[*pos]) > 1) {
                 for (i = *pos; buf[i]; ) {                  for (i = *pos; buf[i]; ) {
                         if ( ! mdoc_iscdelim(buf[i]))                          if ( mdoc_iscdelim(buf[i]) < 2)
                                 break;                                  break;
                         i++;                          i++;
                         if (0 == buf[i] || ' ' != buf[i])                          if (0 == buf[i] || ' ' != buf[i])
Line 548  args(struct mdoc *m, int line, int *pos, 
Line 552  args(struct mdoc *m, int line, int *pos, 
   
   
 static int  static int
 argv_a2arg(int tok, const char *p)  argv_a2arg(enum mdoct tok, const char *p)
 {  {
   
         /*          /*

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.36

CVSweb