From f45b17973c3a82dc2897c239b2ef4e6507c82d1a Mon Sep 17 00:00:00 2001 From: steve Date: Tue, 11 Jun 2002 15:19:12 +0000 Subject: [PATCH] Add acc_fetch_argc/argv/version (mruff) --- acc_user.h | 10 ++++++++- libveriuser/Makefile.in | 7 +++--- libveriuser/a_fetch_argc.c | 46 ++++++++++++++++++++++++++++++++++++++ libveriuser/a_fetch_argv.c | 46 ++++++++++++++++++++++++++++++++++++++ libveriuser/a_version.c | 40 +++++++++++++++++++++++++++++++++ 5 files changed, 145 insertions(+), 4 deletions(-) create mode 100644 libveriuser/a_fetch_argc.c create mode 100644 libveriuser/a_fetch_argv.c create mode 100644 libveriuser/a_version.c diff --git a/acc_user.h b/acc_user.h index fb4061be6..8a47a7095 100644 --- a/acc_user.h +++ b/acc_user.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: acc_user.h,v 1.4 2002/06/07 02:58:58 steve Exp $" +#ident "$Id: acc_user.h,v 1.5 2002/06/11 15:19:12 steve Exp $" #endif /* @@ -111,6 +111,9 @@ extern int acc_initialize(void); extern void acc_close(void); +extern int acc_fetch_argc(void); +extern char**acc_fetch_argv(void); + extern char* acc_fetch_fullname(handle obj); extern int acc_fetch_tfarg_int(int n); @@ -127,10 +130,15 @@ extern char*acc_product_version(void); extern int acc_set_value(handle obj, p_setval_value value, p_setval_delay delay); +extern char* acc_version(void); + EXTERN_C_END /* * $Log: acc_user.h,v $ + * Revision 1.5 2002/06/11 15:19:12 steve + * Add acc_fetch_argc/argv/version (mruff) + * * Revision 1.4 2002/06/07 02:58:58 steve * Add a bunch of acc/tf functions. (mruff) * diff --git a/libveriuser/Makefile.in b/libveriuser/Makefile.in index aa0308d4c..bdfbaafe7 100644 --- a/libveriuser/Makefile.in +++ b/libveriuser/Makefile.in @@ -16,7 +16,7 @@ # 59 Temple Place - Suite 330 # Boston, MA 02111-1307, USA # -#ident "$Id: Makefile.in,v 1.13 2002/06/07 16:21:13 steve Exp $" +#ident "$Id: Makefile.in,v 1.14 2002/06/11 15:19:12 steve Exp $" # # SHELL = /bin/sh @@ -44,9 +44,10 @@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ STRIP = @STRIP@ -A = a_close.o a_fetch_fullname.o a_fetch_tfarg.o a_handle_tfarg.o \ +A = a_close.o a_fetch_argc.o a_fetch_argv.o a_fetch_fullname.o \ +a_fetch_tfarg.o a_handle_tfarg.o \ a_initialize.o a_next_topmod.o a_object_of_type.o a_product_version.o \ -a_set_value.o +a_set_value.o a_version.o O = asynch.o finish.o getcstringp.o getinstance.o getlongp.o \ getp.o getsimtime.o io_print.o mc_scan_plusargs.o nump.o putlongp.o \ putp.o veriusertfs.o $A diff --git a/libveriuser/a_fetch_argc.c b/libveriuser/a_fetch_argc.c new file mode 100644 index 000000000..a0a0db6a8 --- /dev/null +++ b/libveriuser/a_fetch_argc.c @@ -0,0 +1,46 @@ +/* vi:sw=6 + * Copyright (c) 2002 Michael Ruff (mruff at chiaro.com) + * + * This source code is free software; you can redistribute it + * and/or modify it in source code form under the terms of the GNU + * General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#if !defined(WINNT) +#ident "$Id: a_fetch_argc.c,v 1.1 2002/06/11 15:19:12 steve Exp $" +#endif + +# include +# include + +/* + * acc_fetch_argc implemented using VPI interface + */ +int acc_fetch_argc(void) +{ + s_vpi_vlog_info vpi_vlog_info; + + /* get command line info */ + if (! vpi_get_vlog_info(&vpi_vlog_info)) + return 0; + + /* return argc */ + return vpi_vlog_info.argc; +} + +/* + * $Log: a_fetch_argc.c,v $ + * Revision 1.1 2002/06/11 15:19:12 steve + * Add acc_fetch_argc/argv/version (mruff) + * + */ diff --git a/libveriuser/a_fetch_argv.c b/libveriuser/a_fetch_argv.c new file mode 100644 index 000000000..a19a1a8ef --- /dev/null +++ b/libveriuser/a_fetch_argv.c @@ -0,0 +1,46 @@ +/* vi:sw=6 + * Copyright (c) 2002 Michael Ruff (mruff at chiaro.com) + * + * This source code is free software; you can redistribute it + * and/or modify it in source code form under the terms of the GNU + * General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#if !defined(WINNT) +#ident "$Id: a_fetch_argv.c,v 1.1 2002/06/11 15:19:12 steve Exp $" +#endif + +# include +# include + +/* + * acc_fetch_argv implemented using VPI interface + */ +char **acc_fetch_argv(void) +{ + s_vpi_vlog_info vpi_vlog_info; + + /* get command line info */ + if (! vpi_get_vlog_info(&vpi_vlog_info)) + return (char **)0; + + /* return argc */ + return vpi_vlog_info.argv; +} + +/* + * $Log: a_fetch_argv.c,v $ + * Revision 1.1 2002/06/11 15:19:12 steve + * Add acc_fetch_argc/argv/version (mruff) + * + */ diff --git a/libveriuser/a_version.c b/libveriuser/a_version.c new file mode 100644 index 000000000..ddcac0de9 --- /dev/null +++ b/libveriuser/a_version.c @@ -0,0 +1,40 @@ +/* vi:sw=6 + * Copyright (c) 2002 Michael Ruff (mruff at chiaro.com) + * + * This source code is free software; you can redistribute it + * and/or modify it in source code form under the terms of the GNU + * General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#if !defined(WINNT) +#ident "$Id: a_version.c,v 1.1 2002/06/11 15:19:12 steve Exp $" +#endif + +# include +# include + +char *acc_version(void) +{ + s_vpi_vlog_info info; + + if (! vpi_get_vlog_info(&info)) return (char *)0; + + return info.version; +} + +/* + * $Log: a_version.c,v $ + * Revision 1.1 2002/06/11 15:19:12 steve + * Add acc_fetch_argc/argv/version (mruff) + * + */