source: git/ntl/doc/sedscript.txt @ 6ce030f

spielwiese
Last change on this file since 6ce030f was 2cfffe, checked in by Hans Schönemann <hannes@…>, 21 years ago
This commit was generated by cvs2svn to compensate for changes in r6316, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@6317 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.7 KB
Line 
1
2# This is a sed script to make most of the common syntactic
3# changes necessary to move from NTL 2.0 to 3.0.
4# If this file is in sedscript.txt (as it originally is)
5# the command
6#    sed -f sedscript.txt < old.c > new.c
7# will convert old.c to new.c with the necesary changes.
8#
9# Please note that this script is niether "sound" or "complete",
10# but should still be useful.
11
12# rename some classes
13s/BB/GF2X/g
14s/BB_p/GF2E/g
15s/GF2Vector/vec_GF2/g
16s/GF2Matrix/mat_GF2/g
17
18# rename some functions
19s/ZZ_pInit(/ZZ_p::init(/g
20s/zz_pInit(/zz_p::init(/g
21s/zz_pFFTInit(/zz_p::FFTInit(/
22s/GF2EInit(/GF2E::init(/g
23s/LowBits/trunc/g
24s/Long(/to_long(/g
25s/XDouble(/to_xdouble(/g
26s/Quad_float(/to_quad_float(/g
27s/trace(/TraceMod(/g
28s/norm(/NormMod(/g
29s/MinPoly(/MinPolyMod(/g
30s/IrredPoly(/IrredPolyMod(/g
31s/CharPoly(/CharPolyMod(/g
32
33# rename generic vector, pair, matrix macro instantations
34# these assume no embedded blanks
35s/vector_decl(\(.*\))/ntl_vector_decl(\1,vec_\1)/g
36s/vector_io_decl(\(.*\))/ntl_io_vector_decl(\1,vec_\1)/g
37s/vector_eq_decl(\(.*\))/ntl_eq_vector_decl(\1,vec_\1)/g
38#
39s/vector_impl(\(.*\))/ntl_vector_impl(\1,vec_\1)/g
40s/vector_impl_plain(\(.*\))/ntl_vector_impl_plain(\1,vec_\1)/g
41s/vector_io_impl(\(.*\))/ntl_io_vector_impl(\1,vec_\1)/g
42s/vector_eq_impl(\(.*\))/ntl_eq_vector_impl(\1,vec_\1)/g
43#
44s/matrix_decl(\(.*\))/ntl_matrix_decl(\1,vec_\1,vec_vec_\1,mat_\1)/g
45s/matrix_io_decl(\(.*\))/ntl_io_matrix_decl(\1,vec_\1,vec_vec_\1,mat_\1)/g
46s/matrix_eq_decl(\(.*\))/ntl_eq_matrix_decl(\1,vec_\1,vec_vec_\1,mat_\1)/g
47#
48s/matrix_impl(\(.*\))/ntl_matrix_impl(\1,vec_\1,vec_vec_\1,mat_\1)/g
49s/matrix_io_impl(\(.*\))/ntl_io_matrix_impl(\1,vec_\1,vec_vec_\1,mat_\1)/g
50s/matrix_eq_impl(\(.*\))/ntl_eq_matrix_impl(\1,vec_\1,vec_vec_\1,mat_\1)/g
51#
52s/pair_decl(\(.*\),\(.*\))/ntl_pair_decl(\1,\2,pair_\1_\2)/g
53s/pair_io_decl(\(.*\),\(.*\))/ntl_pair_io_decl(\1,\2,pair_\1_\2)/g
54s/pair_eq_decl(\(.*\),\(.*\))/ntl_pair_eq_decl(\1,\2,pair_\1_\2)/g
55#
56s/pair_impl(\(.*\),\(.*\))/ntl_pair_impl(\1,\2,pair_\1_\2)/g
57s/pair_io_impl(\(.*\),\(.*\))/ntl_pair_io_impl(\1,\2,pair_\1_\2)/g
58s/pair_eq_impl(\(.*\),\(.*\))/ntl_pair_eq_impl(\1,\2,pair_\1_\2)/g
59
60# rename type names for the generic types
61# these allow embedded blanks
62s/pair *( *\([^,() ]*\) *, *\([^() ]*\) *)/pair_\1_\2/g
63s/vector *( *\([^() ]*\) *)/vec_\1/g
64s/matrix *( *\([^() ]*\) *)/mat_\1/g
65#
66# repeat to handle one nesting level
67#
68s/pair *( *\([^,() ]*\) *, *\([^() ]*\) *)/pair_\1_\2/g
69s/vector *( *\([^() ]*\) *)/vec_\1/g
70s/matrix *( *\([^() ]*\) *)/mat_\1/g
71#
72# repeat to handle two nesting levels
73#
74s/pair *( *\([^,() ]*\) *, *\([^() ]*\) *)/pair_\1_\2/g
75s/vector *( *\([^() ]*\) *)/vec_\1/g
76s/matrix *( *\([^() ]*\) *)/mat_\1/g
77
78# rename header files for generic types
79s/vector\.h/ntl_vector\.h/
80s/matrix\.h/ntl_matrix\.h/
81s/pair\.h/ntl_pair\.h/
82
Note: See TracBrowser for help on using the repository browser.