~noskcaj/ubuntu/saucy/xinetd/2.3.15

« back to all changes in this revision

Viewing changes to libs/src/misc/m_env.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Seyrat
  • Date: 2004-04-18 13:33:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040418133357-czeqeju37433xvdd
Tags: upstream-2.3.13
ImportĀ upstreamĀ versionĀ 2.3.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * (c) Copyright 1992 by Panagiotis Tsirigotis
 
3
 * All rights reserved.  The file named COPYRIGHT specifies the terms 
 
4
 * and conditions for redistribution.
 
5
 */
 
6
 
 
7
#ifndef __M_ENV_H
 
8
#define __M_ENV_H
 
9
 
 
10
/*
 
11
 * $Id: m_env.h,v 1.2 2003/03/09 19:27:08 steveg Exp $
 
12
 */
 
13
 
 
14
struct __env
 
15
{
 
16
   unsigned max_vars ;
 
17
   unsigned n_vars ;
 
18
   char **vars ;
 
19
} ;
 
20
 
 
21
typedef struct __env *env_h ;
 
22
 
 
23
#define ENV_NULL                  ((env_h)0)
 
24
 
 
25
/*
 
26
 * Return values
 
27
 */
 
28
#define ENV_ERR                   (-1)
 
29
#define ENV_OK                    0
 
30
 
 
31
/*
 
32
 * Error codes
 
33
 */
 
34
#define ENV_ENOMEM                1
 
35
#define ENV_EBADVAR               2
 
36
#define ENV_EBADSTRING            3
 
37
 
 
38
 
 
39
env_h env_create ( const env_h ) ;
 
40
void env_destroy ( env_h ) ;
 
41
env_h env_make ( char **env_strings ) ;
 
42
int env_addvar ( env_h, env_h from_env, char *var ) ;
 
43
int env_addstr ( env_h, char *str ) ;
 
44
char *env_lookup ( env_h, const char *var ) ;
 
45
 
 
46
#define env_getvars( env )            (env)->vars
 
47
 
 
48
extern int env_errno ;
 
49
 
 
50
#endif   /* __M_ENV_H */
 
51