summaryrefslogtreecommitdiff
path: root/include/mupdf/fitz/context.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-01-03 15:11:33 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-01-04 13:15:42 +0100
commit2d5b4683e912d6e6e1f1e2ca5aa0297beb3e6807 (patch)
treede2343f1280afd1ae32a1b8d7805a42f0fc5f8e7 /include/mupdf/fitz/context.h
parenta292539cc9e5e91843d48e691038d9c1b529422c (diff)
downloadmupdf-2d5b4683e912d6e6e1f1e2ca5aa0297beb3e6807.tar.xz
Add portable pseudo-random number generator based on the lrand48 family.
Diffstat (limited to 'include/mupdf/fitz/context.h')
-rw-r--r--include/mupdf/fitz/context.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h
index 5a88433f..caa22977 100644
--- a/include/mupdf/fitz/context.h
+++ b/include/mupdf/fitz/context.h
@@ -161,6 +161,7 @@ struct fz_context_s
fz_tuning_context *tuning;
fz_document_handler_context *handler;
fz_output_context *output;
+ uint16_t seed48[7];
};
/*
@@ -563,4 +564,23 @@ extern fz_alloc_context fz_alloc_default;
/* Default locks */
extern fz_locks_context fz_locks_default;
+/*
+ Pseudo-random numbers using a linear congruential algorithm and 48-bit
+ integer arithmetic.
+*/
+double fz_drand48(fz_context *ctx);
+int32_t fz_lrand48(fz_context *ctx);
+int32_t fz_mrand48(fz_context *ctx);
+double fz_erand48(fz_context *ctx, uint16_t xsubi[3]);
+int32_t fz_jrand48(fz_context *ctx, uint16_t xsubi[3]);
+int32_t fz_nrand48(fz_context *ctx, uint16_t xsubi[3]);
+void fz_lcong48(fz_context *ctx, uint16_t param[7]);
+uint16_t *fz_seed48(fz_context *ctx, uint16_t seed16v[3]);
+void fz_srand48(fz_context *ctx, int32_t seedval);
+
+/*
+ fz_memrnd: Fill block with len bytes of pseudo-randomness.
+*/
+void fz_memrnd(fz_context *ctx, uint8_t *block, int len);
+
#endif