ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/seed_sums.c
Revision: 1.1
Committed: Thu Jan 29 00:38:11 2009 UTC (14 years, 7 months ago) by arta
Content type: text/plain
Branch: MAIN
CVS Tags: Ver_5-0, NetDRMS_Ver_2-0a
Log Message:
Used to create drms_series.sql and drms_session.sql scripts and localizaiton.h

File Contents

# Content
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4
5 main (int argc, char **argv) {
6 unsigned long long lval, site_min, site_max;
7 short seed;
8 char *endptr;
9
10 if (argc < 2) {
11 fprintf (stderr, "Error: no site code initialization provided\n");
12 fprintf (stderr,
13 " sequence SUM_DS_INDEX_SEQ must be created before SUMS is started\n");
14 return 1;
15 }
16 lval = (unsigned long long)strtoull (argv[1], &endptr, 0);
17 if (strlen (endptr) | lval > 32767) {
18 fprintf (stderr, "Error: invalid site code provided %s for initialization\n",
19 argv[1]);
20 fprintf (stderr,
21 " sequence SUM_DS_INDEX_SEQ must be created before SUMS is started\n");
22 return 1;
23 }
24 site_min = lval << 48;
25 site_max = site_min + ((long long)1 << 48) - 1;
26 /*
27 printf ("drop sequence SUM_DS_INDEX_SEQ;\n");
28 */
29 printf ("create sequence SUM_DS_INDEX_SEQ\n");
30 printf (" increment 1\n");
31 printf (" start %ld\n", site_min);
32 printf (" minvalue %ld\n", site_min);
33 printf (" maxvalue %ld\n", site_max);
34 printf (" nocycle\n");
35 printf (" cache 10;\n");
36 return 0;
37 }