741{
743 DWORD start_time = 0;
752 std::string path_name;
753 char *column;
754 BOOL do_hst_file =
false;
755 std::string event_name;
757
758
760
763
769
771
773
774 if (argc == 1) {
777
780
783
787 return 1;
788 }
789 } else {
790
792 start_time = end_time - 3600;
793 interval = 1;
794 index1 = 0;
795 index2 = 0;
796 var_type = 0;
797 event_name = "";
799
800 for (
i = 1;
i < argc;
i++) {
801 if (argv[
i][0] ==
'-' && argv[
i][1] ==
'b')
803 else if (argv[
i][0] ==
'-' && argv[
i][1] ==
'l')
805 else if (argv[
i][0] ==
'-') {
807 printf(
"Error: command line switch value after \"%s\" is missing\n", argv[
i]);
809 }
else if (argv[
i+1][0] ==
'-') {
810 printf(
"Error: command line switch value after \"%s\" starts with a dash: %s\n", argv[
i], argv[
i+1]);
812 }
else if (strncmp(argv[
i],
"-e", 2) == 0) {
813 event_name = argv[++
i];
814 }
else if (strncmp(argv[
i],
"-v", 2) == 0) {
816 }
else if (strncmp(argv[
i],
"-i", 2) == 0) {
817 if ((column = strchr(argv[++
i],
':')) == NULL) {
818 index1 = atoi(argv[
i]);
819 index2 = 0;
820 } else {
821 *column = 0;
822 index1 = atoi(argv[
i]);
823 index2 = atoi(column + 1);
824 }
825 }
else if (strncmp(argv[
i],
"-h", 2) == 0) {
826 start_time =
ss_time() - atoi(argv[++
i]) * 3600;
827 }
else if (strncmp(argv[
i],
"-d", 2) == 0) {
828 start_time =
ss_time() - atoi(argv[++
i]) * 3600 * 24;
829 }
else if (strncmp(argv[
i],
"-s", 2) == 0) {
831 }
else if (strncmp(argv[
i],
"-p", 2) == 0) {
833 }
else if (strncmp(argv[
i],
"-t", 2) == 0) {
834 interval = atoi(argv[++
i]);
835 }
else if (strncmp(argv[
i],
"-f", 2) == 0) {
836 path_name = argv[++
i];
837 do_hst_file = true;
838 }
839 } else {
840 printf(
"Error: unknown command line switch: %s\n", argv[
i]);
842 }
843 }
844 }
845
846 if (do_hst_file) {
848 return 0;
849 }
850
854
857
860 printf(
"hs_connect() error %d\n",
status);
861 return 1;
862 }
863 }
864
865
866 if (list_query) {
868 }
869
871
873 }
874
875 else if (index2 == 0)
877 else
879
881
883
884 return 0;
885}
INT cm_get_experiment_database(HNDLE *hDB, HNDLE *hKeyClient)
INT cm_connect_experiment1(const char *host_name, const char *default_exp_name, const char *client_name, void(*func)(char *), INT odb_size, DWORD watchdog_timeout)
INT cm_disconnect_experiment(void)
INT cm_get_environment(char *host_name, int host_name_size, char *exp_name, int exp_name_size)
INT cm_set_msg_print(INT system_mask, INT user_mask, int(*func)(const char *))
int hs_get_history(HNDLE hDB, HNDLE hKey, int flags, int debug_flag, MidasHistoryInterface **mh)
BOOL debug
debug printouts
char host_name[HOST_NAME_LENGTH]
char expt_name[NAME_LENGTH]
static void display_all_hist(MidasHistoryInterface *mh, const char *event_name, time_t start_time, time_t end_time, time_t interval)
static void display_single_hist(MidasHistoryInterface *mh, const char *event_name, time_t start_time, time_t end_time, time_t interval, const char *var_name, int index)
static DWORD convert_time(char *t)
static INT query_params(MidasHistoryInterface *mh, std::string *event_name, DWORD *start_time, DWORD *end_time, DWORD *interval, char *var_name, DWORD *var_type, INT *var_n_data, DWORD *index)
static INT display_vars(MidasHistoryInterface *mh, time_t t)
static INT hs_fdump(const char *file_name, DWORD id, BOOL binary_time)
static void display_range_hist(MidasHistoryInterface *mh, const char *event_name, time_t start_time, time_t end_time, time_t interval, const char *var_name, int index1, int index2)