MCPcopy Create free account
hub / github.com/DentonW/DevIL / ILAPIENTRY ilRegisterLoad

Function ILAPIENTRY ilRegisterLoad

DevIL/src-IL/src/il_register.cpp:26–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26ILboolean ILAPIENTRY ilRegisterLoad(ILconst_string Ext, IL_LOADPROC Load) {
27 iFormatL *TempNode, *NewNode;
28
29 TempNode = LoadProcs;
30 if (TempNode != NULL) {
31 while (TempNode->Next != NULL) {
32 TempNode = TempNode->Next;
33 if (!iStrCmp(TempNode->Ext, Ext)) { // already registered
34 return IL_TRUE;
35 }
36 }
37 }
38
39 NewNode = (iFormatL*)ialloc(sizeof(iFormatL));
40 if (NewNode == NULL) {
41 return IL_FALSE;
42 }
43
44 if (LoadProcs == NULL) {
45 LoadProcs = NewNode;
46 }
47 else {
48 TempNode->Next = NewNode;
49 }
50
51 NewNode->Ext = ilStrDup(Ext);
52 NewNode->Load = Load;
53 NewNode->Next = NULL;
54
55 return IL_TRUE;
56}
57
58
59ILboolean ILAPIENTRY ilRegisterSave(ILconst_string Ext, IL_SAVEPROC Save)

Callers

nothing calls this directly

Calls 2

iStrCmpFunction · 0.85
ilStrDupFunction · 0.85

Tested by

no test coverage detected