-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NL Writer C API example structure #30
Finished high-level example code
- Loading branch information
Showing
16 changed files
with
164 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
#include <stdlib.h> | ||
|
||
#include "nlsol_ex_c_nl.h" | ||
|
||
NLFeeder2_C MakeNLFeeder2_C() { | ||
NLFeeder2_C MakeNLFeeder2_C( | ||
CAPIExample* pex, int binary) { | ||
NLFeeder2_C result; | ||
|
||
result.p_user_data_ = pex; | ||
pex->binary_nl = binary; | ||
|
||
return result; | ||
} | ||
|
||
void DestroyNLFeeder2_C(NLFeeder2_C* pf) { | ||
pf->p_user_data_ = NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "nlsol_ex_c_nlutils.h" | ||
|
||
NLUtils_C MakeNLUtils_C() { | ||
// Just return the API's default config: | ||
return NLW2_MakeNLUtils_C_Default(); | ||
} | ||
|
||
void DestroyNLUtils_C(NLUtils_C* p) { | ||
NLW2_DestroyNLUtils_C_Default(p); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Custom NLUtils_C for the C API example | ||
* | ||
*/ | ||
#ifndef NLSOL_EX_C_NLUTILS_H | ||
#define NLSOL_EX_C_NLUTILS_H | ||
|
||
#include "api/c/nl-writer2-misc-c.h" | ||
|
||
/// Fill NLUtils_C for the C API example | ||
NLUtils_C MakeNLUtils_C(); | ||
|
||
/// Destroy custom NLUtils_C | ||
void DestroyNLUtils_C(NLUtils_C* ); | ||
|
||
#endif // NLSOL_EX_C_NLUTILS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
#include <stdlib.h> | ||
|
||
#include "nlsol_ex_c_sol.h" | ||
|
||
SOLHandler2_C MakeSOLHandler2_C() { | ||
SOLHandler2_C MakeSOLHandler2_C(CAPIExample* pex) { | ||
SOLHandler2_C result; | ||
|
||
result.p_user_data_ = pex; | ||
|
||
return result; | ||
} | ||
|
||
void DestroySOLHandler2_C(SOLHandler2_C* p) { | ||
p->p_user_data_ = NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.