Print this page
*** NO COMMENTS ***
*** 19,28 ****
--- 19,29 ----
* CDDL HEADER END
*/
/*
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef __UTIL_H
#define __UTIL_H
*** 30,62 ****
extern "C" {
#endif
#define EOS '\0'
! #ifndef NULL
! # define NULL ((char *) 0)
! #endif
! #define MALLOC(object_type) ((object_type *) malloc(sizeof(object_type)))
! #define FREE(ptr) free((char *) ptr)
- #define STRCPY(dst,src) \
- (dst = malloc((unsigned)strlen(src)+1), (void) strcpy(dst,src))
-
- #define STRNCPY(dst,src,num) \
- (dst = (char *) malloc((unsigned)(num) + 1),\
- (void)strncpy(dst,src,num),(dst)[num] = EOS)
-
- /*
- extern char *malloc();
- */
- extern char *alloca();
-
char *getaline();
- void fatal();
#ifdef __cplusplus
}
#endif
--- 31,52 ----
extern "C" {
#endif
#define EOS '\0'
! #define MALLOC(object_type) ((object_type *)malloc(sizeof (object_type)))
+ #define FREE(ptr) free((char *)ptr)
! #define STRCPY(dst, src) \
! (dst = malloc((unsigned)strlen(src)+1), (void)strcpy(dst, src))
! #define STRNCPY(dst, src, num) \
! (dst = (char *)malloc((unsigned)(num) + 1),\
! (void) strncpy(dst, src, num), (dst)[num] = EOS)
char *getaline();
#ifdef __cplusplus
}
#endif