OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [gdb-5.0/] [utils/] [amd-udi/] [udi/] [dfe_test.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 106 markom
/******************************************************************************
2
* Copyright 1991 Advanced Micro Devices, Inc.
3
*
4
* This software is the property of Advanced Micro Devices, Inc  (AMD)  which
5
* specifically  grants the user the right to modify, use and distribute this
6
* software provided this notice is not removed or altered.  All other rights
7
* are reserved by AMD.
8
*
9
* AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
10
* SOFTWARE.  IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
11
* DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
12
* USE OF THIS SOFTWARE.
13
*
14
* So that all may benefit from your experience, please report  any  problems
15
* or  suggestions about this software to the 29K Technical Support Center at
16
* 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131  in  the  UK,  or
17
* 0031-11-1129 in Japan, toll free.  The direct dial number is 512-462-4118.
18
*
19
* Advanced Micro Devices, Inc.
20
* 29K Support Products
21
* Mail Stop 573
22
* 5900 E. Ben White Blvd.
23
* Austin, TX 78741
24
* 800-292-9263
25
*****************************************************************************
26
*       NAME    @(#)dfe_test.c  1.4 91/08/06  Daniel Mann
27
*
28
*       This module is used for testing of DFE services.
29
********************************************************************** HISTORY
30
*/
31
#include <stdio.h>
32
#include <stdio.h>
33
#include <sys/types.h>
34
#include <sys/socket.h>
35
#include <netinet/in.h>
36
#include <netdb.h>
37
#include <signal.h>
38
#include "udiproc.h"
39
 
40
extern char     dfe_errmsg[];
41
UDISessionId    SessionID;
42
int             test_errno;
43
 
44
sig_handler()
45
{
46
    printf("DFE socket shutdown\n");
47
    test_errno = UDIDisconnect(SessionID);
48
    if(test_errno)printf("DFE Error: UDIDisconnect failed\n");
49
    if(test_errno)printf("DFE errno= %d  errmsg = %s\n",
50
        test_errno, dfe_errmsg);
51
    exit();
52
}
53
 
54
/***************************************************************** MAIN
55
*/
56
main(argc, argv)
57
int     argc;
58
char*   argv[];
59
{
60
    char        *session = argv[1];
61
    char        buf[256];
62
    int         iarray[4];
63
    int         cnt;
64
 
65
    if(argc < 2)
66
    {   fprintf(stderr, "ERROR, format:\n");
67
        fprintf(stderr, "%s session_id \n", argv[0]);
68
        exit();
69
    }
70
    signal(SIGINT, sig_handler);
71
    signal(SIGQUIT, sig_handler);
72
    signal(SIGTERM, sig_handler);
73
 
74
    test_errno = UDIConnect(argv[1], &SessionID);
75
    if(test_errno)printf("Error: UDIConnect failed errno=%d\n", test_errno);
76
    if(test_errno)
77
    {   printf("%s\n", dfe_errmsg);
78
        exit(1);
79
    }
80
 
81
    for(;;)
82
    {
83
        printf("\ninput an INT ....");
84
        scanf("%d", &cnt);
85
        printf("input a word ....");
86
        scanf("%s", buf);
87
        printf("input 4 INTs (for an array)....");
88
        scanf("%d%d%d%d", &iarray[0],&iarray[1],&iarray[2], &iarray[3]);
89
        UDITest(cnt, buf, iarray);
90
    }
91
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.