⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apr__random_8h-source.html

📁 apr函数库使用手册
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache Portable Runtime: apr_random.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.7 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>apr_random.h</h1><pre class="fragment"><div>00001 <span class="comment">/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as</span>
00002 <span class="comment"> * applicable.</span>
00003 <span class="comment"> *</span>
00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span>
00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
00006 <span class="comment"> * You may obtain a copy of the License at</span>
00007 <span class="comment"> *</span>
00008 <span class="comment"> *     http://www.apache.org/licenses/LICENSE-2.0</span>
00009 <span class="comment"> *</span>
00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
00014 <span class="comment"> * limitations under the License.</span>
00015 <span class="comment"> */</span>
00016 
00017 <span class="preprocessor">#ifndef APR_RANDOM_H</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define APR_RANDOM_H</span>
00019 <span class="preprocessor"></span>
00020 <span class="preprocessor">#include &lt;<a class="code" href="apr__pools_8h.html">apr_pools.h</a>&gt;</span>
00021 
00022 <span class="keyword">typedef</span> <span class="keyword">struct </span>apr_crypto_hash_t apr_crypto_hash_t;
00023 
00024 <span class="keyword">typedef</span> <span class="keywordtype">void</span> apr_crypto_hash_init_t(apr_crypto_hash_t *hash);
00025 <span class="keyword">typedef</span> <span class="keywordtype">void</span> apr_crypto_hash_add_t(apr_crypto_hash_t *hash,<span class="keyword">const</span> <span class="keywordtype">void</span> *data,
00026                                    apr_size_t bytes);
00027 <span class="keyword">typedef</span> <span class="keywordtype">void</span> apr_crypto_hash_finish_t(apr_crypto_hash_t *hash,
00028                                       <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *result);
00029 
00030 <span class="comment">/* FIXME: make this opaque */</span>
00031 <span class="keyword">struct </span>apr_crypto_hash_t {
00032     apr_crypto_hash_init_t *init;
00033     apr_crypto_hash_add_t *add;
00034     apr_crypto_hash_finish_t *finish;
00035     apr_size_t size;
00036     <span class="keywordtype">void</span> *data;
00037 };
00038 
00039 APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p);
00040 
00041 typedef struct apr_random_t apr_random_t;
00042 
00043 APR_DECLARE(<span class="keywordtype">void</span>) apr_random_init(apr_random_t *g,apr_pool_t *p,
00044                                   apr_crypto_hash_t *pool_hash,
00045                                   apr_crypto_hash_t *key_hash,
00046                                   apr_crypto_hash_t *prng_hash);
00047 APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p);
00048 APR_DECLARE(<span class="keywordtype">void</span>) apr_random_add_entropy(apr_random_t *g,
00049                                          const <span class="keywordtype">void</span> *entropy_,
00050                                          apr_size_t bytes);
00051 APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g,
00052                                                     <span class="keywordtype">void</span> *random,
00053                                                     apr_size_t bytes);
00054 APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g,
00055                                                   <span class="keywordtype">void</span> *random,
00056                                                   apr_size_t bytes);
00057 APR_DECLARE(<span class="keywordtype">void</span>) apr_random_barrier(apr_random_t *g);
00058 APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r);
00059 APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r);
00060 
00061 <span class="comment">/* Call this in the child after forking to mix the randomness</span>
00062 <span class="comment">   pools. Note that its generally a bad idea to fork a process with a</span>
00063 <span class="comment">   real PRNG in it - better to have the PRNG externally and get the</span>
00064 <span class="comment">   randomness from there. However, if you really must do it, then you</span>
00065 <span class="comment">   should supply all your entropy to all the PRNGs - don't worry, they</span>
00066 <span class="comment">   won't produce the same output.</span>
00067 <span class="comment"></span>
00068 <span class="comment">   Note that apr_proc_fork() calls this for you, so only weird</span>
00069 <span class="comment">   applications need ever call it themselves.</span>
00070 <span class="comment">*/</span>
00071 struct <a class="code" href="structapr__proc__t.html">apr_proc_t</a>;
00072 APR_DECLARE(<span class="keywordtype">void</span>) apr_random_after_fork(struct apr_proc_t *proc);
00073 
00074 #endif <span class="comment">/* ndef APR_RANDOM_H */</span>
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Mon Feb 7 13:18:25 2005 for Apache Portable Runtime by
<a href="../../../www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -