Fossil

Check-in [2ba6587c]
Login

Check-in [2ba6587c]

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

Overview
Comment:Alternative TIP #440 implementation, based on TIP #59
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-440-alt
Files: files | file ages | folders
SHA1: 2ba6587cc531bac4e40f711619c504ebbf0b103f
User & Date: jan.nijtmans 2016-01-26 10:22:39.522
Context
2016-01-26
14:12
Redo TIP #440 alternative - again - now using the "info runtime" command. ... (Closed-Leaf check-in: 9633f6ac user: jan.nijtmans tags: tip-440-alt)
10:22
Alternative TIP #440 implementation, based on TIP #59 ... (check-in: 2ba6587c user: jan.nijtmans tags: tip-440-alt)
2016-01-21
12:44
fixed condition which caused the "Yearly total" row to not be rendered on the oldest year in the bymonth report in some cases. ... (check-in: ec3dd27f user: stephan tags: trunk)
2016-01-20
22:41
Of course, the value of "::tcl::pkgconfig get engine" should be "TH1" ... (check-in: fd00816d user: jan.nijtmans tags: tip-440-alt)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/th_lang.c.
1129
1130
1131
1132
1133
1134
1135







































1136
1137
1138
1139
1140
1141
1142
  static const Th_SubCommand aSub[] = {
    { "exists", array_exists_command },
    { "names",  array_names_command },
    { 0, 0 }
  };
  return Th_CallSubCommand(interp, ctx, argc, argv, argl, aSub);
}








































/*
** Convert the script level frame specification (used by the commands
** [uplevel] and [upvar]) in (zFrame, nFrame) to an integer frame as
** used by Th_LinkVar() and Th_Eval(). If successful, write the integer
** frame level to *piFrame and return TH_OK. Otherwise, return TH_ERROR
** and leave an error message in the interpreter result.







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







1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
  static const Th_SubCommand aSub[] = {
    { "exists", array_exists_command },
    { "names",  array_names_command },
    { 0, 0 }
  };
  return Th_CallSubCommand(interp, ctx, argc, argv, argl, aSub);
}

/*
** TH Syntax:
**
**   ::tcl::pkgconfig get KEY (TODO: replace this with real KEY) 
*/
static int pkgconfig_get_command(
  Th_Interp *interp,
  void *ctx,
  int argc,
  const char **argv,
  int *argl
){
  if( strcmp(argv[2], "KEY") ){
      Th_ErrorMessage(interp, "key not known", argv[2], argl[2]);
      return TH_ERROR;
  }
  Th_SetResult(interp, "TH1" , -1);
  return TH_OK;
}

/*
** TH Syntax:
**
**   ::tcl::pkgconfig get
*/
static int pkgconfig_command(
  Th_Interp *interp,
  void *ctx,
  int argc,
  const char **argv,
  int *argl
){
  static const Th_SubCommand aSub[] = {
    { "get", pkgconfig_get_command },
    { 0, 0 }
  };
  return Th_CallSubCommand(interp, ctx, argc, argv, argl, aSub);
}

/*
** Convert the script level frame specification (used by the commands
** [uplevel] and [upvar]) in (zFrame, nFrame) to an integer frame as
** used by Th_LinkVar() and Th_Eval(). If successful, write the integer
** frame level to *piFrame and return TH_OK. Otherwise, return TH_ERROR
** and leave an error message in the interpreter result.
1267
1268
1269
1270
1271
1272
1273


1274
1275
1276
1277
1278
1279
1280

    {"breakpoint", breakpoint_command, 0},

    {"return",   return_command, 0},
    {"break",    simple_command, (void *)TH_BREAK},
    {"continue", simple_command, (void *)TH_CONTINUE},
    {"error",    simple_command, (void *)TH_ERROR},



    {0, 0, 0}
  };
  size_t i;

  /* Add the language commands. */
  for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){







>
>







1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321

    {"breakpoint", breakpoint_command, 0},

    {"return",   return_command, 0},
    {"break",    simple_command, (void *)TH_BREAK},
    {"continue", simple_command, (void *)TH_CONTINUE},
    {"error",    simple_command, (void *)TH_ERROR},

    {"::tcl::pkgconfig",   pkgconfig_command,  0},

    {0, 0, 0}
  };
  size_t i;

  /* Add the language commands. */
  for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){