/ This function returns string table information. */ Default parameter is "*" to get the handler default. */ /
| 261 | /* Default parameter is "*" to get the handler default. */ |
| 262 | /***********************************************************************/ |
| 263 | char *RELDEF::GetStringCatInfo(PGLOBAL g, PCSZ what, PCSZ sdef) |
| 264 | { |
| 265 | char *sval = NULL; |
| 266 | PCSZ name, s= Hc->GetStringOption(what, sdef); |
| 267 | |
| 268 | if (s) { |
| 269 | if (!Hc->IsPartitioned() || |
| 270 | (stricmp(what, "filename") && stricmp(what, "tabname") |
| 271 | && stricmp(what, "connect"))) |
| 272 | sval= PlugDup(g, s); |
| 273 | else |
| 274 | sval= (char*)s; |
| 275 | |
| 276 | } else if (!stricmp(what, "filename")) { |
| 277 | // Return default file name |
| 278 | PCSZ ftype= Hc->GetStringOption("Type", "*"); |
| 279 | int i, n; |
| 280 | |
| 281 | if (IsFileType(GetTypeID(ftype))) { |
| 282 | name= Hc->GetPartName(); |
| 283 | sval= (char*)PlugSubAlloc(g, NULL, strlen(name) + 12); |
| 284 | snprintf(sval, strlen(name) + 12, "%s.", name); |
| 285 | n= strlen(sval); |
| 286 | |
| 287 | // Fold ftype to lower case |
| 288 | for (i= 0; i < 12; i++) |
| 289 | if (!ftype[i]) { |
| 290 | sval[n+i]= 0; |
| 291 | break; |
| 292 | } else |
| 293 | sval[n+i]= tolower(ftype[i]); |
| 294 | |
| 295 | } // endif FileType |
| 296 | |
| 297 | } // endif s |
| 298 | |
| 299 | return sval; |
| 300 | } // end of GetStringCatInfo |
| 301 | |
| 302 | /* --------------------------- Class TABDEF -------------------------- */ |
| 303 |
no test coverage detected