Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Examples  

test_add_comment.c

This file shows how to use the function add_comment().

#include <stdio.h>
#include <string.h>
#include "strings_utils.h"


#define BIG_BUFFER     60000

int main (int argc, char *argv[])
{
  char buffer[BIG_BUFFER];
  char *res, *c;
  int  i; 

  if (argc == 1) { return 0; }

  buffer[0]=0;
  for (i=1; i<argc; i++)
  {
    strcat (buffer, "\n");
    strcat (buffer, argv[i]);
  }

  fprintf (stdout, "\n\nInput:\n\n%s\n\n", buffer);

  c = add_comment (buffer, &res);
  if (c == NULL)
  {
    fprintf (stderr, "\nError while processing\n");
    return 1;
  }

  fprintf (stdout, "\n\nOutput:\n\n%s\n\n",res);

  free (res);
  return 0;
}

Generated on Thu Apr 3 16:23:40 2003 for Common_C_libraries by doxygen1.3-rc1