/usr/share/dx/samples/dxlink/sealevel.c is in dxsamples 4.2.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | #include <stdio.h>
#include "dxl.h"
#ifndef BASE
#define BASE "/usr/lpp/dx"
#endif
/*
* define an error handler
*/
void ErrorHandler(DXLConnection *conn, const char *msg, void *data)
{
printf("DXL Error: %s\n", msg);
}
main(int argc, char *argv[])
{
DXLConnection *conn = NULL;
char result[100];
/*
* Start Data Explorer in -image mode with certain menus disabled.
*/
conn = DXLStartDX("dx -image -noExitOptions -noExecuteMenus -noConnectionMenus",NULL);
if (conn == NULL)
{
fprintf(stderr,"Could not connect\n");
perror("DXLStartDX");
exit(1);
}
/*
* Set the error handler
*/
DXLSetErrorHandler(conn, ErrorHandler, NULL);
/*
* Load the visual program to run
*/
DXLLoadVisualProgram(conn, BASE"/samples/dxlink/sealevel.net");
/*
* Set the value of the DXLInput tool which is labelled
* "contour_line_value" and execute.
*/
DXLSetValue(conn, "contour_line_value", "0");
DXLExecuteOnce(conn);
/*
* Set the value of the DXLInput tool which is labelled
* "contour_line_value" and execute.
*/
DXLSetValue(conn, "contour_line_value", "2");
DXLExecuteOnce(conn);
/*
* Set the value of the DXLInput tool which is labelled
* "contour_line_value" and execute.
*/
DXLSetValue(conn, "contour_line_value", "5");
DXLExecuteOnce(conn);
/*
* Set the value of the DXLInput tool which is labelled
* "contour_line_value" and execute.
*/
DXLSetValue(conn, "contour_line_value", "20");
DXLExecuteOnce(conn);
/*
* Set the value of the DXLInput tool which is labelled
* "contour_line_value" and execute.
*/
DXLSetValue(conn, "contour_line_value", "50");
DXLExecuteOnce(conn);
printf("An image window will appear\n");
printf("and a sequence of images will be created.\n");
printf("When you are finished, hit return to quit:");
gets(result);
DXLExitDX(conn);
}
|