Author: chromatic
Date: Tue May 6 22:06:35 2008
New Revision: 27371
Added:
trunk/config/gen/call_list/
trunk/config/gen/call_list.pm (contents, props changed)
trunk/config/gen/call_list/core.in (contents, props changed)
trunk/config/gen/call_list/misc.in (contents, props changed)
trunk/config/gen/call_list/opengl.in (contents, props changed)
trunk/t/steps/gen_call_list-01.t (contents, props changed)
Removed:
trunk/src/call_list.txt
Modified:
trunk/MANIFEST
trunk/MANIFEST.generated
trunk/lib/Parrot/Configure/Step/List.pm
Log:
[NCI] Split NCI signatures into core, misc, and opengl groups.
Removed src/call_list.txt, which is now a generated file.
(Geoff Broadwell, RT #53430)
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Tue May 6 22:06:35 2008
@@ -292,6 +292,10 @@
config/auto/va_ptr/test_c.in []
config/auto/warnings.pm []
config/auto/warnings/test_c.in []
+config/gen/call_list.pm []
+config/gen/call_list/core.in []
+config/gen/call_list/misc.in []
+config/gen/call_list/opengl.in []
config/gen/config_h.pm []
config/gen/config_h/config_h.in []
config/gen/config_h/feature_h.in []
@@ -2701,7 +2705,6 @@
src/bignum.h []
src/builtin.c []
src/byteorder.c []
-src/call_list.txt [devel]doc
src/charset.c []
src/charset/ascii.c []
src/charset/ascii.h []
@@ -3536,6 +3539,7 @@
t/steps/auto_warnings-06.t []
t/steps/auto_warnings-07.t []
t/steps/auto_warnings-08.t []
+t/steps/gen_call_list-01.t []
t/steps/gen_config_h-01.t []
t/steps/gen_config_pm-01.t []
t/steps/gen_core_pmcs-01.t []
Modified: trunk/MANIFEST.generated
==============================================================================
--- trunk/MANIFEST.generated (original)
+++ trunk/MANIFEST.generated Tue May 6 22:06:35 2008
@@ -285,6 +285,7 @@
languages/squaak/squaak.pbc [main]
languages/tcl/tcl.pbc [main]
languages/tcl/runtime/tcllib.pbc [main]
+src/call_list.txt [devel]doc
src/glut_callbacks.c [main]
src/jit_emit.h [main]include
src/nci.c [main]
Added: trunk/config/gen/call_list.pm
==============================================================================
--- (empty file)
+++ trunk/config/gen/call_list.pm Tue May 6 22:06:35 2008
@@ -0,0 +1,71 @@
+# Copyright (C) 2008, The Perl Foundation.
+# $Id: $
+
+=head1 NAME
+
+config/gen/call_list.pm - Concatenate call_list.txt (NCI signatures) fragments
+
+=head1 DESCRIPTION
+
+Some portions of F<src/call_list.txt> (the NCI signature list) are generated,
+and others should only appear when certain features/libraries are enabled by
+Configure in previous steps. This step simply combines all fragments that
+appear in F<config/gen/call_list/> into the single C<src/call_list.txt> used
+by the main build.
+
+If a config step wishes to make its fragment optional, that step should only
+generate or copy its fragment to F<config/gen/call_list/> when the library is
+enabled.
+
+=cut
+
+package gen::call_list;
+
+use strict;
+use warnings;
+
+use base qw(Parrot::Configure::Step);
+
+use Parrot::Configure::Utils '_slurp';
+
+
+sub _init {
+ my $self = shift;
+
+ return {
+ description => q{Generating NCI signature list},
+ result => q{},
+ }
+}
+
+sub runstep {
+ my ( $self, $conf ) = @_;
+
+ my $combined_file = 'src/call_list.txt';
+ my @fragment_files = sort glob 'config/gen/call_list/*.in';
+
+ open my $combined, '>', $combined_file
+ or die "Could not open '$combined_file' for write: $!";
+
+ foreach my $fragment_file (@fragment_files) {
+ my $fragment = _slurp($fragment_file);
+ $fragment =~ s/^\s*\n//;
+ $fragment =~ s/\s*$/\n\n/;
+
+ print $combined $fragment;
+ }
+
+ $conf->append_configure_log($combined_file);
+
+ return 1;
+}
+
+
+1;
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Added: trunk/config/gen/call_list/core.in
==============================================================================
--- (empty file)
+++ trunk/config/gen/call_list/core.in Tue May 6 22:06:35 2008
@@ -0,0 +1,115 @@
+# Copyright (C) 2002-2008, The Perl Foundation.
+
+# DO NOT EDIT THIS FILE.
+#
+# Any changes made here will be lost.
+#
+# This file is generated automatically by config/gen/call_list.pm
+# using config/gen/call_list/*.in .
+
+
+# Function signature declarations for Parrot Native Call Interface.
+# The first alphanumeric is the type of the return value,
+# the other alphanumerics denote the input parameter types.
+
+# Types
+
+# INT register stuff
+# I - INTVAL
+# c - char
+# s - short
+# i - int
+# l - long
+
+# NUM register stuff
+# N - FLOATVAL
+# f - float
+# d - double
+
+# STR register stuff
+# S - pointer to a STRING-register
+# t - character string (0-terminated)
+# Buffers are not valid return parameters,
+# use 'p' when the native function returns a pointer value
+# b - void *
+# B - void **
+
+# PMC register stuff
+# P - pointer to a PMC-register
+# O - pointer to PMC-register (object)
+# p - data pointer from PMC (on store into a new UnManagedStruct PMC)
+# 2 - pointer to short
+# 3 - pointer to int
+# 4 - pointer to long
+
+# void stuff
+# v - void
+
+# special stuff
+# 0 - insert a NULL (pointer) - doesn't consume a register
+# J - Parrot_Interp param
+# @ - slurpy array
+
+# callback stuff
+# U - Single PMC parameter to pass into callback - user data
+
+# Signatures
+
+d JOd # Parrot builtins
+I JOS
+P JOl
+P Jt
+S JOS # ParrotIO.readline
+I JI # Parrot_is_char_*
+v JOSP # String.trans
+v JOS # String.reverse
+P JOS # Added for os.stat
+I JOI # os.umask
+P JOP # atan2
+P JOPS # Namespace.get_global
+v JOPSP # Namespace.set_global
+
+v JPPP # infix MMD
+v JPIP
+v JPSP
+v JPNP
+
+v JPP # inplace infix MMD
+v JPI
+v JPS
+v JPN
+
+P JPPP # infix MMD new
+P JPIP
+P JPSP
+P JPNP
+
+I JPP # MMD compare
+
+# These are needed for parrotio.pmc
+i JP
+v JP
+i JPi
+i JPii
+i JPiii
+i JPt
+P JOSSS
+
+# Needed by string.pmc
+v JOSS
+
+# Needed by integer.pmc
+S JOI
+
+# src/pmc/nci.pmc
+v JOb
+
+# ParrotThread creation
+i JOP@
+I JOP@
+I JOIP@
+
+# other ParrotThread
+P JO
+v JOP
+P Ji
Added: trunk/config/gen/call_list/misc.in
==============================================================================
--- (empty file)
+++ trunk/config/gen/call_list/misc.in Tue May 6 22:06:35 2008
@@ -0,0 +1,353 @@
+# mod_parrot
+i ip
+i JPip
+i JpP
+i Jpii
+i p
+i tp
+p J
+p Jp
+t J
+t Jpti
+t p
+t pt
+v p
+v pit
+v ptt
+v Jtiiipt
+
+v
+v Jiiip # examples/japh/japh11.pasm
+v i
+v ii
+v illllllll
+v l
+v p
+v pbip # for libsyck
+v pi
+v piiii
+v pl
+v pp
+
+# For python
+i JPP
+
+# Py_func signatures
+P JP
+P JPP
+P JO
+S JO
+i P
+
+# PyBuiltins
+P JOPP
+P JOPPP
+v JOPP
+v JOPPP
+P JOPPPP
+P JOPPPPP
+
+# Added for Tcl
+I JOSI
+P JOSII
+
+# libpast
+p Ji
+p Jipp
+p Jbip
+v Jp
+v JS
+
+# crypt
+t tt
+
+# Sub.__get_regs_used
+I JOt
+
+# declare_lex_preg
+v JOSI
+
+# Added for .NET => PIR translator dynamic PMCs.
+S JOi
+v JOi
+I JO
+N JO
+v JON
+P JOi
+v JOI
+
+# Make lua stop panic'ing.
+P JOI
+P JOIS
+S JOSP
+
+i # void function returning int like fork()
+i i3i # POSIX's waitpid
+i ibi # POSIX's read
+
+# win32
+l lttl
+
+i pip
+i piS
+S i
+
+# --- start mysqlclient library ---
+#
+# Created from mysql.h using the following manual method:
+#
+# Edited copy of mysql.h using vi by doing g/, *$/j (repeat) then g/\* *$/j
+# (repeat) to get all functions on one line each.
+#
+# Extracted list of api func names from
+# http://dev.mysql.com/doc/refman/4.1/en/c-api-functions.html and copied to a
+# temporary file to clean up (mysql_api_names.txt)
+#
+# Stripped down to bare names and merged into one line separated by |
+# then egrep -w `cat mysql_api_names.txt` mysql.h > mysql_api.ncidef
+# then edit mysql_api.ncidef in vi: %s/^/ # /
+# to create space for nci signatures and to use original definition as a #
+# comment.
+#
+# This method isn't ideal, I'm just noting it here in case it helps others.
+# Ideally the process should be automated - but there be many dragons along
+# that path.
+#
+# NCI doesn't yet handle long long values (my_ulonglong), spec'd as long for
now
+#
+#
+# MYSQL_FIELD and MYSQL_RES are structs
+# typedef char **MYSQL_ROW; /* return data as array of strings */
+# typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */
+# typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
+#
+l p #! my_ulonglong mysql_num_rows(MYSQL_RES *res)
+i p # unsigned int mysql_num_fields(MYSQL_RES *res)
+c p # my_bool mysql_eof(MYSQL_RES *res)
+p pi # MYSQL_FIELD *mysql_fetch_field_direct(MYSQL_RES *res,
+# unsigned int fieldnr)
+p p # MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES *res)
+p p # MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES *res)
+i p # MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES *res)
+i p # unsigned int mysql_field_count(MYSQL *mysql)
+l p #! my_ulonglong mysql_affected_rows(MYSQL *mysql)
+l p #! my_ulonglong mysql_insert_id(MYSQL *mysql)
+i p # unsigned int mysql_errno(MYSQL *mysql)
+t p # const char * mysql_error(MYSQL *mysql)
+t p # const char * mysql_info(MYSQL *mysql)
+l p # unsigned long mysql_thread_id(MYSQL *mysql)
+t p # const char * mysql_character_set_name(MYSQL *mysql)
+p p # MYSQL * mysql_init(MYSQL *mysql)
+
+i pttttt # int mysql_ssl_set(MYSQL *mysql, const char *key,
+# const char *cert, const char *ca, const char *capath,
+# const char *cipher)
+c pttt # my_bool mysql_change_user(MYSQL *mysql, const char *user,
+# const char *passwd, const char *db)
+p pttttiti # MYSQL * mysql_real_connect(MYSQL *mysql, const char *host,
+# const char *user, const char *passwd,
+# const char *db, unsigned int port,
+# const char *unix_socket,
+# unsigned int clientflag)
+v p # void mysql_close(MYSQL *sock)
+i pt # int mysql_select_db(MYSQL *mysql, const char *db)
+i pt # int mysql_query(MYSQL *mysql, const char *q)
+i ptl # int mysql_real_query(MYSQL *mysql, const char *q,
+# unsigned long length)
+i p # int mysql_shutdown(MYSQL *mysql)
+i p # int mysql_dump_debug_info(MYSQL *mysql)
+i pi # int mysql_refresh(MYSQL *mysql, unsigned int refresh_options)
+i pl # int mysql_kill(MYSQL *mysql,unsigned long pid)
+i p # int mysql_ping(MYSQL *mysql)
+t p # const char * mysql_stat(MYSQL *mysql)
+t p # const char * mysql_get_server_info(MYSQL *mysql)
+t p # const char * mysql_get_client_info(void)
+l # unsigned long mysql_get_client_version(void)
+t p # const char * mysql_get_host_info(MYSQL *mysql)
+t p # unsigned int mysql_get_proto_info(MYSQL *mysql)
+p pt # MYSQL_RES * mysql_list_dbs(MYSQL *mysql,const char *wild)
+p pt # MYSQL_RES * mysql_list_tables(MYSQL *mysql,const char *wild)
+p ptt # MYSQL_RES * mysql_list_fields(MYSQL *mysql, const char *table,
+# const char *wild)
+p p # MYSQL_RES * mysql_list_processes(MYSQL *mysql)
+p p # MYSQL_RES * mysql_store_result(MYSQL *mysql)
+p p # MYSQL_RES * mysql_use_result(MYSQL *mysql)
+i pit # int mysql_options(MYSQL *mysql,enum mysql_option option,
+# const char *arg)
+v p # void mysql_free_result(MYSQL_RES *result)
+v pl # void mysql_data_seek(MYSQL_RES *result, my_ulonglong offset)
+p pp # MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES *result,
+# MYSQL_ROW_OFFSET offset)
+i pi # MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES *result,
+# MYSQL_FIELD_OFFSET offset)
+
+p p # MYSQL_ROW mysql_fetch_row(MYSQL_RES *result)
+l p # unsigned long * mysql_fetch_lengths(MYSQL_RES *result)
+p p # MYSQL_FIELD * mysql_fetch_field(MYSQL_RES *result)
+l ttl # unsigned long mysql_escape_string(char *to,const char *from,
unsigned long from_length)
+l pttl # unsigned long mysql_real_escape_string(MYSQL *mysql, char
*to,const char *from, unsigned long length)
+v t # void mysql_debug(const char *debug)
+# --- end mysqlclient library ---
+
+# Used by library/pcre.pir
+p tiB3P
+p tip3P
+i pPtiiipi
+i tpiibi
+
+# Oddball ones for postgres
+p ptippppi PQexecParams
+p pi33ipi PQfn
+p pttip PQprepage
+p ptipppi PQexecPrepared
+p ppP PQsetNoticeReceiver
+
+# Used by SDL
+p iiil
+i ppl
+v pip
+p pti
+i ppp
+
+# Used by SDL::Font
+p ti
+p ptp
+i pt33
+
+# t/pmc/nci.t
+c
+c p
+c pi
+
+d
+d d
+
+f
+f ff
+f is
+
+i
+i b
+i d
+i i
+i ii
+i ii4
+i ii4i
+i iiii
+i iiilsp
+i iil
+i iili
+i iip
+i iit
+i iiti
+i ilsp
+i iti
+i l
+i li
+i lp
+i lsp
+i p
+i p33
+i p333
+i p333333
+i p4
+i p42p
+i p4i
+i pb
+i pi
+i pii
+i pii4
+i pii4i
+i piii
+i piiiiii
+i piiilsp
+i piil
+i piili
+i piit
+i piiti
+i pilsp
+i pit
+i pl
+i pli
+i pll
+i pllllllll
+i plp
+i plsp
+i pp
+i ppi
+i ppiiiiiiii
+i pppp
+i psp
+i pt
+i pti
+i pitl
+i s
+i s22
+i s222
+i sp
+i sss
+i ssss
+i t
+i ti
+i 4
+i 4i
+i 42p
+
+l
+l ii
+l l4
+l p
+l pi
+l pii
+l p33l
+l 33l
+
+p
+p B
+p b
+p Jt
+p i
+p ii
+p iiii
+p iiiiii
+p iiiiiiii
+p p
+p pt
+p pi
+p pii
+p piiii
+p t
+p tpp
+p ttttttt
+
+s
+
+t
+t i
+t ii
+t p
+t pi
+t pii
+t pt
+t t
+t tl4
+t t4
+
+i sc
+s sc
+c sc
+i iii
+i i3
+t b
+t B
+v P
+v pP
+p ip
+i 33
+v pii
+v JO
+i JO
+i JOi
+i JOt
+i Jt
+i Ji
Added: trunk/config/gen/call_list/opengl.in
==============================================================================
--- (empty file)
+++ trunk/config/gen/call_list/opengl.in Tue May 6 22:06:35 2008
@@ -0,0 +1,7 @@
+# Used by OpenGL (including GLU and GLUT)
+v 3p
+v PP
+v PPi
+v PPii
+v fff
+v ffff
Modified: trunk/lib/Parrot/Configure/Step/List.pm
==============================================================================
--- trunk/lib/Parrot/Configure/Step/List.pm (original)
+++ trunk/lib/Parrot/Configure/Step/List.pm Tue May 6 22:06:35 2008
@@ -72,6 +72,7 @@
gen::crypto
gen::parrot_include
gen::opengl
+ gen::call_list
gen::languages
gen::makefiles
gen::platform
Added: trunk/t/steps/gen_call_list-01.t
==============================================================================
--- (empty file)
+++ trunk/t/steps/gen_call_list-01.t Tue May 6 22:06:35 2008
@@ -0,0 +1,50 @@
+#! perl
+# Copyright (C) 2007-2008, The Perl Foundation.
+# $Id: $
+# gen_call_list-01.t
+
+use strict;
+use warnings;
+use Test::More tests => 2;
+use Carp;
+use lib qw( lib );
+use_ok('config::gen::call_list');
+
+=for hints_for_testing This is just a stub so that Configure.pl will run.
+
+=cut
+
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+ gen_call_list-01.t - test config::gen::call_list
+
+=head1 SYNOPSIS
+
+ % prove t/steps/gen_call_list-01.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F<Configure.pl>.
+
+The tests in this file test subroutines exported by config::gen::call_list.
+
+=head1 AUTHOR
+
+Geoffrey Broadwell; modified from a similar file by James E Keenan
+
+=head1 SEE ALSO
+
+config::gen::call_list, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4: