Free Hero Mesh

Check-in [0c771447b3]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Add ':s' for memory allocation stats and change binding.doc to make some improvements
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0c771447b3fcc506281a5714b7a6b53fb7f32ba4
User & Date: user on 2020-12-21 22:26:50
Other Links: manifest | tags
Context
2020-12-21
23:44
Change some variables from 8-bits to 16-bits for better compatibility with Hero Mesh check-in: 418cb4cce0 user: user tags: trunk
22:26
Add ':s' for memory allocation stats and change binding.doc to make some improvements check-in: 0c771447b3 user: user tags: trunk
22:11
More corrections in the compile script check-in: c7bc4e8681 user: user tags: trunk
Changes

Modified bindings.c from [603365f23b] to [f38d387928].

1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
#if 0
gcc ${CFLAGS:--s -O2} -c -Wno-multichar bindings.c `sdl-config --cflags`
exit
#endif

/*
  This program is part of Free Hero Mesh and is public domain.
*/

#define HEROMESH_BINDINGS

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
#include "sqlite3.h"
#include "smallxrm.h"
#include "quarks.h"










>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#if 0
gcc ${CFLAGS:--s -O2} -c -Wno-multichar bindings.c `sdl-config --cflags`
exit
#endif

/*
  This program is part of Free Hero Mesh and is public domain.
*/

#define HEROMESH_BINDINGS
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
#include "sqlite3.h"
#include "smallxrm.h"
#include "quarks.h"
269
270
271
272
273
274
275

276
277
278
279
280
281
282
          if((name=sqlite3_column_text(cmd->stmt,0)) && *name) {
            if(name[0]==':') {
              switch(name[1]) {
                case '!': if(i>1) i=system(sqlite3_column_text(cmd->stmt,1)?:(const unsigned char*)"# "); break;
                case ';': i=SQLITE_DONE; goto done;
                case '?': if(i>1) puts(sqlite3_column_text(cmd->stmt,1)?:(const unsigned char*)"(null)"); break;
                case 'm': if(i>1) screen_message(sqlite3_column_text(cmd->stmt,1)?:(const unsigned char*)"(null)"); break;

                case 'x': sql_interactive(); break;
              }
            } else {
              k=name[0]*'\1\0'+name[1]*'\0\1';
              while(i && sqlite3_column_type(cmd->stmt,i-1)==SQLITE_NULL) i--;
              prev=cb(prev,k,j,i,cmd->stmt,aux);
              if(prev<0) {







>







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
          if((name=sqlite3_column_text(cmd->stmt,0)) && *name) {
            if(name[0]==':') {
              switch(name[1]) {
                case '!': if(i>1) i=system(sqlite3_column_text(cmd->stmt,1)?:(const unsigned char*)"# "); break;
                case ';': i=SQLITE_DONE; goto done;
                case '?': if(i>1) puts(sqlite3_column_text(cmd->stmt,1)?:(const unsigned char*)"(null)"); break;
                case 'm': if(i>1) screen_message(sqlite3_column_text(cmd->stmt,1)?:(const unsigned char*)"(null)"); break;
                case 's': malloc_stats(); fprintf(stderr,"SQLite memory use: %lld %lld\n",(long long)sqlite3_memory_used(),(long long)sqlite3_memory_highwater(1)); break;
                case 'x': sql_interactive(); break;
              }
            } else {
              k=name[0]*'\1\0'+name[1]*'\0\1';
              while(i && sqlite3_column_type(cmd->stmt,i-1)==SQLITE_NULL) i--;
              prev=cb(prev,k,j,i,cmd->stmt,aux);
              if(prev<0) {

Modified bindings.doc from [0aa5695774] to [29b885bccc].

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
















77
78
79
80
81
82
83
84
85
86
87
88
89
90
91



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
'= ' <count>
  Restart and replay that many moves.

'^T'
  Display the level title popup.

'^d' <location>
  Display the help text of the object at the location.

'^o' <location>
  List objects at the specified coordinates.


=== Editor commands ===

'^c'
  Display the class selection menu.


















=== Mode-independent commands ===

':!' <command>
  Execute a system command.

':;'
  Ignore the rest of the result rows of this SQL statement.

':?' <text>
  Write text to stdout.

':m' <text>
  Display text on the screen, wait to push enter to continue.




':x'
  Ask for a SQL statement, execute it, and display the results.

'^E'
  Switch to the editor.

'^P'
  Switch to the game play.

'^Q'
  Quit.

'go' <level>
  Go to the specified level. If the level number is negative, then it is
  a level order number, otherwise it is a level ID number.








|


|







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>















>
>
>



<
<
<
<
<
<
<
<
<
<
<
<
<
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113













'= ' <count>
  Restart and replay that many moves.

'^T'
  Display the level title popup.

'^d' <location>
  Display the pop-up help text of the object at the location.

'^o' <location>
  List objects at the specified coordinates, to examine their values.


=== Editor commands ===

'^c'
  Display the class selection menu.


=== Commands available in game and editor ===

'^E'
  Switch to the editor.

'^P'
  Switch to the game play.

'^Q'
  Quit.

'go' <level>
  Go to the specified level. If the level number is negative, then it is
  a level order number, otherwise it is a level ID number.


=== Mode-independent commands ===

':!' <command>
  Execute a system command.

':;'
  Ignore the rest of the result rows of this SQL statement.

':?' <text>
  Write text to stdout.

':m' <text>
  Display text on the screen, wait to push enter to continue.

':s'
  Write memory allocation status to stderr.

':x'
  Ask for a SQL statement, execute it, and display the results.