POV-Ray : Newsgroups : povray.programming : Changes to Option_Variable[] Server Time
28 Jul 2024 04:16:18 EDT (-0400)
  Changes to Option_Variable[] (Message 1 to 1 of 1)  
From: Lee Begg
Subject: Changes to Option_Variable[]
Date: 22 Oct 2002 08:15:09
Message: <3db54147@news.povray.org>
Hi there.

I have just started working on porting the PVM patch for POVRay from 3.1g to 
3.5 and noticed a fairly large change in the way Option_Variable[] works.

There doesn't appear to be much documentation about it.  I hope that someone 
could point me in the right direction.

The old code uses:

  { PVM_TASKS_OP, "PVM_Tasks" },
  { PVM_WIDTH_OP, "PVM_Width" },
  { PVM_HEIGHT_OP, "PVM_Height" },
  { PVM_SLAVE_OP, "PVM_Slave" },
...

and sets the variables in void process_variable(TOKEN variable,char *value) 
as shown below:

   case PVM_TASKS_OP:
       if (sscanf(value, "%d", &PvmTasks) != 1 || PvmTasks < 1) { 
          PvmTasks = 9999;   /* Try to start one slave/available PVM host */
       } 
       return;

   case PVM_WIDTH_OP:
       if (sscanf(value, "%d", &PvmChunkWidth) != 1 || PvmChunkWidth < 4)
          PvmChunkWidth = PVM_DEFAULT_GRID_WIDTH;
       return;
 
   case PVM_HEIGHT_OP:
       if (sscanf(value, "%d", &PvmChunkHeight) != 1 || PvmChunkHeight < 4)
          PvmChunkHeight = PVM_DEFAULT_GRID_HEIGHT;
       return;
          
   case PVM_SLAVE_OP:
       PvmSlavename = POV_MALLOC( sizeof(char)*(strlen(value)+1), 
                                 "PVM Slavename");
       strcpy(PvmSlavename, value);
       return;
....

What is the new way of preforming this?  Is this likely to change again in 
future versions?

I think I see how Command_Option[] works, or at least how it relates to the 
new Option_Variable[] works.

Thanks for any assistance.

Lee Begg


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.