# include # include # include # include "ppc_truss.h" # include "ppc_truss_io.h" # include "ppc_truss_to_eps.h" int main ( ); void timestamp ( ); /******************************************************************************/ int main ( ) /******************************************************************************/ /* Purpose: ppc_truss_io_test() tests ppc_truss_io(). Licensing: This code is distributed under the MIT license. Modified: 16 May 2024 Author: John Burkardt */ { struct truss *truss; timestamp ( ); printf ( "\n" ); printf ( "ppc_truss_io_test():\n" ); printf ( " C version\n" ); printf ( " Test ppc_truss_io(), to read, plot, and write\n" ); printf ( " a truss structure file.\n" ); if ( ( truss = read_truss ( stdin ) ) == NULL ) { return EXIT_FAILURE; } ppc_truss_to_eps ( truss, "z_with_labels.eps", TR_PLOT_WITH_LABELS ); ppc_truss_to_eps ( truss, "z_with_no_labels.eps", TR_PLOT_WITH_NO_LABELS ); write_truss ( truss, "copy.tdf" ); free_truss ( truss ); /* Terminate. */ printf ( "\n" ); printf ( "ppc_truss_io_test():\n" ); printf ( " Normal end of execution.\n" ); timestamp ( ); return EXIT_SUCCESS; } /******************************************************************************/ void timestamp ( ) /******************************************************************************/ /* Purpose: timestamp() prints the current YMDHMS date as a time stamp. Example: 17 June 2014 09:45:54 AM Licensing: This code is distributed under the MIT license. Modified: 01 May 2021 Author: John Burkardt */ { # define TIME_SIZE 40 static char time_buffer[TIME_SIZE]; const struct tm *tm; time_t now; now = time ( NULL ); tm = localtime ( &now ); strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm ); printf ( "%s\n", time_buffer ); return; # undef TIME_SIZE }