15 #include "tm_member_p.h"
19 #include <gwenhywfar/debug.h>
20 #include <gwenhywfar/misc.h>
38 tm->codeDefs=Typemaker2_Code_List_new();
48 if (tm->refCount==1) {
50 Typemaker2_Code_List_free(tm->codeDefs);
53 free(tm->elementName);
56 free(tm->defaultValue);
57 free(tm->presetValue);
92 if (s && *s) tm->name=strdup(s);
100 assert(tm->refCount);
108 assert(tm->refCount);
110 if (s && *s) tm->typeName=strdup(s);
111 else tm->typeName=
NULL;
118 assert(tm->refCount);
119 return tm->elementName;
126 assert(tm->refCount);
127 free(tm->elementName);
128 if (s && *s) tm->elementName=strdup(s);
129 else tm->elementName=
NULL;
136 assert(tm->refCount);
144 assert(tm->refCount);
146 if (s && *s) tm->descr=strdup(s);
154 assert(tm->refCount);
162 assert(tm->refCount);
164 if (s && *s) tm->fieldId=strdup(s);
165 else tm->fieldId=
NULL;
172 assert(tm->refCount);
180 assert(tm->refCount);
182 if (s && *s) tm->enumId=strdup(s);
183 else tm->enumId=
NULL;
190 assert(tm->refCount);
198 assert(tm->refCount);
200 if (s && *s) tm->defineId=strdup(s);
201 else tm->defineId=
NULL;
208 assert(tm->refCount);
210 if (tm->flags==0 && tm->typePtr)
220 assert(tm->refCount);
228 assert(tm->refCount);
230 if (tm->setFlags==0 && tm->typePtr)
240 assert(tm->refCount);
248 assert(tm->refCount);
250 if (tm->getFlags==0 && tm->typePtr)
260 assert(tm->refCount);
268 assert(tm->refCount);
270 if (tm->dupFlags==0 && tm->typePtr)
280 assert(tm->refCount);
288 assert(tm->refCount);
290 if (tm->copyFlags==0 && tm->typePtr)
293 return tm->copyFlags;
300 assert(tm->refCount);
308 assert(tm->refCount);
320 assert(tm->refCount);
328 assert(tm->refCount);
337 assert(tm->refCount);
345 assert(tm->refCount);
347 if (tm->defaultValue==
NULL && tm->typePtr)
349 return tm->defaultValue;
356 assert(tm->refCount);
358 free(tm->defaultValue);
359 if (s) tm->defaultValue=strdup(s);
360 else tm->defaultValue=
NULL;
367 assert(tm->refCount);
369 if (tm->presetValue==
NULL && tm->typePtr)
371 return tm->presetValue;
378 assert(tm->refCount);
380 free(tm->presetValue);
381 if (s) tm->presetValue=strdup(s);
382 else tm->presetValue=
NULL;
389 assert(tm->refCount);
391 if (tm->aedb_type==
NULL && tm->typePtr)
394 return tm->aedb_type;
401 assert(tm->refCount);
404 if (s) tm->aedb_type=strdup(s);
405 else tm->aedb_type=
NULL;
412 assert(tm->refCount);
420 assert(tm->refCount);
428 assert(tm->refCount);
436 assert(tm->refCount);
444 assert(tm->refCount);
445 return tm->definePtr;
452 assert(tm->refCount);
460 assert(tm->refCount);
468 assert(tm->refCount);
476 assert(tm->refCount);
477 return tm->memberPosition;
484 assert(tm->refCount);
485 tm->memberPosition=i;
492 assert(tm->refCount);
504 assert(tm->refCount);
538 if (1==sscanf(s,
"%i", &i))
636 Typemaker2_Code_List_Add(tc, tm->codeDefs);
652 for (i=0; i<indent; i++) fprintf(f,
" ");
653 fprintf(f,
"Member\n");
655 for (i=0; i<indent+2; i++) fprintf(f,
" ");
656 fprintf(f,
"Name : %s\n", (tm->name)?(tm->name):
"<null>");
658 for (i=0; i<indent+2; i++) fprintf(f,
" ");
659 fprintf(f,
"Typename : %s\n", (tm->typeName)?(tm->typeName):
"<null>");
661 for (i=0; i<indent+2; i++) fprintf(f,
" ");
662 fprintf(f,
"Elementname : %s\n", (tm->elementName)?(tm->elementName):
"<null>");
664 for (i=0; i<indent+2; i++) fprintf(f,
" ");
665 fprintf(f,
"Field Id : %s\n", (tm->fieldId)?(tm->fieldId):
"<null>");
667 for (i=0; i<indent+2; i++) fprintf(f,
" ");
670 for (i=0; i<indent+2; i++) fprintf(f,
" ");
673 for (i=0; i<indent+2; i++) fprintf(f,
" ");
676 for (i=0; i<indent+2; i++) fprintf(f,
" ");
679 for (i=0; i<indent+2; i++) fprintf(f,
" ");
682 for (i=0; i<indent+2; i++) fprintf(f,
" ");
685 fprintf(f,
"Default : %s [%s]\n", s1?s1:
"<null>", s2?s2:
"<null>");
687 for (i=0; i<indent+2; i++) fprintf(f,
" ");
690 fprintf(f,
"Preset : %s [%s]\n", s1?s1:
"<null>", s2?s2:
"<null>");
692 for (i=0; i<indent+2; i++) fprintf(f,
" ");
693 fprintf(f,
"Position : %d\n", tm->memberPosition);
695 for (i=0; i<indent+2; i++) fprintf(f,
" ");
696 fprintf(f,
"Description : %s\n", (tm->descr)?(tm->descr):
"<null>");
const char * Typemaker2_Member_GetTypeName(const TYPEMAKER2_MEMBER *tm)
int Typemaker2_Type_GetAccess(const TYPEMAKER2_TYPE *ty)
void Typemaker2_Member_SetDescription(TYPEMAKER2_MEMBER *tm, const char *s)
void Typemaker2_Member_SetTypeName(TYPEMAKER2_MEMBER *tm, const char *s)
void Typemaker2_Member_SetName(TYPEMAKER2_MEMBER *tm, const char *s)
TYPEMAKER2_TYPE * Typemaker2_Member_GetTypePtr(const TYPEMAKER2_MEMBER *tm)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
uint32_t Typemaker2_Member_GetFlags(const TYPEMAKER2_MEMBER *tm)
void Typemaker2_Code_SetMemberFlagsMaskInt(TYPEMAKER2_CODE *p_struct, uint32_t p_src)
TYPEMAKER2_DEFINE * Typemaker2_Member_GetDefinePtr(const TYPEMAKER2_MEMBER *tm)
GWENHYWFAR_API int GWEN_XMLNode_toBuffer(const GWEN_XMLNODE *n, GWEN_BUFFER *buf, uint32_t flags)
#define GWEN_XML_FLAGS_SIMPLE
const char * GWEN_XMLNode_GetProperty(const GWEN_XMLNODE *n, const char *name, const char *defaultValue)
const char * Typemaker2_Member_GetFieldId(const TYPEMAKER2_MEMBER *tm)
const char * Typemaker2_Type_GetAqDbType(const TYPEMAKER2_TYPE *ty)
void Typemaker2_Member_SetDupFlags(TYPEMAKER2_MEMBER *tm, uint32_t i)
GWEN_XMLNODE * GWEN_XMLNode_FindNextTag(const GWEN_XMLNODE *n, const char *tname, const char *pname, const char *pvalue)
const char * Typemaker2_Code_GetMemberFlagsMask(const TYPEMAKER2_CODE *p_struct)
TYPEMAKER2_MEMBER * Typemaker2_Member_new()
TYPEMAKER2_ENUM * Typemaker2_Member_GetEnumPtr(const TYPEMAKER2_MEMBER *tm)
void Typemaker2_Member_SetSetFlags(TYPEMAKER2_MEMBER *tm, uint32_t i)
void Typemaker2_Member_SetMaxLen(TYPEMAKER2_MEMBER *tm, int i)
const char * Typemaker2_Member_GetDescription(const TYPEMAKER2_MEMBER *tm)
#define GWEN_FREE_OBJECT(varname)
const char * Typemaker2_Member_GetAqDbType(const TYPEMAKER2_MEMBER *tm)
void Typemaker2_Member_free(TYPEMAKER2_MEMBER *tm)
void Typemaker2_Member_SetFieldId(TYPEMAKER2_MEMBER *tm, const char *s)
struct TYPEMAKER2_GROUP TYPEMAKER2_GROUP
uint32_t Typemaker2_Type_GetSetFlags(const TYPEMAKER2_TYPE *ty)
const char * Typemaker2_Code_GetMemberFlagsValue(const TYPEMAKER2_CODE *p_struct)
uint32_t Typemaker2_Member_GetGetFlags(const TYPEMAKER2_MEMBER *tm)
struct TYPEMAKER2_DEFINE TYPEMAKER2_DEFINE
struct TYPEMAKER2_ENUM TYPEMAKER2_ENUM
uint32_t Typemaker2_Type_GetCopyFlags(const TYPEMAKER2_TYPE *ty)
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
int Typemaker2_Member_GetMaxLen(const TYPEMAKER2_MEMBER *tm)
void Typemaker2_Member_Dump(TYPEMAKER2_MEMBER *tm, FILE *f, int indent)
const char * Typemaker2_Type_GetPresetValue(const TYPEMAKER2_TYPE *ty)
const char * Typemaker2_Member_GetDefineId(const TYPEMAKER2_MEMBER *tm)
void Typemaker2_Member_SetDefineId(TYPEMAKER2_MEMBER *tm, const char *s)
const char * Typemaker2_Member_GetPresetValue(const TYPEMAKER2_MEMBER *tm)
#define GWEN_ERROR_BAD_DATA
GWEN_XMLNODE * GWEN_XMLNode_FindFirstTag(const GWEN_XMLNODE *n, const char *tname, const char *pname, const char *pvalue)
int Typemaker2_Member_GetAccess(const TYPEMAKER2_MEMBER *tm)
#define GWEN_NEW_OBJECT(typ, varname)
void Typemaker2_Member_SetGroupPtr(TYPEMAKER2_MEMBER *tm, TYPEMAKER2_GROUP *gr)
const char * GWEN_XMLNode_GetCharValue(const GWEN_XMLNODE *n, const char *name, const char *defValue)
void Typemaker2_Member_SetCopyFlags(TYPEMAKER2_MEMBER *tm, uint32_t i)
void Typemaker2_Member_SetEnumPtr(TYPEMAKER2_MEMBER *tm, TYPEMAKER2_ENUM *te)
int Typemaker2_Member_GetMemberPosition(const TYPEMAKER2_MEMBER *tm)
uint32_t Typemaker2_FlagsFromString(const char *t)
void Typemaker2_Member_SetGetFlags(TYPEMAKER2_MEMBER *tm, uint32_t i)
int Typemaker2_AccessFromString(const char *s)
TYPEMAKER2_CODE_LIST * Typemaker2_Member_GetCodeDefs(const TYPEMAKER2_MEMBER *tm)
void Typemaker2_Member_SetAccess(TYPEMAKER2_MEMBER *tm, int i)
void Typemaker2_Member_SetDefaultValue(TYPEMAKER2_MEMBER *tm, const char *s)
uint32_t Typemaker2_Type_GetDupFlags(const TYPEMAKER2_TYPE *ty)
void Typemaker2_Member_Attach(TYPEMAKER2_MEMBER *tm)
TYPEMAKER2_CODE * Typemaker2_Code_fromXml(GWEN_XMLNODE *p_db)
uint32_t Typemaker2_Member_GetDupFlags(const TYPEMAKER2_MEMBER *tm)
void Typemaker2_Member_SetTypePtr(TYPEMAKER2_MEMBER *tm, TYPEMAKER2_TYPE *ty)
int Typemaker2_Member_readXml(TYPEMAKER2_MEMBER *tm, GWEN_XMLNODE *node, const char *wantedLang)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
const char * Typemaker2_Member_GetDefaultValue(const TYPEMAKER2_MEMBER *tm)
#define GWEN_XML_FLAGS_HANDLE_COMMENTS
#define DBG_ERROR(dbg_logger, format, args...)
struct TYPEMAKER2_TYPE TYPEMAKER2_TYPE
uint32_t Typemaker2_Member_GetCopyFlags(const TYPEMAKER2_MEMBER *tm)
uint32_t Typemaker2_Type_GetGetFlags(const TYPEMAKER2_TYPE *ty)
void Typemaker2_Member_SetFlags(TYPEMAKER2_MEMBER *tm, uint32_t i)
void Typemaker2_Code_SetMemberFlagsValueInt(TYPEMAKER2_CODE *p_struct, uint32_t p_src)
TYPEMAKER2_GROUP * Typemaker2_Member_GetGroupPtr(const TYPEMAKER2_MEMBER *tm)
#define GWEN_LIST_INIT(t, element)
void Typemaker2_Member_SetDefinePtr(TYPEMAKER2_MEMBER *tm, TYPEMAKER2_DEFINE *td)
const char * Typemaker2_Member_GetEnumId(const TYPEMAKER2_MEMBER *tm)
struct TYPEMAKER2_MEMBER TYPEMAKER2_MEMBER
struct TYPEMAKER2_CODE TYPEMAKER2_CODE
uint32_t Typemaker2_Member_GetSetFlags(const TYPEMAKER2_MEMBER *tm)
#define GWEN_LIST_FUNCTIONS(t, pr)
void Typemaker2_Member_SetMemberPosition(TYPEMAKER2_MEMBER *tm, int i)
const char * Typemaker2_Member_GetElementName(const TYPEMAKER2_MEMBER *tm)
void Typemaker2_Member_SetAqDbType(TYPEMAKER2_MEMBER *tm, const char *s)
void Typemaker2_Member_SetPresetValue(TYPEMAKER2_MEMBER *tm, const char *s)
uint32_t Typemaker2_Type_GetFlags(const TYPEMAKER2_TYPE *ty)
const char * Typemaker2_Type_GetDefaultValue(const TYPEMAKER2_TYPE *ty)
const char * Typemaker2_Member_GetName(const TYPEMAKER2_MEMBER *tm)
#define GWEN_LIST_FINI(t, element)
void Typemaker2_Member_SetEnumId(TYPEMAKER2_MEMBER *tm, const char *s)
void Typemaker2_Member_SetElementName(TYPEMAKER2_MEMBER *tm, const char *s)
struct GWEN__XMLNODE GWEN_XMLNODE