三、接口

 

    下面是ADT接口头文件DynamicDLA.h的内容,各函数的实现源码放在最后一部分。#define cplusplus控制在c还是c++中编译。c++中使用时,各函数放在命名空间dynamic_dimensionality_length_array中,别名ddla

 

#ifndef DYNAMICDLA_H #define DYNAMICDLA_H #ifndef __cplusplus #include <stddef.h> #ifndef BOOl #define BOOL typedef enum { false, true } bool; #endif #else #include <cstddef> namespace dynamic_dimensionality_length_array { #endif void* new_a( size_t, size_t, ... ); void* new0_a( size_t, size_t, ... ); void* new_pa( size_t, size_t, size_t* ); void* resize_a( void*, size_t, ... ); void* resize_pa( void*, size_t, size_t* ); bool assign_pa( void*, void*, size_t* ); bool assign_va( void*, void*, ... ); bool value_pa( void*, void*, size_t* ); bool value_va( void*, void*, ... ); void* address_pa( void*, size_t, size_t* ); void* address_va( void*, size_t, ... ); size_t sizeof_a( void* ); size_t sizeof_pa( void*, size_t, size_t* ); size_t sizeof_va( void*, size_t, ... ); size_t dimen_a( void* ); size_t* dimenlen_a( void*, size_t* ); size_t elmntsize_a( void* ); bool process_a( void*, void (*)(void*, size_t* ) ); void delete_a( void* ); void delete_all(); #ifdef __cplusplus } namespace ddla = dynamic_dimensionality_length_array; #endif #endif

 

 

你可能感兴趣的:(c,delete)