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

Function ILAPIENTRY ilRegisterSave

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

Source from the content-addressed store, hash-verified

57
58
59ILboolean ILAPIENTRY ilRegisterSave(ILconst_string Ext, IL_SAVEPROC Save)
60{
61 iFormatS *TempNode, *NewNode;
62
63 TempNode = SaveProcs;
64 if (TempNode != NULL) {
65 while (TempNode->Next != NULL) {
66 TempNode = TempNode->Next;
67 if (!iStrCmp(TempNode->Ext, Ext)) { // already registered
68 return IL_TRUE;
69 }
70 }
71 }
72
73 NewNode = (iFormatS*)ialloc(sizeof(iFormatL));
74 if (NewNode == NULL) {
75 return IL_FALSE;
76 }
77
78 if (SaveProcs == NULL) {
79 SaveProcs = NewNode;
80 }
81 else {
82 TempNode->Next = NewNode;
83 }
84
85 NewNode->Ext = ilStrDup(Ext);
86 NewNode->Save = Save;
87 NewNode->Next = NULL;
88
89 return IL_TRUE;
90}
91
92
93//! Unregisters a load extension - doesn't have to be called.

Callers

nothing calls this directly

Calls 2

iStrCmpFunction · 0.85
ilStrDupFunction · 0.85

Tested by

no test coverage detected