-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add byte_vector_* as an alias of string_*
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
-- This Source Code Form is subject to the terms of the Mozilla Public | ||
-- License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
-- You can obtain one at http://mozilla.org/MPL/2.0/. | ||
-- | ||
-- Copyright (c) 2014-2019, Lars Asplund [email protected] | ||
-- | ||
-- The purpose of this package is to provide a byte vector access type (pointer) | ||
-- that can itself be used in arrays and returned from functions unlike a | ||
-- real access type. This is achieved by letting the actual value be a handle | ||
-- into a singleton datastructure of string access types. | ||
-- | ||
|
||
use work.byte_vector_pkg.all; | ||
use work.string_ptr_pkg.all; | ||
|
||
package byte_vector_ptr_pkg is | ||
|
||
alias byte_vector_ptr_t is string_ptr_t; | ||
alias null_byte_vector_ptr is null_string_ptr; | ||
|
||
alias new_byte_vector_ptr is new_string_ptr[natural, integer, val_t return ptr_t]; | ||
alias new_byte_vector_ptr is new_string_ptr[natural, integer, natural return ptr_t]; | ||
alias new_byte_vector_ptr is new_string_ptr[string, integer return ptr_t]; | ||
|
||
alias is_external is is_external[ptr_t return boolean]; | ||
alias deallocate is deallocate[ptr_t]; | ||
alias length is length[ptr_t return integer]; | ||
alias set is set[ptr_t, natural, natural]; | ||
alias get is get[ptr_t, natural return natural]; | ||
alias reallocate is reallocate[ptr_t, natural, natural]; | ||
alias resize is resize[ptr_t, natural, natural, natural]; | ||
|
||
-- alias write_byte is write_char; | ||
-- alias read_byte is read_char; | ||
-- alias byte_vector_access_t is string_access_t; | ||
|
||
end package; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- This Source Code Form is subject to the terms of the Mozilla Public | ||
-- License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
-- You can obtain one at http://mozilla.org/MPL/2.0/. | ||
-- | ||
-- Copyright (c) 2014-2019, Lars Asplund [email protected] | ||
|
||
use work.string_pkg.all; | ||
|
||
package byte_vector_pkg is | ||
alias byte_vector_access_t is string_access_t; | ||
alias byte_vector_access_vector_t is string_access_vector_t; | ||
alias byte_vector_access_vector_access_t is string_access_vector_access_t; | ||
|
||
alias extbytevec_access_t is extstring_access_t; | ||
alias extbytevec_access_vector_t is extstring_access_vector_t; | ||
alias extbytevec_access_vector_access_t is extstring_access_vector_access_t; | ||
end package; |