option(MINIAUDIO_BUILD_TOOLS "Build miniaudio development tools. Leave this disabled unless you know what you're doing. If you enable this and you get build errors, you clearly do not know what you're doing and yet you still enabled this option. Why would you do that?" OFF)
option(MINIAUDIO_FORCE_CXX "Force compilation as C++" OFF)
option(MINIAUDIO_FORCE_CXX "Force compilation as C++" OFF)
option(MINIAUDIO_FORCE_C89 "Force compilation as C89" OFF)
option(MINIAUDIO_FORCE_C89 "Force compilation as C89" OFF)
option(MINIAUDIO_NO_EXTRA_NODES "Do not build extra node graph nodes" OFF)
option(MINIAUDIO_NO_EXTRA_NODES "Do not build extra node graph nodes" OFF)
...
@@ -811,6 +812,15 @@ if (MINIAUDIO_BUILD_EXAMPLES)
...
@@ -811,6 +812,15 @@ if (MINIAUDIO_BUILD_EXAMPLES)
size_ttextLen;/* Set to (size_t)-1 for null terminated. */
size_ttextOff;/* The cursor. */
doc_token_typetoken;
constchar*pTokenStr;
size_ttokenLen;
size_theaderLevel;
size_tindentation;/* Useful for knowing how to offset code. Code tags can be indented and we want to know how deep the base level of indentation is. */
if(pIterator->info.size>0){/* Ignore any empty files. Sometimes I'll put placeholder files in the examples folder to keep track of ideas for examples. */
/* Data is extracted from miniaudio.h, so we'll need to get that loaded as a start. */
miniaudio=load_file("miniaudio.h");
if(miniaudio==NULL){
printf("Failed to load miniaudio.h");
return-1;
}
result=load_manual(miniaudio,pState);
if(result!=0){
printf("Failed to load manual.");
returnresult;
}
result=load_examples(pState);
if(result!=0){
printf("Failed to load examples.");
returnresult;
}
result=load_api(miniaudio,pState);
if(result!=0){
printf("Failed to load API.");
returnresult;
}
/* We're done. */
c89str_delete(miniaudio,NULL);
return0;
}
c89strraw_to_html(c89strraw);
c89strtransform_inline_code(c89strhtml)
{
size_toffset=0;
/*
To do this we just need to find the next grave character. Then the content between that and the following grave needs to be wrapped in a <span></span> tag
/* This is similar to inline code segments, except out opening token is "http://" or "https://" and ends with */
html=transform_urls_by_protocol(html,"https://");
html=transform_urls_by_protocol(html,"http://");
returnhtml;
}
c89strescape_html(constchar*pHTML,size_tlen)
{
c89strhtml=c89str_newn(NULL,pHTML,len);
/* Slow, but it's simple and it works. */
html=c89str_replace_all(html,NULL,"&",(size_t)-1,"&",(size_t)-1);/* <-- This must come first to ensure it doesn't replace the "&" symbols used in the escapes before it. */
/* We want to keep <br> tags unescaped. This is not a good way to do this, but it works well enough for now since we won't in practice have this string in our documentation. */
There's two ways to generate define the rows in a table. The first is just one line equals one row. The other uses a separator to define the rows. To distinguish
between the two we just need to count how many separators there are in the table. If there is 3, we can use the one line technique.
html=c89str_cat(html,NULL,extract_example_summary(pState->examples.examples[iExample].code));// example_name_to_display(pState->examples.examples[iExample].name)); /* TODO: Change this to the summary. */