Select Git revision
Dockerfile-frontend
abi.h 6.73 KiB
/*
* This file is part of the Poliqarp suite.
*
* Copyright (C) 2004-2009 by Instytut Podstaw Informatyki Polskiej
* Akademii Nauk (IPI PAN; Institute of Computer Science, Polish
* Academy of Sciences; cf. www.ipipan.waw.pl). All rights reserved.
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation and appearing in the file gpl.txt included in the packaging
* of this file. (See http://www.gnu.org/licenses/translations.html for
* unofficial translations.)
*
* A commercial license is available from IPI PAN (contact
* Michal.Ciesiolka@ipipan.waw.pl or ipi@ipipan.waw.pl for more
* information). Licensees holding a valid commercial license from IPI
* PAN may use this file in accordance with that license.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
* THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
/**
* @file abi.h
* This file describes binary corpus format.
*/
#ifndef POLIQARP_ABI_H
#define POLIQARP_ABI_H
#include <poliqarp-config.h>
#include <stddef.h>
#include <stddef.h>
#define POLIQARP_ABI_VERSION 2
/**
* Interpretation item ABI.
*/
struct poliqarp_binary_interp {
uint32_t base_id; /**< Identifier of string associated with this
base form. */
uint32_t tag_id; /**< Identifier of string associated with this tag. */
} __attribute__((packed)); /* -64- */
union poliqarp_legacy_binary_interp {
struct {
unsigned base_id:20; /**< Identifier of string associated with this
base form. */
unsigned tag_id:12; /**< Identifier of string associated with this tag. */
} __attribute__((packed)) attributes; /* -32- */
uint32_t data;
};
static inline struct poliqarp_binary_interp
poliqarp_convert_legacy_binary_interp(
const union poliqarp_legacy_binary_interp legacy_interpretation)
{
struct poliqarp_binary_interp res;
uint32_t data = en4(legacy_interpretation.data);
res.base_id = data & 0xfffff;
res.tag_id = data >> 20;
return res;
}
/**
* Segment item ABI.
*/