newbie help

ashtonn@gmail.com doodle4 at gmail.com
Wed Mar 23 22:57:10 CET 2005


static
void
   testme(
      unsigned char *buf,
      unsigned long size,
      CODE code)
{
   unsigned long data
   switch (code)
   {
      // Generate some test patterns
      case TEST1 :
                   value = 0x0;
                   while (size--)
                   {
                       *buf++ =  (unsigned char)value++
                   }
                   break
      case TEST2 :
      ....
   }
   return
}

main()
{
   unsigned char buf[512];
   CODE code = TEST1


   # The index number is passed from the command line
   # It corresponds to one of the two buffers

   # if index = 1 corresponds to buf1 and if index = 2 corresponds to
buf2


   buf1 = getBuf(index1);
   testme( buf1, 512, code);


   return 0x0;
}


This is snippet code trying to generate some test patterns.

How do i manage multiple buffers in python. Is it possible?


If the index number at command line is 2, then buffer 2 is passed to
'testme'

I went through the Python tutorial and could not find much information.

Any help with python examples is appreciated.




More information about the Python-list mailing list