Fossil

Check-in [dc3c8ac3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added incr as built-in function.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | th1-query-api
Files: files | file ages | folders
SHA1:dc3c8ac3deb06a8f29e68435e7bf523205441433
User & Date: stephan 2012-07-15 09:20:12
Context
2012-07-15
09:23
Added push/pop as aliases for start/end in the ob API. Fixed a horrible size calculation bug which triggered an assert() for ob nesting levels deeper than 2. check-in: 9b3a11e1 user: stephan tags: th1-query-api
09:20
Added incr as built-in function. check-in: dc3c8ac3 user: stephan tags: th1-query-api
00:57
Fixed a missing NUL terminator. check-in: 66da00e9 user: stephan tags: th1-query-api
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/th_main.c.

1663
1664
1665
1666
1667
1668
1669




1670
1671
1672
1673
1674
1675
1676
#ifdef TH_USE_SQLITE
    th_register_sqlite(g.interp);
#endif
#ifdef TH_USE_ARGV
    th_register_argv(g.interp);
#endif
    Th_register_commands( g.interp, aCommand );




  }
}

/*
** Store a string value in a variable in the interpreter.
*/
void Th_Store(const char *zName, const char *zValue){







>
>
>
>







1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
#ifdef TH_USE_SQLITE
    th_register_sqlite(g.interp);
#endif
#ifdef TH_USE_ARGV
    th_register_argv(g.interp);
#endif
    Th_register_commands( g.interp, aCommand );
    Th_Eval( g.interp, 0, "proc incr {name {step 1}} {\n"
             "upvar $name x\n"
             "set x [expr $x+$step]\n"
             "}", -1 );
  }
}

/*
** Store a string value in a variable in the interpreter.
*/
void Th_Store(const char *zName, const char *zValue){