8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-25 00:03:03 +01:00
firebird-mirror/src/burp/std_desc.h

65 lines
1.6 KiB
C
Raw Normal View History

/*
**************************************************************************
*
* PROGRAM: standard descriptors for gbak & gsplit
* MODULE: std_desc.h
* DESCRIPTION: standard descriptors for different OS's
*
*
**************************************************************************
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy
* of the License at http://www.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Alexander Peshkoff <peshkoff@mail.ru>.
* Thanks to Achim Kalwa <achim.kalwa@winkhaus.de>.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#ifndef GBAK_STD_DESC_H
#define GBAK_STD_DESC_H
#include "firebird.h"
#ifdef WIN_NT
#include <windows.h>
2006-01-10 09:31:29 +01:00
typedef HANDLE DESC;
2009-01-03 10:14:29 +01:00
static inline DESC GBAK_STDIN_DESC()
2003-09-21 01:28:38 +02:00
{
2008-12-05 01:56:15 +01:00
return GetStdHandle(STD_INPUT_HANDLE); // standard input file descriptor
2003-09-21 01:28:38 +02:00
}
2009-01-03 10:14:29 +01:00
static inline DESC GBAK_STDOUT_DESC()
2003-09-21 01:28:38 +02:00
{
2006-01-13 23:25:05 +01:00
return GetStdHandle(STD_OUTPUT_HANDLE); // standard output file descriptor
2003-09-21 01:28:38 +02:00
}
#else //WIN_NT
typedef int DESC;
2009-01-03 10:14:29 +01:00
static inline DESC GBAK_STDIN_DESC()
2003-09-21 01:28:38 +02:00
{
2008-12-05 01:56:15 +01:00
return 0; // standard input file descriptor
2003-09-21 01:28:38 +02:00
}
2009-01-03 10:14:29 +01:00
static inline DESC GBAK_STDOUT_DESC()
2003-09-21 01:28:38 +02:00
{
2006-01-13 23:25:05 +01:00
return 1; // standard output file descriptor
2003-09-21 01:28:38 +02:00
}
const int INVALID_HANDLE_VALUE = -1;
#endif //WIN_NT
#endif //GBAK_STD_DESC_H