]> Nishi Git Mirror - libw3.git/commitdiff
w3b render_site
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Mon, 29 Jan 2024 00:19:14 +0000 (00:19 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Mon, 29 Jan 2024 00:19:14 +0000 (00:19 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@126 d27a3e52-49c5-7645-884c-6793ebffc270

Example/w3b/w3b.c

index d01f1203fcb10121915f185f02cd3527208c692b..6efda10973b9e14761fbcd26d518574e8ec7be39 100644 (file)
@@ -93,6 +93,9 @@ void access_site(const char* url) {
        }
 }
 
+void render_site(){
+}
+
 int main(int argc, char** argv) {
        int i;
        databuf = NULL;
@@ -130,8 +133,14 @@ int main(int argc, char** argv) {
        mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
        SetConsoleMode(winstdout, mode);
 #endif
+       bool rendered = false;
        clear_console();
        while(true) { /* Loop */
+               if(!rendered){
+                       clear_console();
+                       render_site();
+                       rendered = true;
+               }
                if(c != '\n' && c != '\r') {
                        printf("(O)pen, (Q)uit");
                        printf("? ");
@@ -159,6 +168,7 @@ int main(int argc, char** argv) {
                if(!acc && url != NULL) {
                        access_site(url);
                        acc = true;
+                       rendered = false;
                }
        }
        printf("\n");