Annotation of mandoc/strings.c, Revision 1.1
1.1 ! kristaps 1: /* $Id: macro.c,v 1.3 2008/12/15 02:23:12 kristaps Exp $ */
! 2: /*
! 3: * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
! 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
! 7: * above copyright notice and this permission notice appear in all
! 8: * copies.
! 9: *
! 10: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
! 11: * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
! 12: * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
! 13: * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
! 14: * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
! 15: * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
! 16: * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
! 17: * PERFORMANCE OF THIS SOFTWARE.
! 18: */
! 19: #include <assert.h>
! 20: #include <ctype.h>
! 21: #include <stdlib.h>
! 22: #include <stdio.h>
! 23:
! 24: #include "private.h"
! 25:
! 26: int
! 27: mdoc_isdelim(const char *p)
! 28: {
! 29:
! 30: if (0 == *p)
! 31: return(0);
! 32: if (0 != *(p + 1))
! 33: return(0);
! 34:
! 35: switch (*p) {
! 36: case('{'):
! 37: /* FALLTHROUGH */
! 38: case('.'):
! 39: /* FALLTHROUGH */
! 40: case(','):
! 41: /* FALLTHROUGH */
! 42: case(';'):
! 43: /* FALLTHROUGH */
! 44: case(':'):
! 45: /* FALLTHROUGH */
! 46: case('?'):
! 47: /* FALLTHROUGH */
! 48: case('!'):
! 49: /* FALLTHROUGH */
! 50: case('('):
! 51: /* FALLTHROUGH */
! 52: case(')'):
! 53: /* FALLTHROUGH */
! 54: case('['):
! 55: /* FALLTHROUGH */
! 56: case(']'):
! 57: /* FALLTHROUGH */
! 58: case('}'):
! 59: return(1);
! 60: default:
! 61: break;
! 62: }
! 63:
! 64: return(0);
! 65: }
! 66:
CVSweb