Classes | Namespaces | Defines | Functions

OS_NS_stdio.h File Reference

#include "ace/config-all.h"
#include "ace/os_include/os_stdio.h"
#include "ace/os_include/os_fcntl.h"
Include dependency graph for OS_NS_stdio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ACE_OS::ace_flock_t
 OS file locking structure. More...

Namespaces

namespace  ACE_OS
 

This namespace defines an OS independent programming API that shields developers from nonportable aspects of writing efficient system programs on Win32, POSIX and other versions of UNIX, and various real-time operating systems.


Defines

#define ACE_EXPORT_MACRO   ACE_Export

Functions

void ace_clearerr_helper (FILE *stream)
int ace_fgetc_helper (FILE *fp)
int ace_fputc_helper (int ch, FILE *fp)
int ace_getc_helper (FILE *fp)
int ace_putc_helper (int ch, FILE *fp)
int ace_ungetc_helper (int ch, FILE *fp)
ACE_HANDLE ace_fileno_helper (FILE *fp)
char * ace_cuserid (char *user)
 Helper for the ACE_OS::cuserid() function.
void ACE_OS::clearerr (FILE *fp)
ACE_Export int ACE_OS::asprintf (char **bufp, const char *format,...)
int ACE_OS::fclose (FILE *fp)
FILE * ACE_OS::fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode)
int ACE_OS::fflush (FILE *fp)
int ACE_OS::fgetc (FILE *fp)
int ACE_OS::getc (FILE *fp)
int ACE_OS::fgetpos (FILE *fp, fpos_t *pos)
char * ACE_OS::fgets (char *buf, int size, FILE *fp)
ACE_HANDLE ACE_OS::fileno (FILE *stream)
FILE * ACE_OS::fopen (const char *filename, const char *mode)
ACE_Export int ACE_OS::fprintf (FILE *fp, const char *format,...)
int ACE_OS::ungetc (int c, FILE *fp)
int ACE_OS::fputc (int c, FILE *fp)
int ACE_OS::putc (int c, FILE *fp)
int ACE_OS::fputs (const char *s, FILE *stream)
size_t ACE_OS::fread (void *ptr, size_t size, size_t nelems, FILE *fp)
FILE * ACE_OS::freopen (const ACE_TCHAR *filename, const ACE_TCHAR *mode, FILE *stream)
int ACE_OS::fseek (FILE *fp, long offset, int ptrname)
int ACE_OS::fsetpos (FILE *fp, fpos_t *pos)
long ACE_OS::ftell (FILE *fp)
size_t ACE_OS::fwrite (const void *ptr, size_t size, size_t nitems, FILE *fp)
void ACE_OS::perror (const char *s)
ACE_Export int ACE_OS::printf (const char *format,...)
int ACE_OS::puts (const char *s)
int ACE_OS::rename (const char *old_name, const char *new_name, int flags=-1)
void ACE_OS::rewind (FILE *fp)
ACE_Export int ACE_OS::snprintf (char *buf, size_t maxlen, const char *format,...)
ACE_Export int ACE_OS::sprintf (char *buf, const char *format,...)
char * ACE_OS::tempnam (const char *dir=0, const char *pfx=0)
int ACE_OS::vasprintf (char **bufp, const char *format, va_list argptr)
int ACE_OS::vprintf (const char *format, va_list argptr)
int ACE_OS::vfprintf (FILE *fp, const char *format, va_list argptr)
int ACE_OS::vsprintf (char *buffer, const char *format, va_list argptr)
int ACE_OS::vsnprintf (char *buffer, size_t maxlen, const char *format, va_list argptr)
ACE_Export int ACE_OS::vasprintf_emulation (char **bufp, const char *format, va_list argptr)

char * ACE_OS::cuserid (char *user, size_t maxlen=ACE_MAX_USERID)

