Back to index

lightning-sunbird  0.9+nobinonly
mptest-1.c
Go to the documentation of this file.
00001 /*
00002  * Simple test driver for MPI library
00003  *
00004  * Test 1: Simple input test (drives single-digit multiply and add,
00005  *         as well as I/O routines)
00006  *
00007  * ***** BEGIN LICENSE BLOCK *****
00008  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00009  *
00010  * The contents of this file are subject to the Mozilla Public License Version
00011  * 1.1 (the "License"); you may not use this file except in compliance with
00012  * the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS" basis,
00016  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00017  * for the specific language governing rights and limitations under the
00018  * License.
00019  *
00020  * The Original Code is the MPI Arbitrary Precision Integer Arithmetic library.
00021  *
00022  * The Initial Developer of the Original Code is
00023  * Michael J. Fromberger.
00024  * Portions created by the Initial Developer are Copyright (C) 1998
00025  * the Initial Developer. All Rights Reserved.
00026  *
00027  * Contributor(s):
00028  *
00029  * Alternatively, the contents of this file may be used under the terms of
00030  * either the GNU General Public License Version 2 or later (the "GPL"), or
00031  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00032  * in which case the provisions of the GPL or the LGPL are applicable instead
00033  * of those above. If you wish to allow use of your version of this file only
00034  * under the terms of either the GPL or the LGPL, and not to allow others to
00035  * use your version of this file under the terms of the MPL, indicate your
00036  * decision by deleting the provisions above and replace them with the notice
00037  * and other provisions required by the GPL or the LGPL. If you do not delete
00038  * the provisions above, a recipient may use your version of this file under
00039  * the terms of any one of the MPL, the GPL or the LGPL.
00040  *
00041  * ***** END LICENSE BLOCK ***** */
00042 /* $Id: mptest-1.c,v 1.3 2004/04/27 23:04:37 gerv%gerv.net Exp $ */
00043 
00044 #include <stdio.h>
00045 #include <stdlib.h>
00046 #include <string.h>
00047 #include <ctype.h>
00048 #include <limits.h>
00049 
00050 #ifdef MAC_CW_SIOUX
00051 #include <console.h>
00052 #endif
00053 
00054 #include "mpi.h"
00055 
00056 int main(int argc, char *argv[])
00057 {
00058   int    ix;
00059   mp_int mp;
00060 
00061 #ifdef MAC_CW_SIOUX
00062   argc = ccommand(&argv);
00063 #endif
00064 
00065   mp_init(&mp);
00066   
00067   for(ix = 1; ix < argc; ix++) {
00068     mp_read_radix(&mp, argv[ix], 10);
00069     mp_print(&mp, stdout);
00070     fputc('\n', stdout);
00071   }
00072 
00073   mp_clear(&mp);
00074   return 0;
00075 }