bridge/class-master/depend/pari/src/gp/whatnow.c
/* If flag = 0 (default): check if s existed in 1.39.15 and print verbosely
 * the answer.
 * Else: return 1 if function changed, 0 otherwise, and print help message
 * plus the above. */
If flag = 0 (default): check if s existed in 1.39.15 and print verbosely
the answer.
Else: return 1 if function changed, 0 otherwise, and print help message
plus the above.
If flag = 0 ( default ) : check if s existed in 1 . 39 . 15 and print verbosely the answer . Else : return 1 if function changed 0 otherwise and print help message plus the above .
int
whatnow(PariOUT *out, const char *s, int flag)
{
  const char *def;
  const whatnow_t *wp = whatnowlist;
  entree *ep;
  while (wp->old && strcmp(wp->old,s)) wp++;
  if (!wp->old)
  {
    if (!flag)
      msg(out, "As far as I can recall, this function never existed");
    return 0;
  }
  def = wp->name;
  if (def == SAME)
  {
    if (!flag)
      msg(out, "This function did not change");
    return 0;
  }
  if (flag)
  {
    out_term_color(out, c_NONE);
    out_print_text(out, "\nA function with that name existed in GP-1.39.15. Please update your script.");
    out_putc(out, '\n');
  }
  if (def == REMOV)
  {
    msg(out, "This function no longer exists");
    return 0;
  }
  if (!strcmp(def,"x*y")) def = "_*_";
  ep = is_entry(def);
  if (!ep) pari_err_BUG("whatnow");
  out_puts(out, "New syntax: ");
  out_term_color(out, c_ERR);
  out_printf(out, "%s%s ===> %s%s\n\n", s, wp->oldarg, wp->name, wp->newarg);
  msg(out, ep->help);
  out_term_color(out, c_NONE); return 1;
}
int whatnow ( PariOUT * out , const char * s , int flag ) { const char * def ; const whatnow_t * wp = whatnowlist ; entree * ep ; while ( wp -> old && strcmp ( wp -> old , s ) ) wp ++ ; if ( ! wp -> old ) { if ( ! flag ) msg ( out , " " ) ; return 0 ; } def = wp -> name ; if ( def == SAME ) { if ( ! flag ) msg ( out , " " ) ; return 0 ; } if ( flag ) { out_term_color ( out , c_NONE ) ; out_print_text ( out , " \n " ) ; out_putc ( out , ' \n ' ) ; } if ( def == REMOV ) { msg ( out , " " ) ; return 0 ; } if ( ! strcmp ( def , " " ) ) def = " " ; ep = is_entry ( def ) ; if ( ! ep ) pari_err_BUG ( " " ) ; out_puts ( out , " " ) ; out_term_color ( out , c_ERR ) ; out_printf ( out , " \n \n " , s , wp -> oldarg , wp -> name , wp -> newarg ) ; msg ( out , ep -> help ) ; out_term_color ( out , c_NONE ) ; return 1 ; }
If flag = 0 (default): check if s existed in 1.39.15 and print verbosely
 the answer.
If flag = 0 ( default ) : check if s existed in 1 . 39 . 15 and print verbosely the answer .
/* Above linear search is slow, esp. if the symbol is not found. BUT no
   * point in wasting time by preallocating [ or autoloading ] a hashtable:
   * whatnow() is never used in a case where speed would be necessary */ /* special case compimag -> x*y */