| 149 | /************************************************************************/ |
| 150 | |
| 151 | msIOContext *msIO_getHandler( FILE * fp ) |
| 152 | |
| 153 | { |
| 154 | int nThreadId = msGetThreadId(); |
| 155 | msIOContextGroup *group = io_context_list; |
| 156 | |
| 157 | msIO_Initialize(); |
| 158 | |
| 159 | if( group == NULL || group->thread_id != nThreadId ) |
| 160 | { |
| 161 | group = msIO_GetContextGroup(); |
| 162 | if( group == NULL ) |
| 163 | return NULL; |
| 164 | } |
| 165 | |
| 166 | if( fp == stdin || fp == NULL || strcmp((const char *)fp,"stdin") == 0 ) |
| 167 | return &(group->stdin_context); |
| 168 | else if( fp == stdout || strcmp((const char *)fp,"stdout") == 0 ) |
| 169 | return &(group->stdout_context); |
| 170 | else if( fp == stderr || strcmp((const char *)fp,"stderr") == 0 ) |
| 171 | return &(group->stderr_context); |
| 172 | else |
| 173 | return NULL; |
| 174 | } |
| 175 | |
| 176 | /************************************************************************/ |
| 177 | /* msIO_installHandlers() */ |
no test coverage detected