Changeset 5010:065b9de0acf7 in roaraudio
- Timestamp:
- 05/26/11 09:26:00 (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r4998 r5010 1 1 v. 0.4beta7 - ? 2 2 * Updated roar_panic() (Closes: #132) 3 * Updated roar_reset() (Closes: #131) 3 4 4 5 v. 0.4beta6 - Mon May 23 2011 19:49 CEST -
include/libroar/config.h
r4779 r5010 109 109 struct roar_libroar_config * roar_libroar_get_config(void); 110 110 111 int roar_libroar_reset_config(void); 112 111 113 int roar_libroar_config_parse(char * txt, char * delm); 112 114 -
include/libroar/libroar.h
r4998 r5010 201 201 202 202 // call this function after we fork/exec()ed or similar. 203 int roar_reset(int forked); 203 enum roar_reset { 204 ROAR_RESET_UNKNOWN = -1, 205 #define ROAR_RESET_UNKNOWN ROAR_RESET_UNKNOWN 206 ROAR_RESET_NONE = 0, 207 #define ROAR_RESET_NONE ROAR_RESET_NONE 208 ROAR_RESET_ON_FORK = 1, 209 #define ROAR_RESET_ON_FORK ROAR_RESET_ON_FORK 210 ROAR_RESET_ON_EXIT = 2, 211 #define ROAR_RESET_ON_EXIT ROAR_RESET_ON_EXIT 212 ROAR_RESET_ON_PRE_EXEC = 3, 213 #define ROAR_RESET_ON_PRE_EXEC ROAR_RESET_ON_PRE_EXEC 214 ROAR_RESET_MEMORY = 0x81, 215 #define ROAR_RESET_MEMORY ROAR_RESET_MEMORY 216 ROAR_RESET_CONFIG = 0x82, 217 #define ROAR_RESET_CONFIG ROAR_RESET_CONFIG 218 ROAR_RESET_RANDOMPOOL = 0x84, 219 #define ROAR_RESET_RANDOMPOOL ROAR_RESET_RANDOMPOOL 220 ROAR_RESET_EOL = -2 221 #define ROAR_RESET_EOL ROAR_RESET_EOL 222 }; 223 int roar_reset(enum roar_reset what); 204 224 205 225 // fatal probelms: -
include/libroar/memmgr.h
r5003 r5010 48 48 // those functions are currently not implemeted: 49 49 50 int roar_mm_reset(void); 51 50 52 ssize_t roar_mm_sizeof(void * buf); 51 53 … … 61 63 62 64 #else 65 #define roar_mm_reset() (0) 63 66 #define roar_mm_sizeof(ptr) ((ssize_t)-1) 64 67 #define roar_mm_calloc(nmemb, size) calloc((nmemb), (size)) -
include/libroar/roarfeatures.h
r4998 r5010 47 47 #define ROAR_FT_FUNC_SIMPLE_CONNECT2 48 48 #define ROAR_FT_FUNC_PANIC 49 #define ROAR_FT_FUNC_RESET 49 50 #define ROAR_FT_FEATURE_VS 50 51 #define ROAR_FT_FEATURE_VS_FILE -
libroar/config.c
r5006 r5010 84 84 85 85 return config; 86 } 87 88 int roar_libroar_reset_config(void) { 89 struct roar_libroar_config * config = roar_libroar_get_config_ptr(); 90 91 if ( config->codecs.codec != NULL ) { 92 roar_mm_free(config->codecs.codec); 93 config->codecs.num = 0; 94 } 95 96 return 0; 86 97 } 87 98 -
libroar/libroar.c
r4998 r5010 146 146 } 147 147 148 int roar_reset( int forked) {148 int roar_reset(enum roar_reset what) { 149 149 char c; 150 150 int i; 151 enum roar_reset subsets = ROAR_RESET_NONE; 151 152 152 153 roar_err_set(ROAR_ERROR_NONE); 153 154 154 for (i = 0; i < 16; i++) { 155 roar_random_gen_nonce(&c, 1); 156 roar_random_uint16(); 157 roar_random_uint32(); 158 } 159 155 switch (what) { 156 case ROAR_RESET_NONE: 157 return 0; 158 break; 159 case ROAR_RESET_UNKNOWN: 160 case ROAR_RESET_EOL: 161 roar_err_set(ROAR_ERROR_INVAL); 162 return -1; 163 break; 164 case ROAR_RESET_ON_FORK: 165 subsets |= ROAR_RESET_MEMORY|ROAR_RESET_RANDOMPOOL; 166 break; 167 case ROAR_RESET_ON_EXIT: 168 case ROAR_RESET_ON_PRE_EXEC: 169 subsets |= ROAR_RESET_MEMORY|ROAR_RESET_CONFIG; 170 break; 171 default: 172 if ( what & 0x80 ) { 173 subsets |= what; 174 } else { 175 roar_err_set(ROAR_ERROR_INVAL); 176 return -1; 177 } 178 break; 179 } 180 181 // strip 0x80 so we can easly test on the other bit per subsystem. 182 what |= 0x80; 183 what -= 0x80; 184 185 if ( what & ROAR_RESET_MEMORY ) { 186 roar_mm_reset(); 187 } 188 189 if ( what & ROAR_RESET_CONFIG ) { 190 roar_libroar_reset_config(); 191 } 192 193 if ( what & ROAR_RESET_RANDOMPOOL ) { 194 for (i = 0; i < 16; i++) { 195 roar_random_gen_nonce(&c, 1); 196 roar_random_uint16(); 197 roar_random_uint32(); 198 } 199 } 200 201 roar_err_set(ROAR_ERROR_NONE); 160 202 return 0; 161 203 } -
libroar/memmgr.c
r5002 r5010 50 50 51 51 #ifdef ROAR_USE_MEMMGR 52 53 int roar_mm_reset(void) { 54 // currently this does nothing. 55 // we need to free pools and such here later. 56 return 0; 57 } 58 52 59 ssize_t roar_mm_sizeof(void * buf) { 53 60 if ( buf == NULL ) {
Note: See TracChangeset
for help on using the changeset viewer.