⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pfwstdio.h

📁 用于电力系统潮流计算 c++程序
💻 H
字号:
//---------------------------------------------------------------------------
// Pflow for Windows:  Redefinition in C of several stdio.h routines
//                     and variables
//
// Claudio Canizares (c) 1996
// University of Waterloo
//---------------------------------------------------------------------------
#include <iostream.h>
#include <fstream.h>
#include <setjmp.h>

// Define Screen data type to work with Windows Paint and some
// other variables
#define TABSPACES 4
#define BUFFER 512
#define argc Argc
#define argv Argv
typedef struct ScreenType {
   char *Line;
   ScreenType *Next;
} ScreenType;

// Redefinition of FILE for input and output
// NOTES: - stdio.h cannot be used in Windows
//        - ofstream operations don't work properly; file names must
//          be used instead
//        - pointers to windows don't work either
typedef struct {
  char Name[100];
  fstream ios;
  int Screen;
} FILE;

#ifndef _PFLOW_WINDOWS
// Redefinition of some std* variables and command line arguments
// and exit label
extern FILE *stdout, *stdin, *stderr;
extern int Argc;
extern char **Argv;
extern jmp_buf exit_main;
#endif

// Redefine:
// * Output to file FileOut using Format
int fprintf(FILE *FileOut,const char *Format,...);
// * Output to stdout using Format
int printf(const char *Format,...);
// * Output to string Buffer using Format
int sprintf(char *Buffer,const char *Format,...);
// * Read line up to N number of characters from input file FileIn
//   and put it into string Buffer
char *fgets(char *Buffer, int n, FILE *FileIn);
// * Read from string Buffer using Format
int sscanf(const char *Buffer, const char *Format, ...);
// * Read from stdin using Format
int scanf(const char *Format, ...);
// * Open a file
FILE *fopen(const char *FileName,const char *mode);
// * Associate an existing stream to a file
FILE *freopen(const char *FileName,const char *mode,FILE *File);
// * Close a file
int fclose(FILE *File);


// Redefinition of exit
#define exit Exit
void Exit(int status);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -