00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 00002 /* 00003 * This file is part of the LibreOffice project. 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 * 00009 * This file incorporates work covered by the following license notice: 00010 * 00011 * Licensed to the Apache Software Foundation (ASF) under one or more 00012 * contributor license agreements. See the NOTICE file distributed 00013 * with this work for additional information regarding copyright 00014 * ownership. The ASF licenses this file to you under the Apache 00015 * License, Version 2.0 (the "License"); you may not use this file 00016 * except in compliance with the License. You may obtain a copy of 00017 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 00018 */ 00019 00020 #ifndef _RTL_RANDOM_H_ 00021 #define _RTL_RANDOM_H_ 00022 00023 #include "sal/config.h" 00024 00025 #include "sal/saldllapi.h" 00026 #include "sal/types.h" 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif 00031 00032 /*======================================================================== 00033 * 00034 * rtlRandom interface. 00035 * 00036 *======================================================================*/ 00039 typedef void* rtlRandomPool; 00040 00041 00044 enum __rtl_RandomError 00045 { 00046 rtl_Random_E_None, 00047 rtl_Random_E_Argument, 00048 rtl_Random_E_Memory, 00049 rtl_Random_E_Unknown, 00050 rtl_Random_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM 00051 }; 00052 00055 typedef enum __rtl_RandomError rtlRandomError; 00056 00057 00061 SAL_DLLPUBLIC rtlRandomPool SAL_CALL rtl_random_createPool (void) SAL_THROW_EXTERN_C(); 00062 00063 00068 SAL_DLLPUBLIC void SAL_CALL rtl_random_destroyPool ( 00069 rtlRandomPool Pool 00070 ) SAL_THROW_EXTERN_C(); 00071 00072 00079 SAL_DLLPUBLIC rtlRandomError SAL_CALL rtl_random_addBytes ( 00080 rtlRandomPool Pool, 00081 const void *Buffer, 00082 sal_Size Bytes 00083 ) SAL_THROW_EXTERN_C(); 00084 00085 00092 SAL_DLLPUBLIC rtlRandomError SAL_CALL rtl_random_getBytes ( 00093 rtlRandomPool Pool, 00094 void *Buffer, 00095 sal_Size Bytes 00096 ) SAL_THROW_EXTERN_C(); 00097 00098 /*======================================================================== 00099 * 00100 * The End. 00101 * 00102 *======================================================================*/ 00103 00104 #ifdef __cplusplus 00105 } 00106 #endif 00107 00108 #endif /* _RTL_RANDOM_H_ */ 00109 00110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */