comparison src/specifier.h @ 4430:d00347ec8289

Fix instantiate_method prototype This adds the additional no_fallback argument from the previous patch
author Didier Verna <didier@xemacs.org>
date Thu, 28 Feb 2008 10:29:08 +0100
parents 98af8a976fc3
children d95c102a96d3 e0db3c197671
comparison
equal deleted inserted replaced
4429:a883e09e54f7 4430:d00347ec8289
137 If this function is not present, *no* matchspecs are considered 137 If this function is not present, *no* matchspecs are considered
138 valid. Note that this differs from validate_method(). */ 138 valid. Note that this differs from validate_method(). */
139 void (*validate_matchspec_method) (Lisp_Object matchspec); 139 void (*validate_matchspec_method) (Lisp_Object matchspec);
140 140
141 /* Instantiate method: Return SPECIFIER instance in DOMAIN, 141 /* Instantiate method: Return SPECIFIER instance in DOMAIN,
142 specified by INSTANTIATOR. MATCHSPEC specifies an additional 142 specified by INSTANTIATOR. MATCHSPEC specifies additional
143 constraints on the instance value (see the docstring for 143 constraints on the instance value (see the docstring for
144 Fspecifier_matching_instance function). MATCHSPEC is passed 144 Fspecifier_matching_instance function). MATCHSPEC is passed
145 Qunbound when no matching constraints are imposed. The method is 145 Qunbound when no matching constraints are imposed. The method is
146 called via call_with_suspended_errors(), so allowed to eval 146 called via call_with_suspended_errors(), so allowed to eval
147 safely. 147 safely.
149 DEPTH is a lisp integer denoting current depth of instantiation 149 DEPTH is a lisp integer denoting current depth of instantiation
150 calls. This parameter should be passed as the initial depth value 150 calls. This parameter should be passed as the initial depth value
151 to functions which also instantiate specifiers (of which I can 151 to functions which also instantiate specifiers (of which I can
152 name specifier_instance) to avoid creating "external" 152 name specifier_instance) to avoid creating "external"
153 specification loops. 153 specification loops.
154
155 NO_FALLBACK indicates that the method should not try the fallbacks
156 (and thus simply return Qunbound) in case of a failure to instantiate.
154 157
155 This method must presume that both INSTANTIATOR and MATCHSPEC are 158 This method must presume that both INSTANTIATOR and MATCHSPEC are
156 already validated by the corresponding validate_* methods, and 159 already validated by the corresponding validate_* methods, and
157 may abort if they are invalid. 160 may abort if they are invalid.
158 161
164 specifiers, like integer and boolean. */ 167 specifiers, like integer and boolean. */
165 Lisp_Object (*instantiate_method) (Lisp_Object specifier, 168 Lisp_Object (*instantiate_method) (Lisp_Object specifier,
166 Lisp_Object matchspec, 169 Lisp_Object matchspec,
167 Lisp_Object domain, 170 Lisp_Object domain,
168 Lisp_Object instantiator, 171 Lisp_Object instantiator,
169 Lisp_Object depth); 172 Lisp_Object depth,
173 int no_fallback);
170 174
171 /* Going-to-add method: Called when an instantiator is about 175 /* Going-to-add method: Called when an instantiator is about
172 to be added to a specifier. This function can specify 176 to be added to a specifier. This function can specify
173 that different instantiators should be used instead by 177 that different instantiators should be used instead by
174 returning an inst-list (possibly containing zero elements). 178 returning an inst-list (possibly containing zero elements).
341 #define INITIALIZE_SPECIFIER_TYPE_WITH_DATA(type, obj_name, pred_sym) \ 345 #define INITIALIZE_SPECIFIER_TYPE_WITH_DATA(type, obj_name, pred_sym) \
342 do { \ 346 do { \
343 INITIALIZE_SPECIFIER_TYPE (type, obj_name, pred_sym); \ 347 INITIALIZE_SPECIFIER_TYPE (type, obj_name, pred_sym); \
344 type##_specifier_methods->extra_data_size = \ 348 type##_specifier_methods->extra_data_size = \
345 sizeof (struct type##_specifier); \ 349 sizeof (struct type##_specifier); \
346 type##_specifier_methods->extra_description = \ 350 type##_specifier_methods->extra_description = \
347 &type##_specifier_description_0; \ 351 &type##_specifier_description_0; \
348 } while (0) 352 } while (0)
349 353
350 /* Declare that specifier-type TYPE has method METH; used in 354 /* Declare that specifier-type TYPE has method METH; used in
351 initialization routines */ 355 initialization routines */
571 /* The various stages of font instantiation; initial means "find a font for 575 /* The various stages of font instantiation; initial means "find a font for
572 CHARSET that matches the charset's registries" and final means "find a 576 CHARSET that matches the charset's registries" and final means "find a
573 font for CHARSET that matches iso10646-1, since we haven't found a font 577 font for CHARSET that matches iso10646-1, since we haven't found a font
574 that matches its registry." */ 578 that matches its registry." */
575 enum font_specifier_matchspec_stages { 579 enum font_specifier_matchspec_stages {
576 initial, 580 initial,
577 final, 581 final,
578 impossible, 582 impossible,
579 }; 583 };
580 584
581 Lisp_Object define_specifier_tag(Lisp_Object tag, 585 Lisp_Object define_specifier_tag(Lisp_Object tag,
582 Lisp_Object device_predicate, 586 Lisp_Object device_predicate,
583 Lisp_Object charset_predicate); 587 Lisp_Object charset_predicate);
584 588
585 #endif /* INCLUDED_specifier_h_ */ 589 #endif /* INCLUDED_specifier_h_ */