💾 Archived View for gmi.noulin.net › gitRepositories › wavlTree › file › main.c.gmi captured on 2023-01-29 at 11:35:51. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

wavlTree

Log

Files

Refs

README

LICENSE

main.c (938B)

     1 #! /usr/bin/env sheepy
     2 /* or direct path to sheepy: #! /usr/local/bin/sheepy */
     3 
     4 /* Libsheepy documentation: http://spartatek.se/libsheepy/ */
     5 #include "libsheepyObject.h"
     6 #include "wavlTree.h"
     7 #include "wavlTreeNamespaceCleanup.h"
     8 
     9 int argc; char **argv;
    10 
    11 /* enable/disable logging */
    12 /* #undef pLog */
    13 /* #define pLog(...) */
    14 
    15 int main(int ARGC, char** ARGV) {
    16 
    17   argc = ARGC; argv = ARGV;
    18 
    19   initLibsheepy(ARGV[0]);
    20   setLogMode(LOG_FUNC);
    21 
    22   wavlTreet tree;
    23 
    24   wavlTreeinit(&tree);
    25 
    26   tree.put(&tree, 0, 0);
    27   tree.put(&tree, 1, 1);
    28   tree.put(&tree, 10, 10);
    29   tree.put(&tree, 5, 5);
    30 
    31   var n = tree.get(&tree, 10);
    32   logVarG(n);
    33 
    34   // tree.inOrderTraversal(tree.root);
    35   tree.iterStart(&tree, tree.getFirstEntry(&tree));
    36   wavlTreenodet *node;
    37   while(node = tree.nextEntry(&tree)) {
    38     logVarG(node->key);
    39     logVarG(node->value);
    40   }
    41 
    42   logVarG(tree.remove(&tree, 10));
    43 
    44   tree.clear(&tree);
    45 
    46 }
    47 // vim: set expandtab ts=2 sw=2: