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

📄 tcomment.c

📁 This is code tutorial for image processing include:histogram,sketon....
💻 C
字号:

   /***********************************************
   *
   *  file tcomment.c
   *
   *  Functions: This file contains
   *     main
   *
   *  Purpose:
   *     This is the main calling program for 
   *     subroutines that read comments from
   *     a TIFF header and insert comments into
   *     a TIFF header.
   *
   *  External Calls:
   *     tcommsub.c - read_comments
   *                  insert_comments
   *
   *  Modifications:
   *     9 May 1995 - created
   *
   *************************************************/


#include "cips.h"




main(argc, argv)
   char *argv[];
   int  argc;
{
   char all_comments[1000],
        comments[MAX_NAME_LENGTH],
        file_name[MAX_NAME_LENGTH];

   int  i,
        should_insert = 0,
        should_read   = 0;


   if(argc < 3){
      printf("\nusage: tcomment file-name -c comments...");
      printf("\n       tcomment file-name -r");
      exit(1);
   }  /* ends if argc */

   strcpy(file_name, argv[1]);
   if(does_not_exist(file_name)){
      printf("\ntcomment> File %s does not exist", 
             file_name);
      exit(2);
   }  /* ends if does not exist */


   i = 2;
   while(i <= argc){

      if(strcmp(argv[i], "-r") == 0)
         should_read = 1;

      if(strcmp(argv[i], "-c") == 0){
         should_insert = 1;
         i++;
         comments[0] = '\0';
         while(i < argc){
            strcat(comments, argv[i]);
            strcat(comments, " ");
            i++;
         }  /* ends while i < argc */
      }  /* ends if argv == -c */
      
      i++;
   }  /* ends while i < argc */

   if(should_read){
      read_comments(file_name, all_comments);
      printf("\nThe comments in file %s are:", 
         file_name);
      printf("\n     ------------------------");
      printf("\n%s", all_comments);
      printf("\n     ------------------------");
   }  /* ends if should_read */

   if(should_insert)
      insert_comments(file_name, comments);

}  /* ends main */

⌨️ 快捷键说明

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