ex12c.c File Reference

#include "../../routines/machine.h"

Include dependency graph for ex12c.c:

Go to the source code of this file.

Data Structures

struct  array

Typedefs

typedef array Array

Functions

C2F() ccalc12 (Array **a, int *m, int *n, int *err)
C2F() ccalc12f (int *n, Array **ip, double *op)


Typedef Documentation

typedef struct array Array


Function Documentation

C2F() ccalc12 ( Array **  a,
int m,
int n,
int err 
)

Definition at line 18 of file ex12c.c.

References a, err, i, m, malloc(), n, and sciprint().

00020 {
00021   int i;
00022   *a = ( Array *) malloc( sizeof(Array));
00023   if ( *a == (Array *) 0) 
00024     {
00025       *err=1;
00026       sciprint("No more space\r\n");
00027     }
00028   *m = (*a)->m = 1;
00029   *n = (*a)->n = 10;
00030   (*a)->val = (double *)  malloc( (unsigned) (*m)*(*n) *sizeof(double));
00031   if ( (*a)->val  == (double *) 0 ) 
00032     {
00033       *err=1;
00034       sciprint("No more space\r\n");
00035     }
00036   *err=0;
00037   for ( i= 0 ; i < (*m)*(*n) ; i++) (*a)->val[i] = i ;
00038 }

Here is the call graph for this function:

C2F() ccalc12f ( int n,
Array **  ip,
double *  op 
)

Definition at line 41 of file ex12c.c.

References free(), i, ip, n, and op.

00045 {
00046   int i;
00047   if ( *n > 0 ) {
00048     for (i = 0; i < *n; i++)
00049       op[i]= (*ip)->val[i];
00050     free((char *)(*ip)->val);
00051     free((char *)(*ip));
00052   }
00053 }

Here is the call graph for this function:


Generated on Sun Mar 4 16:08:11 2007 for Scilab [trunk] by  doxygen 1.5.1