Index: DEPRECATED.pod =================================================================== --- DEPRECATED.pod (.../trunk) (revision 39188) +++ DEPRECATED.pod (.../branches/pbc_info_remove) (revision 39190) @@ -264,6 +264,11 @@ * = item may be kept but reimplemented. +=item functions in src/pbc_info.c [eligible in 1.5] + +L +To be moved to F. Will no longer be built by F. + =back =head1 Compiler tools Index: src/pbc_info.c =================================================================== --- src/pbc_info.c (.../trunk) (revision 39188) +++ src/pbc_info.c (.../branches/pbc_info_remove) (revision 39190) @@ -1,113 +0,0 @@ -/* -Copyright (C) 2001-2003, Parrot Foundation. -$Id$ - -=head1 NAME - -pbc_info - PackFile demo - -=head1 SYNOPSIS - - pbc_info file.pbc - -=head1 DESCRIPTION - -Sample program for dumping PackFile segment names by iterating -over the main directory. - -=head2 Functions - -=over 4 - -=cut - -*/ - -#include "parrot/parrot.h" -#include "parrot/embed.h" - -/* - -=item C - -This function is passed the callback to PackFile_map_segments() to print out -the name of each segment in the directory. - -=cut - -*/ - -static INTVAL -iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data) -{ - long ident = (long)user_data; - int length = ident; - printf("%*.0s%s\n", length, "", seg->name); - if (seg->type == PF_DIR_SEG) - PackFile_map_segments(interp, (PackFile_Directory*)seg, - iter, (void*)(ident+2)); - return 0; -} - -/* - -=item C - -Reads the PBC from argv[1], adds a few extra sections, and then iterates over -the directory using PackFile_map_segments() and iter(). - -=cut - -*/ - -int -main(SHIM(int argc), char *argv[]) -{ - PackFile *pf; - Interp *interp; - PackFile_Segment *seg; - - interp = Parrot_new(NULL); - - pf = Parrot_pbc_read(interp, argv[1], PFOPT_UTILS); - - /* - * add some more segments - */ - seg = PackFile_Segment_new_seg(interp, - &pf->directory, PF_DIR_SEG, "dir2", 1); - seg = PackFile_Segment_new_seg(interp, - (PackFile_Directory*)seg, PF_BYTEC_SEG, "code", 1); - seg = PackFile_Segment_new_seg(interp, - &pf->directory, PF_DIR_SEG, "dir3", 1); - - /* - * show these - */ - printf("%s\n", pf->directory.base.name); - PackFile_map_segments(interp, &pf->directory, iter, (void*)2); - - Parrot_exit(interp, 0); -} - -/* - -=back - -=head1 SEE ALSO - -F, F. - -=cut - -*/ - - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4: - */ - Index: docs/dev/fhs.pod =================================================================== --- docs/dev/fhs.pod (.../trunk) (revision 39188) +++ docs/dev/fhs.pod (.../branches/pbc_info_remove) (revision 39190) @@ -55,12 +55,12 @@ =head3 /usr/bin This is the primary directory of executable commands on the system. All -executables that are intended to be called directly by the user (i.e. -parrot, parrot_debugger, pbc_disassemble, pbc_dump, pbc_info, pbg_merge, ...) -should go here. The current version number should be appended to the -binaries itself and a symlink needs to be created that points from the -binary with version number to the normal name of the file without a -version. That makes installing more than one version possible. +executables that are intended to be called directly by the user (i.e. parrot, +parrot_debugger, pbc_disassemble, pbc_dump, pbg_merge, ...) should go here. +The current version number should be appended to the binaries itself and a +symlink needs to be created that points from the binary with version number to +the normal name of the file without a version. That makes installing more than +one version possible. Executables that are for internal use only are stored elsewhere. Index: tools/dev/pbc_header.pl =================================================================== --- tools/dev/pbc_header.pl (.../trunk) (revision 39188) +++ tools/dev/pbc_header.pl (.../branches/pbc_info_remove) (revision 39190) @@ -99,18 +99,6 @@ return; } -sub pbc_info { - for my $f (@ARGV) { - open my $F, "<", "$f" or die "Can't open $f: $!"; - binmode $F; - print "$f\n"; - - show_pbc_file_info($F); - } - - return; -} - my @pbc_header_type_names; BEGIN { @pbc_header_type_names = qw( directory default fixup constant Index: MANIFEST =================================================================== --- MANIFEST (.../trunk) (revision 39188) +++ MANIFEST (.../branches/pbc_info_remove) (revision 39190) @@ -1,7 +1,7 @@ # ex: set ro: # $Id$ # -# generated by tools/dev/mk_manifest_and_skip.pl Sun May 24 16:30:09 2009 UT +# generated by tools/dev/mk_manifest_and_skip.pl Tue May 26 23:30:19 2009 UT # # See tools/dev/install_files.pl for documentation on the # format of this file. @@ -631,6 +631,7 @@ examples/benchmarks/vpm.py [examples] examples/benchmarks/vpm.rb [examples] examples/c/nanoparrot.c [examples] +examples/c/pbc_info.c [examples] examples/c/test_main.c [examples] examples/compilers/Makefile [examples] examples/compilers/japhc.c [examples] @@ -1361,7 +1362,6 @@ src/parrot_debugger.c [] src/pbc_disassemble.c [] src/pbc_dump.c [] -src/pbc_info.c [] src/pbc_merge.c [] src/pic.c [] src/pic_jit.c [] @@ -2026,6 +2026,7 @@ t/tools/install/testlib/parrot.pc [test] t/tools/install/testlib/phony [test] t/tools/install/testlib/phony.exe [test] +t/tools/install/testlib/runtime/parrot/include/sockets.pasm [test] t/tools/install/testlib/runtime/parrot/library/TGE.pbc [test] t/tools/install/testlib/src/ops/ops.num [test] t/tools/install/testlib/src/pmc/pmc_object.h [test] Index: ports/suse/parrot.spec.suse =================================================================== --- ports/suse/parrot.spec.suse (.../trunk) (revision 39188) +++ ports/suse/parrot.spec.suse (.../branches/pbc_info_remove) (revision 39190) @@ -134,7 +134,6 @@ %{_bindir}/parrot_config %{_bindir}/parrot_debugger %{_bindir}/pbc_disassemble -%{_bindir}/pbc_info %{_bindir}/pbc_merge %{_bindir}/pbc_to_exe %{_bindir}/pbc_dump Index: ports/fedora/parrot.spec.fedora =================================================================== --- ports/fedora/parrot.spec.fedora (.../trunk) (revision 39188) +++ ports/fedora/parrot.spec.fedora (.../branches/pbc_info_remove) (revision 39190) @@ -235,7 +235,6 @@ %{_bindir}/parrot_config %{_bindir}/parrot_debugger %{_bindir}/pbc_disassemble -%{_bindir}/pbc_info %{_bindir}/pbc_merge %{_bindir}/pbc_to_exe %{_bindir}/pbc_dump Index: ports/mandriva/parrot.spec.mandriva =================================================================== --- ports/mandriva/parrot.spec.mandriva (.../trunk) (revision 39188) +++ ports/mandriva/parrot.spec.mandriva (.../branches/pbc_info_remove) (revision 39190) @@ -158,7 +158,6 @@ %{_bindir}/parrot_config %{_bindir}/parrot_debugger %{_bindir}/pbc_disassemble -%{_bindir}/pbc_info %{_bindir}/pbc_merge %{_bindir}/pbc_to_exe %{_bindir}/pbc_dump Index: ports/debian/rules =================================================================== --- ports/debian/rules (.../trunk) (revision 39188) +++ ports/debian/rules (.../branches/pbc_info_remove) (revision 39190) @@ -44,14 +44,13 @@ pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_dump.c debian/pbc_dump.1 pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_disassemble.c debian/pbc_disassemble.1 pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/parrot_debugger.c debian/parrot_debugger.1 - pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_info.c debian/pbc_info.1 pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_merge.c debian/pbc_merge.1 touch build-stamp clean: debian-control-stamp dh_testdir dh_testroot - rm -f build-stamp configure-stamp debian-control-stamp debian/parrot.1 debian/parrot_config.1 debian/pbc_dump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/main.o installable_pbc_to_exe ext/Parrot-Embed/Makefile.PL test.c test.ldo + rm -f build-stamp configure-stamp debian-control-stamp debian/parrot.1 debian/parrot_config.1 debian/pbc_dump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/main.o installable_pbc_to_exe ext/Parrot-Embed/Makefile.PL test.c test.ldo [ ! -f Makefile ] || $(MAKE) distclean dh_clean @@ -89,7 +88,7 @@ dh_testroot -a dh_installchangelogs -a ChangeLog dh_installman -pparrot-minimal debian/parrot.1 - dh_installman -pparrot-devel debian/parrot_debugger.1 debian/pbc_disassemble.1 debian/pbc_dump.1 debian/pbc_info.1 debian/pbc_merge.1 debian/parrot_config.1 + dh_installman -pparrot-devel debian/parrot_debugger.1 debian/pbc_disassemble.1 debian/pbc_dump.1 debian/pbc_merge.1 debian/parrot_config.1 dh_installdocs -a dh_strip -a dh_compress -a Index: ports/debian/parrot-devel.install.in =================================================================== --- ports/debian/parrot-devel.install.in (.../trunk) (revision 39188) +++ ports/debian/parrot-devel.install.in (.../branches/pbc_info_remove) (revision 39190) @@ -1,7 +1,6 @@ usr/bin/parrot_debugger usr/bin/pbc_disassemble usr/bin/pbc_dump -usr/bin/pbc_info usr/bin/pbc_merge usr/bin/parrot_config usr/lib/parrot/@VERSION@/tools/* Index: ports/macports/Portfile =================================================================== --- ports/macports/Portfile (.../trunk) (revision 39188) +++ ports/macports/Portfile (.../branches/pbc_info_remove) (revision 39190) @@ -55,7 +55,7 @@ set executables { parrot parrot_config parrot_debugger - pbc_disassemble pbc_info pbc_merge pbc_to_exe pbc_dump + pbc_disassemble pbc_merge pbc_to_exe pbc_dump } foreach exe $executables { Index: MANIFEST.SKIP =================================================================== --- MANIFEST.SKIP (.../trunk) (revision 39188) +++ MANIFEST.SKIP (.../branches/pbc_info_remove) (revision 39190) @@ -1,6 +1,6 @@ # ex: set ro: # $Id$ -# generated by tools/dev/mk_manifest_and_skip.pl Fri May 15 17:05:40 2009 UT +# generated by tools/dev/mk_manifest_and_skip.pl Wed May 27 02:14:55 2009 UT # # This file should contain a transcript of the svn:ignore properties # of the directories in the Parrot subversion repository. (Needed for Index: include/parrot/packfile.h =================================================================== --- include/parrot/packfile.h (.../trunk) (revision 39188) +++ include/parrot/packfile.h (.../branches/pbc_info_remove) (revision 39190) @@ -55,7 +55,7 @@ /* ** Parrot_pbc_read() options: ** parrot, pbc_merge, parrot_debugger use 0 -** pbc_dump, pbc_disassemble, pbc_info use 1 to skip the version check +** pbc_dump, pbc_disassemble use 1 to skip the version check ** pbc_dump -h requires 2 ** The rest is for TRACE_PACKFILE debugging with switch -D in pbc_dump */ Index: t/codingstd/c_function_docs.t =================================================================== --- t/codingstd/c_function_docs.t (.../trunk) (revision 39188) +++ t/codingstd/c_function_docs.t (.../branches/pbc_info_remove) (revision 39190) @@ -134,7 +134,6 @@ src/jit/ppc/exec_dep.c src/nci_test.c src/pbc_dump.c -src/pbc_info.c src/pic.c src/pic_jit.c src/string/charset/ascii.c Index: MANIFEST.generated =================================================================== --- MANIFEST.generated (.../trunk) (revision 39188) +++ MANIFEST.generated (.../branches/pbc_info_remove) (revision 39190) @@ -57,8 +57,6 @@ installable_pbc_disassemble [main]bin installable_pbc_dump.exe [main]bin installable_pbc_dump [main]bin -installable_pbc_info.exe [main]bin -installable_pbc_info [main]bin installable_pbc_merge.exe [main]bin installable_pbc_merge [main]bin installable_pbc_to_exe.exe [main]bin Index: config/gen/makefiles/root.in =================================================================== --- config/gen/makefiles/root.in (.../trunk) (revision 39188) +++ config/gen/makefiles/root.in (.../branches/pbc_info_remove) (revision 39190) @@ -483,7 +483,6 @@ MINIPARROT := $(CUR_DIR)/miniparrot$(EXE) DIS := $(CUR_DIR)/pbc_disassemble$(EXE) PDUMP := $(CUR_DIR)/pbc_dump$(EXE) -PINFO := $(CUR_DIR)/pbc_info$(EXE) PBCMERGE := $(CUR_DIR)/pbc_merge$(EXE) PDB := $(CUR_DIR)/parrot_debugger$(EXE) PBC_TO_EXE := $(CUR_DIR)/pbc_to_exe$(EXE) @@ -494,7 +493,6 @@ INSTALLABLEPARROT := $(CUR_DIR)/installable_parrot$(EXE) INSTALLABLEDIS := $(CUR_DIR)/installable_pbc_disassemble$(EXE) INSTALLABLEPDUMP := $(CUR_DIR)/installable_pbc_dump$(EXE) -INSTALLABLEPINFO := $(CUR_DIR)/installable_pbc_info$(EXE) INSTALLABLEPBCMERGE := $(CUR_DIR)/installable_pbc_merge$(EXE) INSTALLABLEPBCTOEXE := $(CUR_DIR)/installable_pbc_to_exe$(EXE) INSTALLABLEPDB := $(CUR_DIR)/installable_parrot_debugger$(EXE) @@ -585,7 +583,6 @@ $(PBCMERGE) \ $(PDB) \ $(PDUMP) \ - $(PINFO) \ $(GEN_LIBRARY) : $(PARROT) @@ -655,13 +652,11 @@ @echo " world: 'all' and 'parrot_utils'." @echo " installable: same as 'world', but targets for installation" @echo "" - @echo " parrot_utils: $(PDUMP), $(DIS), $(PINFO), $(PDB), $(PBCMERGE) and $(PBC_TO_EXE) $(PARROT_CONFIG)" + @echo " parrot_utils: $(PDUMP), $(DIS), $(PDB), $(PBCMERGE) and $(PBC_TO_EXE) $(PARROT_CONFIG)" @echo " $(PDUMP):" @echo " Parrot Dumper" @echo " $(DIS):" @echo " Parrot Disassembler" - @echo " $(PINFO):" - @echo " Information about Parrot Byte Code" @echo " $(PDB):" @echo " Parrot Debugger" @echo " $(PBCMERGE):" @@ -759,9 +754,9 @@ world : all parrot_utils -parrot_utils : $(PDUMP) $(DIS) $(PINFO) $(PDB) $(PBCMERGE) $(PBC_TO_EXE) $(PARROT_CONFIG) +parrot_utils : $(PDUMP) $(DIS) $(PDB) $(PBCMERGE) $(PBC_TO_EXE) $(PARROT_CONFIG) -installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPINFO) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG) +installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG) flags_dummy : @@ -958,21 +953,7 @@ #IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 -# pbc_info -$(PINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT) - $(LINK) @ld_out@$@ \ - $(SRC_DIR)/pbc_info$(O) \ - @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) -#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 -$(SRC_DIR)/pbc_info$(O) : $(INC_DIR)/parrot.h $(GEN_HEADERS) - -$(INSTALLABLEPINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT) - $(LINK) @ld_out@$@ \ - $(SRC_DIR)/pbc_info$(O) \ - @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) -#IF(win32): if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 - # # Parrot Bytecode File Merger # @@ -1667,7 +1648,6 @@ $(INSTALLABLEPARROT) \ $(INSTALLABLEDIS) \ $(INSTALLABLEPDUMP) \ - $(INSTALLABLEPINFO) \ $(INSTALLABLEPBCMERGE) \ $(INSTALLABLEPBCTOEXE) \ $(INSTALLABLEPDB) \ @@ -1676,7 +1656,6 @@ parrot_config$(EXE) parrot_config.c parrot_config$(O) parrot_config.pbc \ $(IMCC_DIR)/main$(O) \ $(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \ - $(SRC_DIR)/pbc_info$(O) $(PINFO) \ $(PDB) $(SRC_DIR)/parrot_debugger$(O) \ $(PBCMERGE) $(SRC_DIR)/pbc_merge$(O) \ $(DIS) $(SRC_DIR)/pbc_disassemble$(O) @@ -1707,13 +1686,11 @@ $(INSTALLABLEPARROT) \ $(INSTALLABLEDIS) \ $(INSTALLABLEPDUMP) \ - $(INSTALLABLEPINFO) \ $(INSTALLABLEPBCMERGE) \ $(INSTALLABLEPDB) \ $(INSTALLABLECONFIG) \ $(IMCC_DIR)/main$(O) \ $(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \ - $(PINFO) $(SRC_DIR)/pbc_info$(O) \ $(PDB) $(SRC_DIR)/parrot_debugger$(O) \ $(PBCMERGE) $(SRC_DIR)/pbc_merge$(O) \ $(DIS) $(SRC_DIR)/pbc_disassemble$(O) \ Index: examples/c/pbc_info.c =================================================================== --- examples/c/pbc_info.c (.../trunk) (revision 0) +++ examples/c/pbc_info.c (.../branches/pbc_info_remove) (revision 39190) @@ -0,0 +1,112 @@ +/* +Copyright (C) 2001-2003, Parrot Foundation. +$Id$ + +=head1 NAME + +pbc_info - PackFile demo + +=head1 SYNOPSIS + + pbc_info file.pbc + +=head1 DESCRIPTION + +Sample program for dumping PackFile segment names by iterating +over the main directory. + +=head2 Functions + +=over 4 + +=cut + +*/ + +#include "parrot/parrot.h" +#include "parrot/embed.h" + +/* + +=item C + +This function is passed the callback to PackFile_map_segments() to print out +the name of each segment in the directory. + +=cut + +*/ + +static INTVAL +iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data) +{ + long ident = (long)user_data; + int length = ident; + printf("%*.0s%s\n", length, "", seg->name); + if (seg->type == PF_DIR_SEG) + PackFile_map_segments(interp, (PackFile_Directory*)seg, + iter, (void*)(ident+2)); + return 0; +} + +/* + +=item C + +Reads the PBC from argv[1], adds a few extra sections, and then iterates over +the directory using PackFile_map_segments() and iter(). + +=cut + +*/ + +int +main(SHIM(int argc), char *argv[]) +{ + PackFile *pf; + Interp *interp; + PackFile_Segment *seg; + + interp = Parrot_new(NULL); + + pf = Parrot_pbc_read(interp, argv[1], PFOPT_UTILS); + + /* + * add some more segments + */ + seg = PackFile_Segment_new_seg(interp, + &pf->directory, PF_DIR_SEG, "dir2", 1); + seg = PackFile_Segment_new_seg(interp, + (PackFile_Directory*)seg, PF_BYTEC_SEG, "code", 1); + seg = PackFile_Segment_new_seg(interp, + &pf->directory, PF_DIR_SEG, "dir3", 1); + + /* + * show these + */ + printf("%s\n", pf->directory.base.name); + PackFile_map_segments(interp, &pf->directory, iter, (void*)2); + + Parrot_exit(interp, 0); +} + +/* + +=back + +=head1 SEE ALSO + +F, F. + +=cut + +*/ + + +/* + * Local variables: + * c-file-style: "parrot" + * End: + * vim: expandtab shiftwidth=4: + */ + Property changes on: examples/c/pbc_info.c ___________________________________________________________________ Name: svn:eol-style + native Name: svn:keywords + Author Date Id Revision Name: cvs2svn:cvs-rev + 1.7