OS_NS_stdio.cpp File Reference

#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_Thread.h"

Include dependency graph for OS_NS_stdio.cpp:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

ACE_END_VERSIONED_NAMESPACE_DECL
BOOL WINAPI 
DllMain (HINSTANCE instance, DWORD reason, LPVOID)
void fopen_mode_to_open_mode_converter (ACE_TCHAR x, int &hmode)


Function Documentation

ACE_END_VERSIONED_NAMESPACE_DECL BOOL WINAPI DllMain HINSTANCE  instance,
DWORD  reason,
LPVOID 
 

Definition at line 25 of file OS_NS_stdio.cpp.

References ACE_OS::cleanup_tss(), and ACE_OS::set_win32_resource_module().

00026 {
00027   if (reason == DLL_PROCESS_ATTACH)
00028     {
00029 #     if defined (ACE_DISABLES_THREAD_LIBRARY_CALLS) && (ACE_DISABLES_THREAD_LIBRARY_CALLS == 1)
00030       ::DisableThreadLibraryCalls (instance);
00031 #     endif /* ACE_DISABLES_THREAD_LIBRARY_CALLS */
00032       ACE_OS::set_win32_resource_module(instance);
00033     }
00034   else if (reason == DLL_THREAD_DETACH)
00035     {
00036       ACE_OS::cleanup_tss (0);
00037     }
00038   return TRUE;
00039 }

void fopen_mode_to_open_mode_converter ACE_TCHAR  x,
int &  hmode
[static]
 

Translate fopen's mode char to open's mode. This helper function is here to avoid maintaining several pieces of identical code.

Definition at line 120 of file OS_NS_stdio.cpp.

References _O_BINARY, _O_TEXT, ACE_BIT_DISABLED, ACE_CLR_BITS, ACE_SET_BITS, ACE_TCHAR, and ACE_TEXT.

Referenced by ACE_OS::fopen().

00121   {
00122     switch (x)
00123       {
00124       case ACE_TEXT ('r'):
00125         if (ACE_BIT_DISABLED (hmode, _O_RDWR))
00126           {
00127             ACE_CLR_BITS (hmode, _O_WRONLY);
00128             ACE_SET_BITS (hmode, _O_RDONLY);
00129           }
00130         break;
00131       case ACE_TEXT ('w'):
00132         if (ACE_BIT_DISABLED (hmode, _O_RDWR))
00133           {
00134             ACE_CLR_BITS (hmode, _O_RDONLY);
00135             ACE_SET_BITS (hmode, _O_WRONLY);
00136           }
00137         ACE_SET_BITS (hmode, _O_CREAT | _O_TRUNC);
00138         break;
00139       case ACE_TEXT ('a'):
00140         if (ACE_BIT_DISABLED (hmode, _O_RDWR))
00141           {
00142             ACE_CLR_BITS (hmode, _O_RDONLY);
00143             ACE_SET_BITS (hmode, _O_WRONLY);
00144           }
00145         ACE_SET_BITS (hmode, _O_CREAT | _O_APPEND);
00146         break;
00147       case ACE_TEXT ('+'):
00148         ACE_CLR_BITS (hmode, _O_RDONLY | _O_WRONLY);
00149         ACE_SET_BITS (hmode, _O_RDWR);
00150         break;
00151       case ACE_TEXT ('t'):
00152         ACE_CLR_BITS (hmode, _O_BINARY);
00153         ACE_SET_BITS (hmode, _O_TEXT);
00154         break;
00155       case ACE_TEXT ('b'):
00156         ACE_CLR_BITS (hmode, _O_TEXT);
00157         ACE_SET_BITS (hmode, _O_BINARY);
00158         break;
00159       }
00160   }


Generated on Sun Jan 27 12:36:07 2008 for ACE by doxygen 1.3.6