aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c')
-rw-r--r--src/c/urweb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 09514afa..8ecef7c5 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -476,6 +476,9 @@ struct uw_context {
char *output_buffer;
size_t output_buffer_size;
+
+ // For caching.
+ char *recording;
};
size_t uw_headers_max = SIZE_MAX;
@@ -559,6 +562,8 @@ uw_context uw_init(int id, uw_loggers *lg) {
ctx->output_buffer = malloc(1);
ctx->output_buffer_size = 1;
+ ctx->recording = 0;
+
return ctx;
}
@@ -1666,6 +1671,14 @@ void uw_write(uw_context ctx, const char* s) {
*ctx->page.front = 0;
}
+void uw_recordingStart(uw_context ctx) {
+ ctx->recording = ctx->page.front;
+}
+
+char *uw_recordingRead(uw_context ctx) {
+ return strdup(ctx->recording);
+}
+
char *uw_Basis_attrifyInt(uw_context ctx, uw_Basis_int n) {
char *result;
int len;