ReactOS  0.4.13-dev-455-g28ed234
rgenstat.c
Go to the documentation of this file.
1 /*
2  * Generate a file with API status information from a list
3  * of files in a directory.
4  * Casper S. Hornstrup <chorns@users.sourceforge.net>
5  */
6 
7 #include <stdio.h>
8 #include <fcntl.h>
9 #include <sys/stat.h>
10 #include <stdlib.h>
11 #include <string.h>
12 
13 #ifdef WIN32
14 #include <io.h>
15 #include <dos.h>
16 #include <windows.h>
17 int __cdecl strcasecmp (const char * __sz1, const char * __sz2)
18  {return _stricmp (__sz1, __sz2);}
19 #else
20 #if !defined(__FreeBSD__) && !defined(__APPLE__)
21 #include <sys/io.h>
22 #endif
23 #include <errno.h>
24 #include <sys/types.h>
25 #include <dirent.h>
26 #include <unistd.h>
27 #endif
28 #include <ctype.h>
29 #ifndef WIN32
30 #ifndef MAX_PATH
31 #define MAX_PATH 260
32 #endif
33 #define DIR_SEPARATOR_CHAR '/'
34 #define DIR_SEPARATOR_STRING "/"
35 #else
36 #define DIR_SEPARATOR_CHAR '\\'
37 #define DIR_SEPARATOR_STRING "\\"
38 #endif
39 
40 #define TAG_UNKNOWN -1
41 #define TAG_IMPLEMENTED 0
42 #define TAG_UNIMPLEMENTED 1
43 
44 typedef struct _API_INFO
45 {
46  struct _API_INFO *next;
47  int tag_id;
48  char name[100];
51 
52 
54  unsigned, int (*)(PAPI_INFO, PAPI_INFO));
55 
56 
57 static FILE *in;
58 static FILE *out;
59 static FILE *file_handle = NULL;
60 static char *file_buffer = NULL;
61 static unsigned int file_size = 0;
62 static unsigned int file_pointer = 0;
63 static char tagname[200];
65 
66 
67 static char*
68 convert_path(char* origpath)
69 {
70  char* newpath;
71  int i;
72 
73  newpath = strdup(origpath);
74 
75  i = 0;
76  while (newpath[i] != 0)
77  {
78 #ifndef WIN32
79  if (newpath[i] == '\\')
80  {
81  newpath[i] = '/';
82  }
83 #else
84 #ifdef WIN32
85  if (newpath[i] == '/')
86  {
87  newpath[i] = '\\';
88  }
89 #endif
90 #endif
91  i++;
92  }
93  return(newpath);
94 }
95 
96 static char*
98 {
99  int i;
100 
101  i = 0;
102  while (path[i] != 0)
103  {
104  if (path[i] == '\\')
105  {
106  path[i] = '/';
107  }
108  i++;
109  }
110  return(path);
111 }
112 
113 static void
115 {
116  char buf[200];
117 
118  memset(buf, 0, sizeof(buf));
119  strcpy(buf, line);
120  /* Terminate the line */
121  buf[strlen(buf)] = '\r';
122  buf[strlen(buf)] = '\n';
123 
124  (void)fwrite(&buf[0], 1, strlen(buf), out);
125 }
126 
127 
128 static void
130 {
131  file_handle = fopen(filename, "rb");
132  if (file_handle == NULL)
133  {
134  printf("Can't open %s\n", filename);
135  exit(1);
136  }
137 
138  // Get the size of the file
141 
142  // Load it all into memory
144  if (file_buffer == NULL)
145  {
147  printf("Out of memory\n");
148  exit(1);
149  }
151  if (file_size > 0)
152  {
153  if (fread (file_buffer, 1, file_size, file_handle) < 1)
154  {
156  printf("Read error in file %s\n", filename);
157  exit(1);
158  }
159  }
160 
161  file_pointer = 0;
162 }
163 
164 static void
166 {
167  free(file_buffer);
168  file_buffer = NULL;
170  file_handle = NULL;
171  file_pointer = 0;
172 }
173 
174 static int
176 {
177  if (ch == ' ')
178  {
179  return 1;
180  }
181  if (ch == '\t')
182  {
183  return 1;
184  }
185  return 0;
186 }
187 
188 static int
189 is_eol_char(char ch)
190 {
191  if (ch == '\r')
192  {
193  return 1;
194  }
195  if (ch == '\n')
196  {
197  return 1;
198  }
199  return 0;
200 }
201 
202 static int
204 {
205  if ((ch >= 'a') && (ch <= 'z'))
206  {
207  return 0;
208  }
209  if ((ch >= 'A') && (ch <= 'Z'))
210  {
211  return 0;
212  }
213  if ((ch >= '0') && (ch <= '9'))
214  {
215  return 0;
216  }
217  if (ch == '_')
218  {
219  return 0;
220  }
221  return 1;
222 }
223 
224 static int
226 {
227  /* Currently the same as is_end_of_tag() */
228  return is_end_of_tag(ch);
229 }
230 
231 static int
233 {
234  char ext[MAX_PATH];
235  int i;
236 
237  i = strlen(filename);
238  while (i > 0 && filename[i] != '.')
239  {
240  i--;
241  }
242  if (i > 0)
243  {
244  memset(ext, 0, sizeof(ext));
245  strncpy(&ext[0], &filename[i], strlen(&filename[i]));
246 
247  if ((strncmp(ext, ".c", 2) == 0) || (strncmp(ext, ".C", 2) == 0))
248  {
249  return 1;
250  }
251  }
252  return 0;
253 }
254 
255 static int
257 {
258  if (strcasecmp(tag, "implemented") == 0)
259  {
260  return TAG_IMPLEMENTED;
261  }
262  if (strcasecmp(tag, "unimplemented") == 0)
263  {
264  return TAG_UNIMPLEMENTED;
265  }
266  return TAG_UNKNOWN;
267 }
268 
269 static int
271 {
272  unsigned int start;
273  int end_of_tag;
274  int found_tag = 0;
275  int tag_id;
276  int len;
277 
278  tagname[0] = 0;
279  while ((file_pointer < file_size) && (!found_tag))
280  {
281  if (file_buffer[file_pointer] == '@')
282  {
283  file_pointer++;
285  end_of_tag = 0;
286  while ((file_pointer < file_size) && (!end_of_tag))
287  {
288  end_of_tag = is_end_of_tag(file_buffer[file_pointer]);
289  file_pointer++;
290  }
291  len = file_pointer > start ? file_pointer - start - 1 : 0;
293  tagname[len] = 0;
294 
296  if (tag_id != TAG_UNKNOWN)
297  {
298  return tag_id;
299  }
300  }
301  file_pointer++;
302  }
303 
304  return TAG_UNKNOWN;
305 }
306 
307 static void
309 {
311  {
312  file_pointer++;
313  }
314  if ((file_pointer < file_size) && (file_buffer[file_pointer] == '\n'))
315  {
316  file_pointer++;
317  }
318 }
319 
320 static void
322 {
323  while ((file_pointer < file_size))
324  {
325  if (file_buffer[file_pointer] == '*')
326  {
327  if ((file_pointer + 1 < file_size))
328  {
329  if (file_buffer[file_pointer + 1] == '/')
330  {
331  skip_line();
332  return;
333  }
334  }
335  }
336  file_pointer++;
337  }
338 }
339 
340 static int
341 get_previous_identifier(unsigned int end, char *name)
342 {
343  unsigned int my_file_pointer = end;
344  int len;
345 
346  name[0] = 0;
347 
348  while ((my_file_pointer > 0) && (is_whitespace(file_buffer[my_file_pointer])
349  || is_eol_char(file_buffer[my_file_pointer])))
350  {
351  my_file_pointer--;
352  }
353 
354  /* Skip any comments between function name and it's parameters */
355  if ((my_file_pointer > 0) && (file_buffer[my_file_pointer] == '/'))
356  {
357  if ((my_file_pointer > 0) && (file_buffer[my_file_pointer - 1] == '*'))
358  {
359  my_file_pointer--;
360  while ((my_file_pointer > 0) && !((file_buffer[my_file_pointer] == '*')
361  && (file_buffer[my_file_pointer - 1] == '/')))
362  {
363  my_file_pointer--;
364  }
365  my_file_pointer -= 2;
366  }
367  }
368 
369  /* Skip any remaining whitespace */
370  while ((my_file_pointer > 0) && (is_whitespace(file_buffer[my_file_pointer])))
371  {
372  my_file_pointer--;
373  }
374 
375  end = my_file_pointer;
376  while ((my_file_pointer > 0))
377  {
378  if (is_end_of_name(file_buffer[my_file_pointer]))
379  {
380  len = end - my_file_pointer;
381  strncpy(name, &file_buffer[my_file_pointer + 1], len);
382  name[len] = 0;
383  return 1;
384  }
385  my_file_pointer--;
386  }
387 
388  return 0;
389 }
390 
391 static int
393 {
394  while ((file_pointer < file_size))
395  {
396  if (file_buffer[file_pointer] == '(')
397  {
399  }
400  file_pointer++;
401  }
402  return 0;
403 }
404 
405 // Build a path and filename so it is of the format [module][directory][filename].
406 // Also convert all backslashes into forward slashes.
407 static void
408 get_filename(char *cvspath, char *filename, char *result)
409 {
410  strcpy(result, cvspath);
413 }
414 
415 static void
416 parse_file(char *fullname, char *cvspath, char *filename)
417 {
418  PAPI_INFO api_info;
419  char prev[200];
420  char name[200];
421  int tag_id;
422 
423  read_file(fullname);
424 
425  prev[0] = 0;
426  do
427  {
429  if (tag_id == TAG_UNKNOWN)
430  {
431  break;
432  }
433 
434  /* Skip rest of the comments between the tag and the function name */
435  skip_comments();
436 
437  if (skip_to_next_name(name))
438  {
439  if (strlen(name) == 0)
440  {
441  printf("Warning: empty function name in file %s. Previous function name was %s.\n",
442  fullname, prev);
443  }
444  api_info = malloc(sizeof(API_INFO));
445  if (api_info == NULL)
446  {
447  printf("Out of memory\n");
448  exit(1);
449  }
450 
451  api_info->tag_id = tag_id;
452  strcpy(api_info->name, name);
453 
454  get_filename(cvspath, filename, api_info->filename);
455 
456  api_info->next = api_info_list;
457  api_info_list = api_info;
458  strcpy(prev, name);
459  }
460  } while (1);
461 
462  close_file();
463 }
464 
465 #ifdef WIN32
466 
467 /* Win32 version */
468 static void
469 process_directory (char *path, char *cvspath)
470 {
471  struct _finddata_t f;
472  int findhandle;
473  char searchbuf[MAX_PATH];
474  char buf[MAX_PATH];
475  char newcvspath[MAX_PATH];
476 
477  strcpy(searchbuf, path);
478  strcat(searchbuf, "*.*");
479 
480  findhandle =_findfirst(searchbuf, &f);
481  if (findhandle != -1)
482  {
483  do
484  {
485  if (f.attrib & _A_SUBDIR)
486  {
487  if (f.name[0] != '.')
488  {
489  strcpy(buf, path);
490  strcat(buf, f.name);
492 
493  strcpy(newcvspath, cvspath);
494  strcat(newcvspath, f.name);
495  strcat(newcvspath, "/");
496 
497  process_directory(buf, newcvspath);
498  }
499  continue;
500  }
501 
502  strcpy(buf, path);
503  strcat(buf, f.name);
504 
505  /* Must be a .c file */
506  if (!is_valid_file(buf))
507  {
508  continue;
509  }
510 
511  parse_file(buf, cvspath, f.name);
512  }
513  while (_findnext(findhandle, &f) == 0);
514  _findclose(findhandle);
515  }
516  else
517  {
518  printf("Cannot open directory '%s'", path);
519  exit(1);
520  }
521 }
522 
523 #else
524 
525 /* Linux version */
526 static void
527 process_directory (char *path, char *cvspath)
528 {
529  DIR *dirp;
530  struct dirent *entry;
531  struct stat stbuf;
532  char buf[MAX_PATH];
533  char newcvspath[MAX_PATH];
534 
535 #ifdef HAVE_D_TYPE
536  dirp = opendir(path);
537  if (dirp != NULL)
538  {
539  while ((entry = readdir(dirp)) != NULL)
540  {
541  if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
542  continue; // skip self and parent
543 
544  if (entry->d_type == DT_REG) // normal file
545  {
546  // Check for an absolute path
547  if (path[0] == DIR_SEPARATOR_CHAR)
548  {
549  strcpy(buf, path);
551  strcat(buf, entry->d_name);
552  }
553  else
554  {
555  if (!getcwd(buf, sizeof(buf)))
556  {
557  printf("Can't get CWD: %s\n", strerror(errno));
558  return;
559  }
561  strcat(buf, path);
562  strcat(buf, entry->d_name);
563  }
564 
565  if (stat(buf, &stbuf) == -1)
566  {
567  printf("Can't access '%s' (%s)\n", buf, strerror(errno));
568  return;
569  }
570 
571  if (S_ISDIR(stbuf.st_mode))
572  {
573  strcpy(newcvspath, cvspath);
574  strcat(newcvspath, f.name);
575  strcat(newcvspath, "/");
576 
577  process_directory(buf, newcvspath);
578  continue;
579  }
580 
581  /* Must be a .c file */
582  if (!is_valid_file(buf))
583  {
584  continue;
585  }
586 
587  parse_file(buf, cvspath, entry->d_name);
588  }
589  }
590  closedir(dirp);
591  }
592  else
593  {
594  printf("Can't open %s\n", path);
595  exit(1);
596  }
597 
598 #else
599 
600  dirp = opendir(path);
601  if (dirp != NULL)
602  {
603  while ((entry = readdir(dirp)) != NULL)
604  {
605  if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
606  continue; // skip self and parent
607 
608  // Check for an absolute path
609  if (path[0] == DIR_SEPARATOR_CHAR)
610  {
611  strcpy(buf, path);
613  strcat(buf, entry->d_name);
614  }
615  else
616  {
617  if (!getcwd(buf, sizeof(buf)))
618  {
619  printf("Can't get CWD: %s\n", strerror(errno));
620  return;
621  }
623  strcat(buf, path);
624  strcat(buf, entry->d_name);
625  }
626 
627  if (stat(buf, &stbuf) == -1)
628  {
629  printf("Can't access '%s' (%s)\n", buf, strerror(errno));
630  return;
631  }
632 
633  if (S_ISDIR(stbuf.st_mode))
634  {
635  strcpy(newcvspath, cvspath);
636  strcat(newcvspath, entry->d_name);
637  strcat(newcvspath, "/");
638 
639  process_directory(buf, newcvspath);
640  continue;
641  }
642 
643  /* Must be a .c file */
644  if (!is_valid_file(buf))
645  {
646  continue;
647  }
648 
649  parse_file(buf, cvspath, entry->d_name);
650  }
651  closedir(dirp);
652  }
653  else
654  {
655  printf("Can't open %s\n", path);
656  exit(1);
657  }
658 
659 #endif
660 }
661 
662 #endif
663 
664 /*
665  * This function compares two API entries. It returns a negative value if p is
666  * before q, or a positive value if p is after q.
667  */
668 static int
670 {
671  return strcmp(p->name, q->name);
672 }
673 
674 char *
675 get_filename_without_base(char *component_base,
676  char *filename)
677 {
678  return &filename[strlen(component_base)];
679 }
680 
681 static void
682 generate_xml_for_component(char *component_name,
683  char *component_base)
684 {
685  PAPI_INFO api_info;
686  char canonical_base[MAX_PATH];
687  char buf[200];
688  int complete;
689  int implemented_total;
690  int unimplemented_total;
691 
692  // Sort list
694 
695  implemented_total = 0;
696  unimplemented_total = 0;
697 
698  api_info = api_info_list;
699  while (api_info != NULL)
700  {
701  if (api_info->tag_id == TAG_IMPLEMENTED)
702  implemented_total ++;
703  else if (api_info->tag_id == TAG_UNIMPLEMENTED)
704  unimplemented_total ++;
705 
706  api_info = api_info->next;
707  }
708 
709  if (implemented_total + unimplemented_total > 0)
710  complete = ((implemented_total) * 100) / (implemented_total + unimplemented_total);
711  else
712  complete = 100;
713 
714  strcpy(canonical_base, component_base);
715  path_to_url(canonical_base);
716 
717  sprintf(buf, "<component name=\"%s\" base=\"%s\" complete=\"%d\" implemented_total=\"%d\" unimplemented_total=\"%d\">",
718  component_name, canonical_base, complete, implemented_total, unimplemented_total);
719  write_line(buf);
720 
721  if (api_info_list != NULL)
722  {
723  write_line("<functions>");
724 
725  api_info = api_info_list;
726  while (api_info != NULL)
727  {
728  sprintf(buf, "<f n=\"%s\" i=\"%s\" f=\"%s\" />",
729  api_info->name,
730  api_info->tag_id == TAG_IMPLEMENTED ? "true" : "false",
731  get_filename_without_base(component_base,
732  api_info->filename));
733  write_line(buf);
734  api_info = api_info->next;
735  }
736 
737  write_line("</functions>");
738  }
739 
740  write_line("</component>");
741 }
742 
743 static void
744 read_input_file(char *input_file)
745 {
746  char component_name[MAX_PATH];
747  char component_path[MAX_PATH];
748  char *canonical_path;
749  unsigned int index;
750  unsigned int start;
751  PAPI_INFO api_info;
752  PAPI_INFO next_api_info;
753  char *buffer;
754  unsigned int size;
755  int len;
756 
757  in = fopen(input_file, "rb");
758  if (in == NULL)
759  {
760  printf("Cannot open input file");
761  exit(1);
762  }
763 
764  // Get the size of the file
765  fseek(in, 0, SEEK_END);
766  size = ftell(in);
767 
768  // Load it all into memory
769  buffer = malloc(size);
770  if (buffer == NULL)
771  {
772  fclose(in);
773  printf("Out of memory\n");
774  exit(1);
775  }
776  fseek(in, 0, SEEK_SET);
777  if (fread (buffer, 1, size, in) < 1)
778  {
779  fclose(in);
780  printf("Read error in file %s\n", input_file);
781  exit(1);
782  }
783 
784  index = 0;
785 
786  write_line("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>");
787  write_line("<?xml-stylesheet type=\"text/xsl\" href=\"rapistatus.xsl\"?>");
788  write_line("");
789  write_line("<components>");
790 
791  while (1)
792  {
793  /* Free previous list */
794  for (api_info = api_info_list; api_info != NULL; api_info = next_api_info)
795  {
796  next_api_info = api_info->next;
797  free(api_info);
798  }
800 
801  /* Skip whitespace and eol characters */
802  while ((index < size) && (is_whitespace(buffer[index]) || (is_eol_char(buffer[index]))))
803  index++;
804  if ((file_pointer < size) && (buffer[index] == '\n'))
805  index++;
806 
807  if (buffer[index] == ';')
808  {
809  /* Skip comments */
810  while ((index < size) && (!is_eol_char(buffer[index])))
811  index++;
812  if ((index < size) && (buffer[index] == '\n'))
813  index++;
814  continue;
815  }
816 
817  /* Get component name */
818  start = index;
819  while ((index < size) && (!is_whitespace(buffer[index])))
820  index++;
821  if (index >= size)
822  break;
823 
824  len = index - start;
825  strncpy(component_name, &buffer[start], len);
826  component_name[len] = 0;
827 
828  /* Skip whitespace */
829  while ((index < size) && (is_whitespace(buffer[index])))
830  index++;
831  if (index >= size)
832  break;
833 
834  /* Get component path */
835  start = index;
836  while ((index < size) && (!is_whitespace(buffer[index]) && !is_eol_char(buffer[index])))
837  index++;
838 
839  len = index - start;
840  strncpy(component_path, &buffer[start], len);
841  component_path[len] = 0;
842 
843  /* Append directory separator if needed */
844  if (component_path[strlen(component_path)] != DIR_SEPARATOR_CHAR)
845  {
846  int i = strlen(component_path);
847  component_path[strlen(component_path)] = DIR_SEPARATOR_CHAR;
848  component_path[i + 1] = 0;
849  }
850 
851  /* Skip to end of line */
852  while ((index < size) && (!is_eol_char(buffer[index])))
853  index++;
854  if ((index < size) && (buffer[index] == '\n'))
855  index++;
856 
857  canonical_path = convert_path(component_path);
858  if (canonical_path != NULL)
859  {
860  process_directory(canonical_path, canonical_path);
861  free(canonical_path);
862  generate_xml_for_component(component_name,
863  component_path);
864  }
865  }
866 
867  write_line("</components>");
868 }
869 
870 static char HELP[] =
871  "RGENSTAT input-filename output-filename\n"
872  "\n"
873  " input-filename File containing list of components to process\n"
874  " output-filename File to create\n";
875 
876 int main(int argc, char **argv)
877 {
878  char *input_file;
879  char *output_file;
880 
881  if (argc != 3)
882  {
883  puts(HELP);
884  return 1;
885  }
886 
887  input_file = convert_path(argv[1]);
888  if (input_file[0] == 0)
889  {
890  free(input_file);
891  printf("Missing input-filename\n");
892  return 1;
893  }
894 
895  output_file = convert_path(argv[2]);
896  if (output_file[0] == 0)
897  {
898  free(input_file);
899  free(output_file);
900  printf("Missing output-filename\n");
901  return 1;
902  }
903 
904  out = fopen(output_file, "wb");
905  if (out == NULL)
906  {
907  free(input_file);
908  free(output_file);
909  printf("Cannot open output file");
910  return 1;
911  }
912 
913  read_input_file(input_file);
914 
915  free(input_file);
916  free(output_file);
917  fclose(out);
918 
919  return 0;
920 }
921 
922 /* EOF */
static int argc
Definition: ServiceArgs.c:12
char filename[MAX_PATH]
Definition: rgenstat.c:49
static void process_directory(char *path, char *cvspath)
Definition: rgenstat.c:527
static int is_valid_file(char *filename)
Definition: rgenstat.c:232
static void read_input_file(char *input_file)
Definition: rgenstat.c:744
static int get_previous_identifier(unsigned int end, char *name)
Definition: rgenstat.c:341
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static unsigned int file_size
Definition: rgenstat.c:61
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
#define __cdecl
Definition: accygwin.h:79
#define strcasecmp
Definition: fake.h:9
static void skip_comments()
Definition: rgenstat.c:321
static PAPI_INFO api_info_list
Definition: rgenstat.c:64
#define DIR_SEPARATOR_STRING
Definition: rgenstat.c:34
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define TAG_IMPLEMENTED
Definition: rgenstat.c:41
int main(int argc, char **argv)
Definition: rgenstat.c:876
static int is_whitespace(char ch)
Definition: rgenstat.c:175
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define free
Definition: debug_ros.c:5
static char * file_buffer
Definition: rgenstat.c:60
Definition: ecma_167.h:138
GLuint buffer
Definition: glext.h:5915
struct _API_INFO * PAPI_INFO
GLuint GLuint end
Definition: gl.h:1545
int errno
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
#define argv
Definition: mplay32.c:18
static FILE * in
Definition: rgenstat.c:57
const char * filename
Definition: ioapi.h:135
static void parse_file(char *fullname, char *cvspath, char *filename)
Definition: rgenstat.c:416
const char * strerror(int err)
Definition: compat_str.c:23
#define _stricmp
Definition: cat.c:22
static char HELP[]
Definition: rgenstat.c:870
Definition: fatfs.h:198
#define sprintf(buf, format,...)
Definition: sprintf.c:55
DIR *__cdecl opendir(const char *)
static void skip_line()
Definition: rgenstat.c:308
#define MAX_PATH
Definition: rgenstat.c:31
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DT_REG
Definition: fs.h:151
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
#define DIR_SEPARATOR_CHAR
Definition: rgenstat.c:33
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
static void close_file()
Definition: rgenstat.c:165
static int get_tag_id(char *tag)
Definition: rgenstat.c:256
Definition: dirent.h:39
smooth NULL
Definition: ftsmooth.c:416
_Check_return_opt_ _CRTIMP int __cdecl fseek(_Inout_ FILE *_File, _In_ long _Offset, _In_ int _Origin)
char ext[3]
Definition: mkdosfs.c:358
Definition: parser.c:48
GLuint index
Definition: glext.h:6031
static int compare_api_order(PAPI_INFO p, PAPI_INFO q)
Definition: rgenstat.c:669
_Check_return_opt_ _CRTIMP int __cdecl _findclose(_In_ intptr_t _FindHandle)
#define SEEK_SET
Definition: jmemansi.c:26
GLfloat f
Definition: glext.h:7540
GLsizeiptr size
Definition: glext.h:5919
#define _A_SUBDIR
Definition: dos.h:34
_CRTIMP int __cdecl _findnext(intptr_t _FindHandle, struct _finddata_t *_FindData)
#define S_ISDIR(mode)
Definition: various.h:18
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define TAG_UNKNOWN
Definition: rgenstat.c:40
static char tagname[200]
Definition: rgenstat.c:63
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static int is_end_of_name(char ch)
Definition: rgenstat.c:225
static int skip_to_next_name(char *name)
Definition: rgenstat.c:392
#define index(s, c)
Definition: various.h:29
#define TAG_UNIMPLEMENTED
Definition: rgenstat.c:42
static char * convert_path(char *origpath)
Definition: rgenstat.c:68
unsigned short st_mode
Definition: stat.h:58
Definition: stat.h:55
uint32_t entry
Definition: isohybrid.c:63
GLenum GLsizei len
Definition: glext.h:6722
static FILE * file_handle
Definition: rgenstat.c:59
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
int tag_id
Definition: rgenstat.c:47
int __cdecl closedir(DIR *)
int puts(const char *string)
Definition: crtsupp.c:23
char name[100]
Definition: rgenstat.c:48
_Check_return_ _Ret_opt_z_ _CRTIMP char *__cdecl getcwd(_Out_writes_opt_(_SizeInBytes) char *_DstBuf, _In_ int _SizeInBytes)
struct _API_INFO * next
Definition: rgenstat.c:46
struct dirent *__cdecl readdir(DIR *)
static void get_filename(char *cvspath, char *filename, char *result)
Definition: rgenstat.c:408
static unsigned int file_pointer
Definition: rgenstat.c:62
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
static void write_line(char *line)
Definition: rgenstat.c:114
GLuint in
Definition: glext.h:9616
GLuint start
Definition: gl.h:1545
_CRTIMP intptr_t __cdecl _findfirst(const char *_Filename, struct _finddata_t *_FindData)
Definition: services.c:325
PAPI_INFO sort_linked_list(PAPI_INFO, unsigned, int(*)(PAPI_INFO, PAPI_INFO))
Definition: name.c:36
static void read_file(char *filename)
Definition: rgenstat.c:129
char * get_filename_without_base(char *component_base, char *filename)
Definition: rgenstat.c:675
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
_Check_return_ _CRTIMP long __cdecl ftell(_Inout_ FILE *_File)
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define SEEK_END
Definition: cabinet.c:27
static int is_end_of_tag(char ch)
Definition: rgenstat.c:203
static FILE * out
Definition: rgenstat.c:58
#define malloc
Definition: debug_ros.c:4
Definition: io.h:37
static int skip_to_next_tag()
Definition: rgenstat.c:270
void exit(int exitcode)
Definition: _exit.c:33
GLfloat GLfloat p
Definition: glext.h:8902
static void generate_xml_for_component(char *component_name, char *component_base)
Definition: rgenstat.c:682
static BOOL complete
Definition: htmldoc.c:198
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
static char * path_to_url(char *path)
Definition: rgenstat.c:97
static int is_eol_char(char ch)
Definition: rgenstat.c:189
#define printf
Definition: config.h:203
struct _API_INFO API_INFO