home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 13 / WSTDIO21.ZIP / WINSTDIO.H < prev    next >
C/C++ Source or Header  |  1996-05-31  |  3KB  |  83 lines

  1. /* 
  2.   WinStdio V2.1 - Simple stdio facilties for Windows
  3.   Copyright 1989 - 1996 I. H. Ting (I.H.Ting@wlv.ac.uk)
  4.   
  5.   WinStdio provides simple console-based (stdio) input output in Windows.
  6.   At the moment, only the following stdio calls are supported:
  7.   
  8.   puts(), printf(), and gets().
  9.   
  10.   Please feel free to use and distribute the WinStdio source code. 
  11.   Just respect my copyright. No waranty is implied or expressed.
  12.   I will only guarantee that the code will fail occasionally!
  13. */  
  14.  
  15. #ifndef WINSTDIO_H
  16. #define WINSTDIO_H
  17. /* WinStdio.h  - prototypes for application-callable WinStdio functions */
  18.  
  19. /* registers the WinStdio class */
  20. BOOL RegisterWinStdioClass(HANDLE hInstance);
  21.  
  22. /* Creates and return a handle to a WinStdio window */
  23. HWND CreateStdioWindow(LPSTR szWindowName, HANDLE hInstance,int  nCmdShow);
  24.  
  25. /* WinStdio's equivalent of puts(). hWnd must be a valid WinStdio handle*/
  26. int WinPuts(HWND hWnd, const char *pstring,int bAddReturn);
  27.  
  28. /* WinStdio's equivalent of printf(). hWnd must be a valid WinStdio handle.
  29.    Calls wputs() ultimately.*/
  30. int WinPrintf(HWND hWnd, const char *fmt,...);
  31.  
  32. /* WinStdio's equivalent of gets(). hWnd must be a valid WinStdio handle*/
  33. char *WinGets(HWND hWnd, char *buffer,BOOL bWantNewline);
  34.  
  35. int WinStdioYield(void);
  36.  
  37.  
  38. /*  If you get redefinition problems, comment the following prototypes out */
  39. extern int printf(const char *, ...);
  40. extern int puts(const char *);
  41. extern char *gets(char *);
  42.  
  43.  
  44. /* Win32/Win16 portability macros */
  45. #ifndef EXPORT_STD_CALLBACK
  46.   #if defined _WIN32  && !defined __BORLANDC__
  47.     #ifdef TSCRIPT_STATIC_LIB
  48.       #define EXPORT_STD_CALLBACK(FuncReturnType) FuncReturnType CALLBACK
  49.       #define EXPORT_CDECL_CALLBACK(FuncReturnType) FuncReturnType __cdecl
  50.     #else
  51.       #define EXPORT_STD_CALLBACK(FuncReturnType) __declspec(dllexport) FuncReturnType CALLBACK
  52.       #define EXPORT_CDECL_CALLBACK(FuncReturnType) __declspec(dllexport) FuncReturnType __cdecl
  53.     #endif
  54.   #else
  55.     #define EXPORT_STD_CALLBACK(FuncReturnType) FuncReturnType __export CALLBACK
  56.     #define EXPORT_CDECL_CALLBACK(FuncReturnType) FuncReturnType __export _far __cdecl
  57.   #endif
  58. #endif /*EXPORT_STD_CALLBACK*/
  59.  
  60. #ifndef IMPORT_STD_CALLBACK
  61.   #if defined _WIN32 && !defined __BORLANDC__
  62.     #ifdef TSCRIPT_STATIC_LIB
  63.       #define IMPORT_STD_CALLBACK(FuncReturnType)  extern FuncReturnType CALLBACK
  64.       #define IMPORT_CDECL_CALLBACK(FuncReturnType) extern FuncReturnType __cdecl
  65.     #else
  66.       #define IMPORT_STD_CALLBACK(FuncReturnType) __declspec(dllimport) extern FuncReturnType CALLBACK
  67.       #define IMPORT_CDECL_CALLBACK(FuncReturnType) __declspec(dllimport) extern FuncReturnType __cdecl
  68.     #endif
  69.   #else
  70.     #define IMPORT_STD_CALLBACK(FuncReturnType) extern FuncReturnType CALLBACK
  71.     #define IMPORT_CDECL_CALLBACK(FuncReturnType) extern FuncReturnType _far __cdecl
  72.   #endif
  73. #endif /*IMPORT_STD_CALLBACK*/
  74.  
  75. #if defined  _WIN32  && !defined __BORLANDC__
  76.   #ifndef __export
  77.     #define __export
  78.   #endif
  79. #endif
  80.  
  81.  
  82. #endif /*WINSTDIO_H */
  83.