Back to index

courier  0.68.2
Functions
testhtml.c File Reference
#include "html.h"
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Functions

static void write_stdout (const unicode_char *uc, size_t n, void *dummy)
static char * cid_func (const char *cid, void *dummy)
int main (int argc, char **argv)

Function Documentation

static char* cid_func ( const char *  cid,
void *  dummy 
) [static]

Definition at line 15 of file testhtml.c.

{
       return strdup(cid);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 20 of file testhtml.c.

{
       struct htmlfilter_info *p;
       char buf[1024];
       unicode_char ubuf[1024];
       size_t n;

       p=htmlfilter_alloc(write_stdout, NULL);

       htmlfilter_set_http_prefix(p, "http://redirect?");
       htmlfilter_set_mailto_prefix(p, "http://mailto?");
       htmlfilter_set_convertcid(p, cid_func, NULL);

       while (fgets(buf, sizeof(buf), stdin) != NULL)
       {
              size_t i;

              n=strlen(buf);

              for (i=0; i<n; i++)
                     ubuf[i]=buf[i];

              htmlfilter(p, ubuf, i);
       }
       htmlfilter_free(p);
       return 0;
}

Here is the call graph for this function:

static void write_stdout ( const unicode_char uc,
size_t  n,
void *  dummy 
) [static]

Definition at line 6 of file testhtml.c.

{
       while (n)
       {
              putchar(*uc++);
              --n;
       }
}

Here is the caller graph for this function: