dt_xlator.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <strings.h>
#include <stdlib.h>
#include <dt_xlator.h>
#include <dt_impl.h>
{
return (NULL);
}
goto err; /* no memory for identifier hash */
goto err; /* no memory for identifier */
/*
* If a deferred pragma is pending on the keyword "translator", run all
* the deferred pragmas on dx_souid and then copy results to dx_ptrid.
* See the code in dt_pragma.c for details on deferred ident pragmas.
*/
}
return (dxp);
err:
return (NULL);
}
void
{
}
{
return (NULL); /* fail if these are unresolvable types */
/*
* Translators are always defined using a struct or union type, so if
* we are attempting to translate to type "T *", we internally look
* for a translation to type "T" by following the pointer reference.
*/
if (ptr) {
}
/*
* In order to find a matching translator, we iterate over the set of
* available translators in three passes. First, we look for a
* translation from the exact source type to the resolved destination.
* Second, we look for a translation from the resolved source type to
* the resolved destination. Third, we look for a translation from a
* compatible source type (using the same rules as parameter formals)
* to the resolved destination. If all passes fail, return NULL.
*/
goto out;
}
if (flag == DT_XLATE_EXACT)
goto out; /* skip remaining passes if exact match required */
goto out;
}
goto out;
}
out:
return (NULL); /* no translation available to pointer type */
return (dxp);
}
{
else
}
{
return (dnp);
}
return (NULL);
}