mod/maxgui.mod/fltkmaxgui.mod/src/Fl_Shared_Image.cxx
Fl_Shared_Image* Fl_Shared_Image::find(const char *n, int W, int H) {
  Fl_Shared_Image	*key,		// Image key
			**match;	// Matching image

  if (num_images_) {
    key = new Fl_Shared_Image();
    key->name_ = new char[strlen(n) + 1];
    strcpy((char *)key->name_, n);
    key->w(W);
    key->h(H);

    match = (Fl_Shared_Image **)bsearch(&key, images_, num_images_,
                                        sizeof(Fl_Shared_Image *),
                                        (compare_func_t)compare);

    delete key;

    if (match) {
      (*match)->refcount_ ++;
      return *match;
    }
  }

  return 0;
}
/** Finds a shared image from its named and size specifications */
Finds a shared image from its named and size specifications
Finds a shared image from its named and size specifications
Fl_Shared_Image* Fl_Shared_Image::find(const char *n, int W, int H) {
  Fl_Shared_Image	*key,		
			**match;	
  if (num_images_) {
    key = new Fl_Shared_Image();
    key->name_ = new char[strlen(n) + 1];
    strcpy((char *)key->name_, n);
    key->w(W);
    key->h(H);
    match = (Fl_Shared_Image **)bsearch(&key, images_, num_images_,
                                        sizeof(Fl_Shared_Image *),
                                        (compare_func_t)compare);
    delete key;
    if (match) {
      (*match)->refcount_ ++;
      return *match;
    }
  }
  return 0;
}
Fl_Shared_Image * Fl_Shared_Image :: find ( const char * n , int W , int H ) { Fl_Shared_Image * key , * * match ; if ( num_images_ ) { key = new Fl_Shared_Image ( ) ; key -> name_ = new char [ strlen ( n ) + 1 ] ; strcpy ( ( char * ) key -> name_ , n ) ; key -> w ( W ) ; key -> h ( H ) ; match = ( Fl_Shared_Image * * ) bsearch ( & key , images_ , num_images_ , sizeof ( Fl_Shared_Image * ) , ( compare_func_t ) compare ) ; delete key ; if ( match ) { ( * match ) -> refcount_ ++ ; return * match ; } } return 0 ; }
Finds a shared image from its named and size specifications
Finds a shared image from its named and size specifications
// Image key // Matching image