1 /**
2  ** BCC2GRX  -  Interfacing Borland based graphics programs to LIBGRX
3  ** Copyright (C) 1993-97 by Hartmut Schirmer
4  **
5  **
6  ** Contact :                Hartmut Schirmer
7  **                          Feldstrasse 118
8  **                  D-24105 Kiel
9  **                          Germany
10  **
11  ** e-mail : hsc@techfak.uni-kiel.de
12  **
13  ** This file is part of the GRX graphics library.
14  **
15  ** The GRX graphics library is free software; you can redistribute it
16  ** and/or modify it under some conditions; see the "copying.grx" file
17  ** for details.
18  **
19  ** This library is distributed in the hope that it will be useful,
20  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
21  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22  **
23  **/
24 
25 #include "bccgrx00.h"
26 
getdrivername(void)27 char *getdrivername( void )
28 {
29   _DO_INIT_CHECK_RV(NULL);
30 #ifdef GRX_VERSION
31 {
32   static char *grxname = NULL;
33   const GrVideoDriver *vd = GrCurrentVideoDriver();
34   if (vd != NULL) {
35     grxname = realloc(grxname, 16+strlen(vd->name));
36     if (grxname != NULL) {
37       strcpy(grxname, "GRX driver \"");
38       strcat(grxname, vd->name);
39       strcat(grxname, "\"");
40       return grxname;
41     }
42   }
43 }
44 #else
45   switch (__gr_ADAPTER) {
46     case GR_VGA         : return "VGA driver";
47     case GR_EGA         : return "EGA driver";
48     case GR_HERC        : return "Hercules mono driver";
49     case GR_8514A       : return "8514A driver";
50     case GR_S3          : return "S3 graphics accelerator driver";
51   }
52 #endif
53   return "unknown graphics driver";
54 }
55 
56