/*
 * Copyright (C) 1986-1999 Micro Focus International Ltd. All rights reserved.
 *  
 * This demonstration program is provided for use by users of 
 * Micro Focus products (the "Software") and may be used, 
 * modified and distributed as part of your application provided 
 * that you properly acknowledge the copyright of Micro Focus in this
 * material.
 *     
 * All conditions, warranties and undertakings, express or implied, 
 * statutory or otherwise, on the part of Micro Focus are excluded, 
 * including without limitation those of merchantability or fitness  
 * for purpose. This shall not, however, purport to exclude or 
 * restrict the liability of Micro Focus to any extent not 
 * permitted by law.
 *
 * IN NO EVENT WILL MICRO FOCUS BE LIABLE FOR ANY INDIRECT, 
 * INCIDENTAL, SPECIAL, CONSEQUENTIAL OR OTHER DAMAGES ARISING OUT 
 * OF THE USE OF THE DEMONSTRATION PROGRAM DISTRIBUTED WITH THE 
 * SOFTWARE, WHETHER OR NOT INFORMED OF THE POSSIBILITIES OF 
 * DAMAGES IN ADVANCE.  THESE LIMITATIONS APPLY TO ALL CAUSES OF 
 * ACTION, INCLUDING BREACH OF CONTRACT, BREACH OF WARRANTY, STRICT
 * LIABILITY, AND ANY ACTIONS IN TORTS.
 ************************************************************************
 *
 * Start of source module cxxsub1.C
 *
 ************************************************************************/


#include <stdio.h>
#include <string.h>

extern "C"
int cplusfunc(int a, float *b, long *c, char *d, double *e)
{
    int result = 0;

    if(a == -10)
    {
	printf("int passed correctly\n");
    }
    else
    {
	printf("int failed\n");
	result++;
    }

    if(*b == 10.5)
    {
	printf("float passed correctly\n");
    }
    else
    {
	printf("float failed\n");
	result++;
    }

    if(*c == 10)
    {
	printf("long passed correctly\n");
    }
    else
    {
	printf("long failed\n");
	result++;
    }

    if(strcmp(d, "abcdefghijklmnopqrst") == 0)
    {
	printf("char * passed correctly\n");
    }
    else
    {
	printf("char * failed\n");
	result++;
    }

    if(*e == 9999)
    {
	printf("double passed correctly\n");
    }
    else
    {
	printf("double failed\n");
	result++;
    }

    return(result);
}
