2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
9 #include <proto/datatypes.h>
10 #include "datatypes_intern.h"
12 /*****************************************************************************
16 AROS_LH3(struct DTMethod
*, CopyDTTriggerMethods
,
19 AROS_LHA(struct DTMethod
*, methods
, A0
),
20 AROS_LHA(struct DTMethod
*, include
, A1
),
21 AROS_LHA(struct DTMethod
*, exclude
, A2
),
24 struct Library
*, DataTypesBase
, 46, DataTypes
)
28 Copy and modify an array of DTMethod:s. This is used by subclass
29 implementors who want to add supported methods to an existing class.
33 methods -- array of methods; may be NULL
34 include -- array of methods to include terminated with ~0UL; may be NULL
35 method -- array of methods to exclude terminated with ~0UL; may be NULL
36 the dtm_Command and dtm_Method fields may have the options
37 described in the FindTriggerMethod to filter out the given
41 The new array of methods or NULL if something went wrong (like out of
46 dtm_Label and dtm_Command must be valid as long as the object exists as
48 A subclass that implment DTM_TRIGGER must send unknown trigger
49 methods to its superclass.
57 FindTriggerMethod(), CopyDTMethods(), FreeDTMethods()
63 2.8.99 SDuvan implemented
65 *****************************************************************************/
69 struct DTMethod
*inc
= include
;
70 struct DTMethod
*exc
= exclude
;
71 struct DTMethod
*met
= methods
;
73 struct DTMethod
*newM
;
74 struct DTMethod
*newmets
;
81 while(inc
->dtm_Method
!= STM_DONE
)
90 while(exc
->dtm_Method
!= STM_DONE
)
92 if(FindTriggerMethod(methods
, NULL
, exc
->dtm_Method
) != NULL
)
99 while(met
->dtm_Method
!= STM_DONE
)
105 newM
= AllocVec((nMethods
+ 1)*sizeof(struct DTMethod
), MEMF_PUBLIC
);
107 /* No memory available? */
114 /* Copy new methods */
117 while(include
->dtm_Method
!= STM_DONE
)
118 *newmets
++ = *include
++;
121 /* Copy old methods except the excluded ones */
122 while(met
->dtm_Method
!= STM_DONE
)
124 if(FindTriggerMethod(exclude
, NULL
, met
->dtm_Method
) == NULL
)
130 newmets
->dtm_Method
= STM_DONE
;
135 } /* CopyDTTriggerMethods */