Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

getenv_.c File Reference

#include "f2c.h"

Go to the source code of this file.


Functions

void getenv_ (char *fname, char *value, ftnlen flen, ftnlen vlen)

Function Documentation

void getenv_ char *    fname,
char *    value,
ftnlen    flen,
ftnlen    vlen
 

Definition at line 18 of file getenv_.c.

References ep.

00020 {
00021 extern char **environ;
00022 register char *ep, *fp, *flast;
00023 register char **env = environ;
00024 
00025 flast = fname + flen;
00026 for(fp = fname ; fp < flast ; ++fp)
00027         if(*fp == ' ')
00028                 {
00029                 flast = fp;
00030                 break;
00031                 }
00032 
00033 while (ep = *env++)
00034         {
00035         for(fp = fname; fp<flast ; )
00036                 if(*fp++ != *ep++)
00037                         goto endloop;
00038 
00039         if(*ep++ == '=') {      /* copy right hand side */
00040                 while( *ep && --vlen>=0 )
00041                         *value++ = *ep++;
00042 
00043                 goto blank;
00044                 }
00045 endloop: ;
00046         }
00047 
00048 blank:
00049         while( --vlen >= 0 )
00050                 *value++ = ' ';
00051 }
 

Powered by Plone

This site conforms to the following standards: