ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Search a list of functions for a particular function (for implementing function calls. Matching is done by first comparing the function's name, then the function's parameter list.

Parameters:
funcsthe list of functions to search
funthe function to search for
all_scopesif non-zero, search containing scopes too.
Returns:
pointer to found function, or NULL.

Definition at line 148 of file slang_compile_function.c.

Referenced by parse_function(), and slang_function_scope_find().

{
   unsigned int i;

   for (i = 0; i < funcs->num_functions; i++) {
      slang_function *f = &funcs->functions[i];
      const GLuint haveRetValue = 0;
#if 0
         = (f->header.type.specifier.type != SLANG_SPEC_VOID);
#endif
      unsigned int j;

      /*
      printf("Compare name %s to %s  (ret %u, %d, %d)\n",
             (char *) fun->header.a_name, (char *) f->header.a_name,
             haveRetValue,
             fun->param_count, f->param_count);
      */

      if (fun->header.a_name != f->header.a_name)
         continue;
      if (fun->param_count != f->param_count)
         continue;
      for (j = haveRetValue; j < fun->param_count; j++) {
         if (!slang_type_specifier_equal
             (&fun->parameters->variables[j]->type.specifier,
              &f->parameters->variables[j]->type.specifier))
            break;
      }
      if (j == fun->param_count) {
         /*
         printf("Found match\n");
         */
         return f;
      }
   }
   /*
   printf("Not found\n");
   */
   if (all_scopes && funcs->outer_scope != NULL)
      return slang_function_scope_find(funcs->outer_scope, fun, 1);
   return NULL;
}

Generated on Fri May 25 2012 04:57:54 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.