Testing latest pari + WASM + node.js... and it works?! Wow.
License: GPL3
ubuntu2004
/* Copyright (C) 2000 The PARI group.12This file is part of the PARI/GP package.34PARI/GP is free software; you can redistribute it and/or modify it under the5terms of the GNU General Public License as published by the Free Software6Foundation; either version 2 of the License, or (at your option) any later7version. It is distributed in the hope that it will be useful, but WITHOUT8ANY WARRANTY WHATSOEVER.910Check the License for details. You should have received a copy of it, along11with the package; see the file 'COPYING'. If not, write to the Free Software12Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */1314#include "pari.h"15#include "paripriv.h"16#include "gp.h"17#include "whatnow.h"1819static void20msg(PariOUT *out, const char *s)21{22out_term_color(out, c_HELP);23out_print_text(out, s);24out_putc(out, '\n');25out_term_color(out, c_NONE);26}27/* If flag = 0 (default): check if s existed in 1.39.15 and print verbosely28* the answer.29* Else: return 1 if function changed, 0 otherwise, and print help message30* plus the above. */31int32whatnow(PariOUT *out, const char *s, int flag)33{34const char *def;35const whatnow_t *wp = whatnowlist;36entree *ep;3738while (wp->old && strcmp(wp->old,s)) wp++;39/* Above linear search is slow, esp. if the symbol is not found. BUT no40* point in wasting time by preallocating [ or autoloading ] a hashtable:41* whatnow() is never used in a case where speed would be necessary */42if (!wp->old)43{44if (!flag) msg(out, "This function did not exist in Pari 1.39");45return 0;46}47def = wp->name;48if (def == SAME)49{50if (!flag)51msg(out, "This function did not change");52return 0;53}54if (flag)55{56out_term_color(out, c_NONE);57out_print_text(out, "\nA function with that name existed in GP-1.39.15. Please update your script.");58out_putc(out, '\n');59}6061if (def == REMOV)62{63msg(out, "This function no longer exists");64return 0;65}66/* special case compimag -> x*y */67if (!strcmp(def,"x*y")) def = "_*_";68ep = is_entry(def);69if (!ep) pari_err_BUG("whatnow");70out_puts(out, "New syntax: ");71out_term_color(out, c_ERR);72out_printf(out, "%s%s ===> %s%s\n\n", s, wp->oldarg, wp->name, wp->newarg);73msg(out, ep->help);74out_term_color(out, c_NONE); return 1;75}767778