129 lines
2.5 KiB
C
129 lines
2.5 KiB
C
/**
|
|
* Part of the Lccrt Project, under the Apache License v2.0
|
|
* See http://www.apache.org/licenses/LICENSE-2.0.txt for license information.
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* lccrt_link.c - реализация пользовательский интерфейс (динамической) компиляции.
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
#include <stdarg.h>
|
|
|
|
#include "lccrt_real.h"
|
|
|
|
/**
|
|
* Получить значение.
|
|
*/
|
|
lccrt_link_t
|
|
lccrt_link_get( lccrt_link_bind_t bnd, lccrt_link_visibility_t vis, lccrt_link_tls_t tls,
|
|
int is_cnst, int is_alias)
|
|
{
|
|
lccrt_link_t r = 0;
|
|
|
|
LCCRT_LINK_BYTE_BND( &r) = bnd;
|
|
LCCRT_LINK_BYTE_VIS( &r) = vis;
|
|
LCCRT_LINK_BYTE_TLS( &r) = tls;
|
|
LCCRT_LINK_BYTE_CST( &r) = is_cnst;
|
|
LCCRT_LINK_BYTE_ALS( &r) = is_alias;
|
|
|
|
return (r);
|
|
} /* lccrt_link_get */
|
|
|
|
/**
|
|
* Получить значение.
|
|
*/
|
|
lccrt_link_t
|
|
lccrt_link_conv( lccrt_asmlink_t link)
|
|
{
|
|
lccrt_link_t r = 0;
|
|
|
|
r = lccrt_link_get( link.bnd, link.vis, link.tls, link.is_cnst, link.is_alias);
|
|
|
|
return (r);
|
|
} /* lccrt_link_conv */
|
|
|
|
/**
|
|
* Получить значение поля.
|
|
*/
|
|
lccrt_link_bind_t
|
|
lccrt_link_get_bnd( lccrt_link_t link)
|
|
{
|
|
lccrt_link_bind_t r;
|
|
|
|
r = LCCRT_LINK_BYTE_BND( &link);
|
|
|
|
return (r);
|
|
} /* lccrt_link_get_bnd */
|
|
|
|
/**
|
|
* Получить значение поля.
|
|
*/
|
|
lccrt_link_visibility_t
|
|
lccrt_link_get_vis( lccrt_link_t link)
|
|
{
|
|
lccrt_link_visibility_t r;
|
|
|
|
r = LCCRT_LINK_BYTE_VIS( &link);
|
|
|
|
return (r);
|
|
} /* lccrt_link_get_vis */
|
|
|
|
/**
|
|
* Получить значение поля.
|
|
*/
|
|
lccrt_link_tls_t
|
|
lccrt_link_get_tls( lccrt_link_t link)
|
|
{
|
|
lccrt_link_tls_t r;
|
|
|
|
r = LCCRT_LINK_BYTE_TLS( &link);
|
|
|
|
return (r);
|
|
} /* lccrt_link_get_tls */
|
|
|
|
/**
|
|
* Получить значение поля.
|
|
*/
|
|
int
|
|
lccrt_link_is_const( lccrt_link_t link)
|
|
{
|
|
int r;
|
|
|
|
r = LCCRT_LINK_BYTE_CST( &link);
|
|
|
|
return (r);
|
|
} /* lccrt_link_is_const */
|
|
|
|
/**
|
|
* Получить значение поля.
|
|
*/
|
|
int
|
|
lccrt_link_is_alias( lccrt_link_t link)
|
|
{
|
|
int r;
|
|
|
|
r = LCCRT_LINK_BYTE_ALS( &link);
|
|
|
|
return (r);
|
|
} /* lccrt_link_is_alias */
|
|
|
|
/**
|
|
* Получить значение.
|
|
*/
|
|
lccrt_asmlink_t
|
|
lccrt_link_unpack( lccrt_link_t link)
|
|
{
|
|
lccrt_asmlink_t r = {0};
|
|
|
|
r.bnd = LCCRT_LINK_BYTE_BND( &link);
|
|
r.vis = LCCRT_LINK_BYTE_VIS( &link);
|
|
r.tls = LCCRT_LINK_BYTE_TLS( &link);
|
|
r.is_cnst = LCCRT_LINK_BYTE_CST( &link);
|
|
r.is_alias = LCCRT_LINK_BYTE_ALS( &link);
|
|
|
|
return (r);
|
|
} /* lccrt_link_unpack */
|