separate the vars
[AROS.git] / workbench / libs / reqtools / rtspread.c
bloba2361f6ecfcefde9c09289728b7c5542d378cfce
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #include <exec/types.h>
10 #include <proto/exec.h>
11 #include <proto/reqtools.h>
12 #include <exec/libraries.h>
13 #include <exec/memory.h>
14 #include <aros/libcall.h>
15 #include "general.h"
16 #include "reqtools_intern.h"
17 #include "rtfuncs.h"
19 /*****************************************************************************
21 NAME */
23 AROS_LH6(VOID, rtSpread,
25 /* SYNOPSIS */
27 AROS_LHA(ULONG *, posarray , A0),
28 AROS_LHA(ULONG *, sizearray, A1),
29 AROS_LHA(ULONG , totalsize, D0),
30 AROS_LHA(ULONG , min , D1),
31 AROS_LHA(ULONG , max , D2),
32 AROS_LHA(ULONG , num , D3),
34 /* LOCATION */
36 struct ReqToolsBase *, ReqToolsBase, 22, ReqTools)
38 /* FUNCTION
39 Evenly spread a number of objects over a certain length.
40 Primary use is for arrangement of gadgets in a window.
42 INPUTS
43 posarray - pointer to array to be filled with positions.
44 sizearray - pointer to array of sizes.
45 totalsize - total size of all objects (sum of all values in
46 sizearray).
47 min - first position to use.
48 max - last position, first _NOT_ to use.
49 num - number of objects (size of posarray and sizearray).
51 RESULT
52 none
54 NOTES
55 This function is for the advanced ReqTools user.
57 EXAMPLE
58 'sizearray' holds following values: 4, 6, 4, 2 and 8,
59 'totalsize' is 24 (= 4 + 6 + 4 + 2 + 8),
60 'min' is 3, 'max' is 43,
61 and finally, 'num' is 5.
63 After calling rtSpread() 'posarray' would hold the following
64 values: 3, 11, 19, 26 and 31.
66 My attempt at a visual representation:
68 | |
69 | | | |
70 | OOOO OOOOOO OOOO OO OOOOOOOO |
71 | | | |
72 | 1 1 2 2 3 3 4 4
73 0----5----0----5----0----5----0----5----0----5
75 BUGS
76 none known
78 SEE ALSO
80 INTERNALS
82 HISTORY
84 ******************************************************************************/
86 AROS_LIBFUNC_INIT
88 RTFuncs_rtSpread(posarray, sizearray, totalsize, min, max, num);
90 AROS_LIBFUNC_EXIT
92 } /* rtSpread */