aliasname_local.h revision 1.2
11.2Stnozaki/* $NetBSD: aliasname_local.h,v 1.2 2009/01/02 00:20:19 tnozaki Exp $ */
21.1Syamt
31.1Syamt/*-
41.1Syamt * Copyright (c)2002 YAMAMOTO Takashi,
51.1Syamt * All rights reserved.
61.1Syamt *
71.1Syamt * Redistribution and use in source and binary forms, with or without
81.1Syamt * modification, are permitted provided that the following conditions
91.1Syamt * are met:
101.1Syamt * 1. Redistributions of source code must retain the above copyright
111.1Syamt *    notice, this list of conditions and the following disclaimer.
121.1Syamt * 2. Redistributions in binary form must reproduce the above copyright
131.1Syamt *    notice, this list of conditions and the following disclaimer in the
141.1Syamt *    documentation and/or other materials provided with the distribution.
151.1Syamt *
161.1Syamt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
171.1Syamt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
181.1Syamt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
191.1Syamt * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
201.1Syamt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
211.1Syamt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
221.1Syamt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
231.1Syamt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
241.1Syamt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
251.1Syamt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
261.1Syamt * SUCH DAMAGE.
271.1Syamt */
281.1Syamt
291.2Stnozaki/*-
301.2Stnozaki * Copyright (c)2008 Citrus Project,
311.2Stnozaki * All rights reserved.
321.2Stnozaki *
331.2Stnozaki * Redistribution and use in source and binary forms, with or without
341.2Stnozaki * modification, are permitted provided that the following conditions
351.2Stnozaki * are met:
361.2Stnozaki * 1. Redistributions of source code must retain the above copyright
371.2Stnozaki *    notice, this list of conditions and the following disclaimer.
381.2Stnozaki * 2. Redistributions in binary form must reproduce the above copyright
391.2Stnozaki *    notice, this list of conditions and the following disclaimer in the
401.2Stnozaki *    documentation and/or other materials provided with the distribution.
411.2Stnozaki *
421.2Stnozaki * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
431.2Stnozaki * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
441.2Stnozaki * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
451.2Stnozaki * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
461.2Stnozaki * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
471.2Stnozaki * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
481.2Stnozaki * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
491.2Stnozaki * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
501.2Stnozaki * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
511.2Stnozaki * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
521.2Stnozaki * SUCH DAMAGE.
531.2Stnozaki */
541.2Stnozaki
551.2Stnozaki#ifndef _ALIASNAME_LOCAL_H_
561.2Stnozaki#define _ALIASNAME_LOCAL_H_
571.2Stnozaki
581.1Syamtconst char *__unaliasname(const char *, const char *, void *, size_t);
591.2Stnozaki
601.2Stnozakistatic __inline int
611.2Stnozaki__isforcemapping(const char *name)
621.2Stnozaki{
631.2Stnozaki	/* don't use strcasecmp, it owes locale. */
641.2Stnozaki	return
651.2Stnozaki	    name[0] == '/' &&
661.2Stnozaki	    (name[1] == 'F' || name[1] == 'f') &&
671.2Stnozaki	    (name[2] == 'O' || name[2] == 'o') &&
681.2Stnozaki	    (name[3] == 'R' || name[3] == 'r') &&
691.2Stnozaki	    (name[4] == 'C' || name[4] == 'c') &&
701.2Stnozaki	    (name[5] == 'E' || name[5] == 'e') &&
711.2Stnozaki	    name[6] == '\0';
721.2Stnozaki}
731.2Stnozaki
741.2Stnozaki#endif /*_ALIASNAME_LOCAL_H_*/
75