INGOR
Loading...
Searching...
No Matches
ytValue.h
1/*
2 lang/ytValue.{h,c} : Arbitrary value wrapper
3 Copyright (C) 2018, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8
9#ifndef __YTLIB_VALUE_H
10#define __YTLIB_VALUE_H
11
12#include "ytObject.h"
13
14typedef struct {
15 ytObject obj;
16 void * ptr;
17} ytValue;
18
19ytValue * ytValue_new(void * ptr, ytType type);
20void ytValue_delete(void * this);
21ytObject * ytValue_newObject(void * ptr, ytType type);
22ytObject * ytValue_NULL();
23void * ytValue_ptr(ytObject * this);
24ytObject * ytValue_char_ptr(char * ptr);
25ytObject * ytCHAR_PTR(char * ptr);
26ytObject * ytValue_obj(ytValue * val);
27ytObject * ytValue_charP(char * ptr);
28ytObject * ytValue_charPP(char ** ptr);
29ytObject * ytValue_str(char * ptr);
30ytObject * ytValue_strCopy(const char * ptr);
31ytObject * ytValue_int(int value);
32int ytValue_intValue(const ytObject * this);
33void ytValue_intSet(ytObject * obj, int value);
34ytObject * ytValue_intP(int * ptr);
35ytObject * ytValue_double(double value);
36double ytValue_doubleValue(const ytObject * obj);
37void ytValue_doubleSet(ytObject * obj, double value);
38ytObject * ytValue_doubleP(double * ptr);
39char * ytValue_to_char_ptr(ytValue * obj);
40char * ytValue_strValue(const ytObject * obj);
41char * ytValue_objCharP(ytObject * obj);
42ytObject * ytValue_size_t(size_t value);
43size_t ytValue_size_tValue(const ytObject * obj);
44void * ytValue_objVoidP(ytObject * obj);
45void ytValue_setINT_PR(ytObject * a, int v);
46void ytValue_setUINT_PR(ytObject * a, unsigned int v);
47void ytValue_setDOUBLE_PR(ytObject * a, double v);
48void ytValue_setCHAR_PPR(ytObject * a, char * v);
49
50#endif /* __YTLIB_VALUE_H */
The basis class.
ytType
Types supported by ytLib.
Definition ytType.h:14
Wrapper class for primitive and other arbitrary types.
Definition ytValue.h:14