ftnstrip.c
来自「su 的源代码库」· C语言 代码 · 共 50 行
C
50 行
/* Copyright (c) Colorado School of Mines, 2006.*//* All rights reserved. *//* FTNSTRIP: $Revision: 1.5 $ ; $Date: 2003/08/19 21:24:44 $ */#include "par.h"/*********************** self documentation ******************************/char *sdoc[] = {" "," FTNSTRIP - convert a file of binary data plus record delimiters created"," via Fortran to a file containing only binary values (as created via C)"," "," ftnstrip <ftn_data >c_data "," "," Caveat: this code assumes the conventional Fortran format of header "," and trailer integer containing the number of byte in the "," record. This is overwhelmingly common, but not universal. "," ",NULL};/* Credits: * CWP: Jack K. Cohen *//**************** end self doc *******************************************/intmain(int argc, char **argv){ int n1bytes; char *buf; /* Initialize */ initargs(argc, argv); requestdoc(1); while (efread(&n1bytes, ISIZE, 1, stdin)) { buf = ealloc1(n1bytes, 1); efread(buf, n1bytes, 1, stdin); efwrite(buf, n1bytes, 1, stdout); free1(buf); efread(&n1bytes, ISIZE, 1, stdin); } return(CWP_Exit());}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?