Commit d52743d3 d52743d3f4fddafd69cb92757b3e01553f8a8c3e by Alain Magloire

New example from Sam Roberts.

1 parent bc3a57b1
......@@ -2,11 +2,11 @@ CFLAGS = -Wall -pedantic -g
INCLUDES = -I../libmailbox
LIBS = ../libmailbox/.libs/libmailbox.al
from: from.c $(LIBS)
gcc $(CFLAGS) $(INCLUDES) -o from from.c $(LIBS)
showmail: showmail.c $(LIBS)
gcc $(CFLAGS) $(INCLUDES) -o showmail showmail.c $(LIBS)
$(CC) $(CFLAGS) $(INCLUDES) -o showmail showmail.c $(LIBS)
addr: addr.c $(LIBS)
$(CC) $(CFLAGS) $(INCLUDES) -o addr addr.c $(LIBS)
clean:
rm -f from showmail
rm -f addr showmail
......
#include <stdio.h>
#include <mailutils/address.h>
static int use_zero = 1;
static int parse(const char* str)
{
size_t no = 0;
......@@ -12,9 +10,6 @@ static int parse(const char* str)
address_t address = NULL;
if(use_zero)
address_create0(&address, str);
else
address_create(&address, str);
address_get_count(address, &pcount);
......@@ -72,14 +67,6 @@ int main(int argc, const char *argv[])
{
argc = 1;
if(argv[argc] && strcmp(argv[argc], "-1") == 0) {
use_zero = 0;
argc++;
}
if(argv[argc] && strcmp(argv[argc], "-0") == 0) {
use_zero = 1;
argc++;
}
if(!argv[argc]) {
return parseinput();
}
......