The R Project SVN R

Rev

Rev 87927 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 87927 Rev 88761
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1997-2023 The R Core Team
3
 *  Copyright (C) 1997-2025 The R Core Team
4
 *  Copyright (C) 1995-1996 Robert Gentleman and Ross Ihaka
4
 *  Copyright (C) 1995-1996 Robert Gentleman and Ross Ihaka
5
 *
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  the Free Software Foundation; either version 2 of the License, or
Line 371... Line 371...
371
 
371
 
372
    if(croutines) {
372
    if(croutines) {
373
	for(num = 0; croutines[num].name != NULL; num++) {;}
373
	for(num = 0; croutines[num].name != NULL; num++) {;}
374
	info->CSymbols = (Rf_DotCSymbol*)calloc((size_t) num,
374
	info->CSymbols = (Rf_DotCSymbol*)calloc((size_t) num,
375
						sizeof(Rf_DotCSymbol));
375
						sizeof(Rf_DotCSymbol));
-
 
376
	if (!info->CSymbols)
-
 
377
	    error("allocation failure in R_registerRoutines");
376
	info->numCSymbols = num;
378
	info->numCSymbols = num;
377
	for(i = 0; i < num; i++) {
379
	for(i = 0; i < num; i++) {
378
	    R_addCRoutine(info, croutines+i, info->CSymbols + i);
380
	    R_addCRoutine(info, croutines+i, info->CSymbols + i);
379
	}
381
	}
380
    }
382
    }
Line 382... Line 384...
382
    if(fortranRoutines) {
384
    if(fortranRoutines) {
383
	for(num = 0; fortranRoutines[num].name != NULL; num++) {;}
385
	for(num = 0; fortranRoutines[num].name != NULL; num++) {;}
384
	info->FortranSymbols =
386
	info->FortranSymbols =
385
	    (Rf_DotFortranSymbol*)calloc((size_t) num,
387
	    (Rf_DotFortranSymbol*)calloc((size_t) num,
386
					 sizeof(Rf_DotFortranSymbol));
388
					 sizeof(Rf_DotFortranSymbol));
-
 
389
	if (!info->FortranSymbols) {
-
 
390
	    free(info->CSymbols);
-
 
391
	    error("allocation failure in R_registerRoutines");
-
 
392
	}
387
	info->numFortranSymbols = num;
393
	info->numFortranSymbols = num;
388
	for(i = 0; i < num; i++)
394
	for(i = 0; i < num; i++)
389
	    R_addFortranRoutine(info, fortranRoutines+i,
395
	    R_addFortranRoutine(info, fortranRoutines+i,
390
				info->FortranSymbols + i);
396
				info->FortranSymbols + i);
391
    }
397
    }
392
 
398
 
393
    if(callRoutines) {
399
    if(callRoutines) {
394
	for(num = 0; callRoutines[num].name != NULL; num++) {;}
400
	for(num = 0; callRoutines[num].name != NULL; num++) {;}
395
	info->CallSymbols =
401
	info->CallSymbols =
396
	    (Rf_DotCallSymbol*)calloc((size_t) num, sizeof(Rf_DotCallSymbol));
402
	    (Rf_DotCallSymbol*)calloc((size_t) num, sizeof(Rf_DotCallSymbol));
-
 
403
	if (!info->CallSymbols) {
-
 
404
	    free(info->CSymbols);
-
 
405
	    free(info->FortranSymbols);
-
 
406
	    error("allocation failure in R_registerRoutines");
-
 
407
	}
397
	info->numCallSymbols = num;
408
	info->numCallSymbols = num;
398
	for(i = 0; i < num; i++)
409
	for(i = 0; i < num; i++)
399
	    R_addCallRoutine(info, callRoutines+i, info->CallSymbols + i);
410
	    R_addCallRoutine(info, callRoutines+i, info->CallSymbols + i);
400
    }
411
    }
401
 
412
 
402
    if(externalRoutines) {
413
    if(externalRoutines) {
403
	for(num = 0; externalRoutines[num].name != NULL; num++) {;}
414
	for(num = 0; externalRoutines[num].name != NULL; num++) {;}
404
	info->ExternalSymbols =
415
	info->ExternalSymbols =
405
	    (Rf_DotExternalSymbol*)calloc((size_t) num,
416
	    (Rf_DotExternalSymbol*)calloc((size_t) num,
406
					  sizeof(Rf_DotExternalSymbol));
417
					  sizeof(Rf_DotExternalSymbol));
-
 
418
	if (!info->ExternalSymbols) {
-
 
419
	    free(info->CSymbols);
-
 
420
	    free(info->FortranSymbols);
-
 
421
	    free(info->CallSymbols);
-
 
422
	    error("allocation failure in R_registerRoutines");
-
 
423
	}
407
	info->numExternalSymbols = num;
424
	info->numExternalSymbols = num;
408
 
425
 
409
	for(i = 0; i < num; i++)
426
	for(i = 0; i < num; i++)
410
	    R_addExternalRoutine(info, externalRoutines+i,
427
	    R_addExternalRoutine(info, externalRoutines+i,
411
				 info->ExternalSymbols + i);
428
				 info->ExternalSymbols + i);