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

📄 segyhdrmod.c

📁 su 的源代码库
💻 C
字号:
/* Copyright (c) Colorado School of Mines, 2006.*//* All rights reserved.                       *//* : $Revision: 1.1 $ ; $Date: 2003/08/19 17:31:42 $	*/#include "par.h"#include "su.h"/*********************** self documentation ***************************/char* sdoc[] = {" SEGYHDRMOD - replace the text header on a SEGY file		","								","   segyhdrmod text=file data=file				","								","   Required parameters:					","								","   text=      name of file containing new 3200 byte text header","   data=      name of file containing SEGY data set		","								",NULL};/*====================================================================*\   sgyhdrmod - replace the text header on a SEGY data file in place   This program only reads and writes 3200 bytes   Reginald H. Beardsley                            rhb@acm.org\*====================================================================*//************************** end self doc ******************************/      int main(int argc ,char* argv[] ){   FILE* txtfp;   /* file pointer for new text */   FILE* datfp;   /* file pointer for data file */   int n;   char* text;   char* data;   char buf[3200];   /*------------*/   /* Initialize */   /*------------*/   initargs(argc, argv);   requestdoc(2); /* two file args required */   if( !getparstring( "text" ,&text ) ){      err( "missing text header filename" );   }    if( !getparstring( "data" ,&data ) ){      err( "missing data filename" );   }    /*------------------*/   /* Open input files */   /*------------------*/   if( !(txtfp = fopen(text, "rb")) ){      err( "unable to open %s" ,text );   }   if( !(datfp = fopen(data, "rb+")) ){      err( "unable to open %s" ,data );   }   /*---------------------------*/   /* rewrite text header block */   /*---------------------------*/   if( (n=fread( buf ,1 ,sizeof(buf) ,txtfp )) != sizeof(buf) ){      err( "unable to read new text header" );   }   if( (n=fwrite( buf ,1 ,sizeof(buf) ,datfp )) != sizeof(buf) ){      err( "write of new text header failed!!!!!" );   }   return( 0 );}

⌨️ 快捷键说明

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