Lines Matching defs:feature

219    `feature`, located at `offset` in $LOADED_FEATURES.  We add an
221 feature == "#{prefix}#{short_feature}#{e}"
227 features_index_add(VALUE feature, VALUE offset)
232 feature_str = StringValuePtr(feature);
233 feature_end = feature_str + RSTRING_LEN(feature);
241 at the end of `feature`, or is NULL if there is no such string. */
250 /* Now *p == '/'. We reach this point for every '/' in `feature`. */
251 short_feature = rb_str_subseq(feature, p + 1 - feature_str, feature_end - p - 1);
254 short_feature = rb_str_subseq(feature, p + 1 - feature_str, ext - p - 1);
258 features_index_add_single(feature, offset);
260 short_feature = rb_str_subseq(feature, 0, ext - feature_str);
299 name == "#{load_path[i]}/#{feature}"
300 if `feature` is a suffix of `name`, or otherwise
301 name == "#{load_path[i]}/#{feature}#{ext}"
310 loaded_feature_path(const char *name, long vlen, const char *feature, long len,
318 if (!strncmp(name+(vlen-len), feature, len)) {
325 strncmp(e-len, feature, len))
337 /* Now name == "#{prefix}/#{feature}#{ext}" where ext is acceptable
374 rb_feature_p(const char *feature, const char *ext, int rb, int expanded, const char **fn)
386 len = strlen(feature) - elen;
390 len = strlen(feature);
397 st_lookup(features_index, (st_data_t)feature, (st_data_t *)&this_feature_index);
399 "#{features[i]}" == "#{load_path[j]}/#{feature}#{e}"
401 "#{features[i]}" == "#{feature}#{e}"
411 "#{features[i2]}" == "#{load_path[j2]}/#{feature}#{e2}"
414 form "#{feature}#{e}" are accepted.
419 "#{prefix}#{feature}#{e}"
440 if (strncmp(f, feature, len) != 0) {
443 if (!(p = loaded_feature_path(f, n, feature, len, type, load_path)))
466 fs.name = feature;
477 if (st_get_key(loading_tbl, (st_data_t)feature, &data)) {
493 MEMCPY(buf, feature, char, len);
517 rb_provided(const char *feature)
519 return rb_feature_provided(feature, 0);
523 rb_feature_provided(const char *feature, const char **loading)
525 const char *ext = strrchr(feature, '.');
528 if (*feature == '.' &&
529 (feature[1] == '/' || strncmp(feature+1, "./", 2) == 0)) {
530 fullpath = rb_file_expand_path_fast(rb_get_path(rb_str_new2(feature)), Qnil);
531 feature = RSTRING_PTR(fullpath);
535 if (rb_feature_p(feature, ext, TRUE, FALSE, loading)) return TRUE;
539 if (rb_feature_p(feature, ext, FALSE, FALSE, loading)) return TRUE;
543 if (rb_feature_p(feature, 0, TRUE, FALSE, loading))
549 rb_provide_feature(VALUE feature)
556 "$LOADED_FEATURES is frozen; cannot append feature");
558 rb_str_freeze(feature);
560 rb_ary_push(features, feature);
561 features_index_add(feature, INT2FIX(RARRAY_LEN(features)-1));
566 rb_provide(const char *feature)
568 rb_provide_feature(rb_usascii_str_new2(feature));
774 * feature is already loaded.