2014-08-21 18:02:43 -04:00
|
|
|
/*
|
|
|
|
This file is part of tgl-library
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
Copyright Vitaly Valtman 2014
|
|
|
|
*/
|
2014-08-12 05:59:59 -04:00
|
|
|
#ifndef __AUTO_H__
|
|
|
|
#define __AUTO_H__
|
|
|
|
|
2014-09-10 07:52:42 -04:00
|
|
|
struct tl_type_descr {
|
2014-08-12 05:59:59 -04:00
|
|
|
unsigned name;
|
|
|
|
char *id;
|
2014-09-10 07:52:42 -04:00
|
|
|
int params_num;
|
|
|
|
long long params_types;
|
2014-08-12 05:59:59 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct paramed_type {
|
2014-09-10 07:52:42 -04:00
|
|
|
struct tl_type_descr *type;
|
2014-08-12 05:59:59 -04:00
|
|
|
struct paramed_type **params;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NAME_ARRAY 0x89932ad9
|
|
|
|
|
|
|
|
#define TYPE_TO_PARAM(NAME) (&(struct paramed_type) {.type = &tl_type_## NAME, .params=0})
|
2014-08-12 11:15:04 -04:00
|
|
|
#define TYPE_TO_PARAM_1(NAME,PARAM1) (&(struct paramed_type) {.type = &tl_type_## NAME, .params=(struct paramed_type *[1]){PARAM1}})
|
2014-08-12 05:59:59 -04:00
|
|
|
#define ODDP(x) (((long)(x)) & 1)
|
|
|
|
#define EVENP(x) (!ODDP(x))
|
|
|
|
#define INT2PTR(x) (void *)(long)(((long)x) * 2 + 1)
|
|
|
|
#define PTR2INT(x) ((((long)x) - 1) / 2)
|
|
|
|
|
2014-09-11 05:35:27 -04:00
|
|
|
void tgl_paramed_type_free (struct paramed_type *P);
|
|
|
|
|
2014-08-12 08:20:00 -04:00
|
|
|
#include "auto/auto-header.h"
|
2014-08-12 05:59:59 -04:00
|
|
|
|
|
|
|
#endif
|