int ACE_OS::flock_init (ace_flock_t *lock, int flags=0, const ACE_TCHAR *name=0, mode_t perms=0)
int ACE_OS::flock_destroy (ace_flock_t *lock, int unlink_file=1)
int ACE_OS::flock_rdlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0)
int ACE_OS::flock_tryrdlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0)
int ACE_OS::flock_trywrlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0)
int ACE_OS::flock_unlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0)
int ACE_OS::flock_wrlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0)

Detailed Description

Id:
OS_NS_stdio.h 87143 2009-10-17 10:29:01Z olli
Author:
Douglas C. Schmidt <schmidt@cs.wustl.edu>
Jesper S. M|ller<stophph@diku.dk>
and a cast of thousands...

Originally in OS.h.

Definition in file OS_NS_stdio.h.


Define Documentation

#define ACE_EXPORT_MACRO   ACE_Export

Definition at line 44 of file OS_NS_stdio.h.


Function Documentation

void ace_clearerr_helper ( FILE *  stream  )  [inline]

Definition at line 54 of file OS_NS_stdio.h.

{
#  if defined (clearerr)
  clearerr (stream);
#  undef clearerr
#  else
  ACE_STD_NAMESPACE::clearerr (stream);
#  endif /* defined (clearerr) */
}

char* ace_cuserid ( char *  user  )  [inline]

Helper for the ACE_OS::cuserid() function.

On some platforms cuserid is a macro. Defining ACE_OS::cuserid() becomes really hard, as there is no way to save the macro definition using the pre-processor. This inline function achieves the same effect, without namespace pollution or performance penalties.

Todo:
We maybe should move a lot of the code in ACE_OS::cuserid here so it is treated the same as the above ace_difftime and ace_timezone. But since there is a good deal more code in ACE_OS::cuserid, we probably need to move some of it off into some sort of emulation function.

Definition at line 143 of file OS_NS_stdio.h.

{
  return cuserid(user);
}

int ace_fgetc_helper ( FILE *  fp  )  [inline]

Definition at line 65 of file OS_NS_stdio.h.

{
#if defined (fgetc)
  return fgetc (fp);
#undef fgetc
#else
  return ACE_STD_NAMESPACE::fgetc (fp);
#endif /* defined (fgetc) */
}

ACE_HANDLE ace_fileno_helper ( FILE *  fp  )  [inline]

Definition at line 116 of file OS_NS_stdio.h.

{
# if defined (fileno)
  return (ACE_HANDLE)fileno (fp);
# undef fileno
# else
  return (ACE_HANDLE)ACE_STD_NAMESPACE::fileno (fp);
# endif /* defined (fileno) */
}

int ace_fputc_helper ( int  ch,
FILE *  fp 
) [inline]

Definition at line 75 of file OS_NS_stdio.h.

{
#if defined (fputc)
  return fputc (ch, fp);
#undef fputc
#else
  return ACE_STD_NAMESPACE::fputc (ch, fp);
#endif /* defined (fputc) */
}

int ace_getc_helper ( FILE *  fp  )  [inline]

Definition at line 85 of file OS_NS_stdio.h.

{
#if defined (getc)
  return getc (fp);
#undef getc
#else
  return ACE_STD_NAMESPACE::getc (fp);
#endif /* defined (getc) */
}

int ace_putc_helper ( int  ch,
FILE *  fp 
) [inline]

Definition at line 95 of file OS_NS_stdio.h.

{
#if defined (putc)
  return putc (ch, fp);
#undef putc
#else
  return ACE_STD_NAMESPACE::putc (ch, fp);
#endif /* defined (putc) */
}

int ace_ungetc_helper ( int  ch,
FILE *  fp 
) [inline]

Definition at line 105 of file OS_NS_stdio.h.

{
#if defined (ungetc)
  return ungetc (ch, fp);
#undef ungetc
#else
  return ACE_STD_NAMESPACE::ungetc (ch, fp);
#endif /* defined (ungetc) */
}

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines