32int f_radware_out1d(
char *pc_file,
char *pc_name,
float *pr_data,
int l_chan,
int l_over)
34 int i32_fd, i32_bytes, i32_hislen;
41 strncat(c_str, pc_file,
sizeof(c_str)-1);
44i32_fd = open(pc_file, O_WRONLY | O_CREAT | O_EXCL,
HIS__BASPERM);
47 printf(
"Error %d opening file %s, already exists?\n",errno, pc_file);
51strncpy(c_str,pc_name,
sizeof(c_str));
52strncat(c_str,
" ",
sizeof(c_str)-1);
60i32_bytes = write(i32_fd, (
char *) l_head, 4);
61i32_bytes += write(i32_fd, c_str, 8);
63i32_bytes += write(i32_fd, (
char *) l_head, 24);
65i32_bytes += write(i32_fd, (
char *) pr_data, l_chan*4);
67i32_bytes += write(i32_fd, (
char *) l_head, 4);
69i32_hislen = l_chan*4 + 40;
70if (i32_bytes == i32_hislen)
77 printf(
"Error %d. Dumping histogram:%s, %d bytes written to %s\n",
78 errno,pc_name,i32_bytes,pc_file);
83 printf(
"Error %d. Close %s failed!\n",errno,pc_file);
89int f_radware_out2d(
char *pc_file,
char *pc_name,
int *pl_data,
int l_chan,
int l_over)
91 int i32_fd, i32_bytes;
98 strncat(c_str,pc_file,
sizeof(c_str)-1);
101i32_fd = open(pc_file, O_WRONLY | O_CREAT | O_EXCL,
HIS__BASPERM);
104 printf(
"Error %d opening file %s, already exists?\n",errno, pc_file);
107i32_bytes = write(i32_fd, (
char *) pl_data, l_chan*4);
108if (i32_bytes == l_chan*4)
115 printf(
"Error %d. Dumping histogram:%s, only %d bytes written to %s\n",
116 errno,pc_name,i32_bytes,pc_file);
121 printf(
"Error %d. Close %s failed!\n",errno,pc_file);