Annotation of src/usr.bin/make/varmodifiers.h, Revision 1.3
1.3 ! espie 1: #ifndef VARMODIFIERS_H
! 2: #define VARMODIFIERS_H
! 3:
1.2 espie 4: /* $OpenPackages$ */
1.1 espie 5: /* $OpenBSD$ */
6:
7: /*
8: * Copyright (c) 1999 Marc Espie.
9: *
10: * Extensive code changes for the OpenBSD project.
11: *
12: * Redistribution and use in source and binary forms, with or without
13: * modification, are permitted provided that the following conditions
14: * are met:
15: * 1. Redistributions of source code must retain the above copyright
16: * notice, this list of conditions and the following disclaimer.
17: * 2. Redistributions in binary form must reproduce the above copyright
18: * notice, this list of conditions and the following disclaimer in the
19: * documentation and/or other materials provided with the distribution.
20: *
21: * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS
22: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD
25: * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32: */
1.3 ! espie 33:
! 34: /* VarModifiers_Init();
! 35: * Set up varmodifiers internal table according to selected features.
! 36: * This can be called several times without harm. */
! 37: extern void VarModifiers_Init(void);
! 38:
! 39:
! 40: /* result = VarModifiers_Apply(val, name, ctxt, undef_is_bad,
! 41: * &should_free, modstart, endc, &length);
! 42: * Applies variable modifiers starting at modstart (including :),
! 43: * ending with character endc, to value val.
! 44: * Variables in spec are taken from context ctxt.
! 45: * If undef_is_bad, error occurs if undefined variables are mentioned.
! 46: * length is filled with the total length of the modifier spec.
! 47: * name holds the name of the corresponding variable, as some ODE
! 48: * modifiers need it.
! 49: *
! 50: * If both val and name are NULL, VarModifiers_Apply just parses the
! 51: * modifiers specification, as it can't apply it to anything. */
1.2 espie 52: extern char *VarModifiers_Apply(char *, const struct Name *, SymTable *,
1.3 ! espie 53: bool, bool *, const char *, int, size_t *);
! 54:
! 55: /* Direct interface to specific modifiers used under special circumstances. */
! 56: /* tails = Var_GetTail(string);
! 57: * Returns the tail of list of words in string (needed for SysV locals). */
1.2 espie 58: extern char *Var_GetTail(char *);
1.3 ! espie 59: /* heads = Var_GetHead(string);
! 60: * Returns the head of list of words in string. */
! 61: /* XXX this does not replace foo with ., as (sun) System V make does.
! 62: * Should it ? */
1.2 espie 63: extern char *Var_GetHead(char *);
1.1 espie 64: #endif