/usr/lib/xtrkcad/params/mkstruct.c is in xtrkcad 1:4.0.2-2+b1.
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 | #include <stdio.h>
#include <stdlib.h>
#ifndef WINDOWS
#include <string.h>
#endif
int main ( int argc, char * argv [] )
{
long color = 0xFF00FF;
double x;
double y;
int cm = 0;
while (argc > 1 && argv[1][0] == '-' ) {
if ( strcmp( argv[1], "-cm" ) == 0 ) {
cm++;
argv++;
argc--;
} else if ( strncmp( argv[1], "-color=", strlen( "-color=" ) ) == 0 ) {
color = strtol( argv[1]+strlen( "-color=" ), NULL, 16 );
argv++;
argc--;
} else {
fprintf( stderr, "Unrecognized option: %s\n", argv[1] );
exit(1);
}
}
if ( argc != 5 ) {
fprintf( stderr, "Usage: mkstruct [-cm] SCALE NAME X Y\n" );
exit(1);
}
x = atof( argv[4] );
y = atof( argv[3] );
if (cm) {
x /= 2.54;
y /= 2.54;
}
printf("STRUCTURE %s \"%s\"\n", argv[1], argv[2] );
printf("\tL %ld 0 %0.6f %0.6f %0.6f %0.6f\n", color, 0.0, 0.0, 0.0, x );
printf("\tL %ld 0 %0.6f %0.6f %0.6f %0.6f\n", color, 0.0, x, y, x );
printf("\tL %ld 0 %0.6f %0.6f %0.6f %0.6f\n", color, y, x, y, 0.0 );
printf("\tL %ld 0 %0.6f %0.6f %0.6f %0.6f\n", color, y, 0.0, 0.0, 0.0 );
printf("\tEND\n");
exit(0);
}
|