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

📄 main.c

📁 unix 下用pro*c tuxedo 开发的东西
💻 C
字号:
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>


#include "errlog.h"

main()
{
  int retcode;
  int len;
  char *buffer;
  FILE *fp;
  char *PID = "Client Txn Clt_Mpt Process(Port 7111)";


  fp = fopen("DUMP.TXT", "rb");
  if (fp==NULL) return(-1);
  fseek(fp, 0, SEEK_END); len = ftell(fp); fseek(fp, 0, SEEK_SET);
  buffer = (char *)malloc(len);
  if (buffer == NULL) return(-3);
  fread(buffer, len, 1, fp);
  fclose(fp);


#ifdef DEBUG
  printf("Running...\n");
#endif

  retcode = InitErrLogObj(PID, 2);
  if (retcode != 0) {
     printf("Initialzie error\n");
     return(-1); }
  
  printf("HOME is : %s\n", getenv("HOME"));
  retcode = ProcessError(LOG_NORMAL,  "Test %d this is %s message", 1, "NORMAL");
  retcode = ProcessError(LOG_WARNING, "Test %d this is %s message", 2, "WARNING");
  retcode = ProcessError(LOG_DEBUG,   "Test %d this is %s message", 3, "DEBUG");
  retcode = ProcessError(LOG_ERROR,   "Test %d this is %s message", 4, "ERROR");
  retcode = ProcessError(LOG_ERROR,   "123456789012345678901234567890\nMMMMMMMMMMMMMMMM\niiiiiiiiiiiiiiii\n1\t2\t3");
  retcode = ProcessError(LOG_DEBUG,   NULL, "CONTENT OF DUMP.TXT", buffer, len);

  CloseErrLogObj();

  free(buffer);
  exit(1);
}

⌨️ 快捷键说明

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