aboutsummaryrefslogtreecommitdiff
path: root/src/xerbla.c
blob: 5a7bcd8bcce207429124f490e5888c9253c4ee53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
#include <ctype.h>
#include "cblas.h"
#include "cblas_f77.h"

#define XerblaStrLen 6
#define XerblaStrLen1 7

#ifdef F77_CHAR
void F77_xerbla(F77_CHAR F77_srname, void *vinfo)
#else
void F77_xerbla(char *srname, void *vinfo)
#endif

{
#ifdef F77_CHAR
   char *srname;
#endif

   char rout[] = {'c','b','l','a','s','_','\0','\0','\0','\0','\0','\0','\0'};

#ifdef F77_INT
   F77_INT *info=vinfo;
   F77_INT i;
#else
   int *info=vinfo;
   int i;
#endif

   extern int CBLAS_CallFromC;

#ifdef F77_CHAR
   srname = F2C_STR(F77_srname, XerblaStrLen);
#endif

   if (CBLAS_CallFromC)
   {
      for(i=0; i != XerblaStrLen; i++) rout[i+6] = tolower(srname[i]);
      rout[XerblaStrLen+6] = '\0';
      cblas_xerbla(*info+1,rout,"");
   }
   else
   {
      fprintf(stderr, "Parameter %d to routine %s was incorrect\n",
              *info, srname);
   }
}