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

main.c

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include "Modules.h"
00004 #include "Args.h"
00005 
00006 void MemoryTest();
00007 void ArgsTest();
00008 
00009 int main(int argc, char **argv)
00010 {
00011   printf("Starting ANet daemon...\n");
00012 
00013   //Do some stuff here...
00014   //MemoryTest();
00015   ArgsTest();
00016 
00017   printf("Closing ANet daemon...\n");
00018   return 0;
00019 }
00020 
00021 void MemoryTest()
00022 {
00023   char *buffer = (char*)(0);
00024   ANetMemoryTag tag;
00025 
00026   tag = NewMemoryBlock(20, 0);
00027   printf("Size = %d\n", (int)(GetMemoryBlockSize(tag)));
00028   ResolveMemoryTag(tag, (UInt8**)(&buffer));
00029   buffer[0] = 15;
00030   printf("Size = %d\n", (int)(GetMemoryBlockSize(tag)));
00031   DeleteMemoryBlock(tag);
00032 }
00033 
00034 void ArgsTest()
00035 {
00036   int argc = 5;
00037   char *argv[5] = {"-c","\"3des\"","-vw","--hello-w","hello"};
00038   char *args = (char*)(malloc(40));
00039   char *val = (char*)(malloc(40));
00040   
00041   MakeArgumentString(argc, argv, args, 40);
00042   printf("%d\n", GetArgument(args, "hello-w", val, 40));
00043   printf("%s\n", val);
00044 }

Generated on Sun Dec 23 15:20:37 2001 for ANet by doxygen 1.2.12 written by Dimitri van Heesch, © 1997-2001

SourceForge
Logo