DCE Application Programming Guide
Sample Mixed-Language Application
HP NonStop DCE Application Programming Guide—429551-003
B-5
The Client File
Figure B-4. The Client File in a Mixed-Language Application (page 1 of 3)
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include “errmac.h”
#include “turnaround.h”
#define MAX_STR_LEN 1000000
int main(int argc, char *argv [])
{
error_status_t status;
unsigned char *pszUuid = NULL;
unsigned char *pszProtocolSequence ;
unsigned char *pszNetworkAddress ;
unsigned char *pszEndpoint = “1044”;
unsigned char *pszOptions = NULL;
unsigned char *pszStringBinding = NULL;
unsigned long transferSize = 0;
unsigned char *testString;
unsigned long currcounter = 0;
unsigned long loopCount = 0;
unsigned long iterations;
char *service;
time_t start_time;
time_t end_time;
ldiv_t avg1, avg2;
testString = malloc( MAX_STR_LEN );
/* get user input */
if ( (argc < 4) ||
(strlen(argv[1]) != 1) )
{
printf(“usage: %s [ T | C ] <message-count> <message-length>\n”,
argv[0] );
exit(1);
}
}
service = argv[1];
if ( (*service != ‘T’) &&
(*service != ‘C’) )
{
printf(“usage: %s [ T | C ] <message-count> <message-length>\n”,
argv[0] );
exit(1);
}
loopCount = atol( argv[2] );
transferSize = atol( argv[3] );
if (transferSize > MAX_STR_LEN)
{
printf(“Message length must be <= %ld.\n”, MAX_STR_LEN);
exit(1);
}