Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
5271a058
Commit
5271a058
authored
Jul 23, 2008
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the upstream hsc2hs repo
parent
f0d822f4
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
8 additions
and
1170 deletions
+8
-1170
darcs-all
darcs-all
+8
-1
utils/hsc2hs/LICENSE
utils/hsc2hs/LICENSE
+0
-31
utils/hsc2hs/Main.hs
utils/hsc2hs/Main.hs
+0
-915
utils/hsc2hs/Makefile
utils/hsc2hs/Makefile
+0
-7
utils/hsc2hs/Makefile.inc
utils/hsc2hs/Makefile.inc
+0
-7
utils/hsc2hs/Makefile.nhc98
utils/hsc2hs/Makefile.nhc98
+0
-48
utils/hsc2hs/hsc2hs.cabal
utils/hsc2hs/hsc2hs.cabal
+0
-41
utils/hsc2hs/hsc2hs.sh
utils/hsc2hs/hsc2hs.sh
+0
-2
utils/hsc2hs/hsc2hs.wrapper
utils/hsc2hs/hsc2hs.wrapper
+0
-13
utils/hsc2hs/template-hsc.h
utils/hsc2hs/template-hsc.h
+0
-105
No files found.
darcs-all
View file @
5271a058
...
...
@@ -2,7 +2,7 @@
use
strict
;
my
@top_dirs
=
("
nofib
",
"
testsuite
");
my
@top_dirs
=
("
nofib
",
"
testsuite
"
,
"
utils/hsc2hs
"
);
# Figure out where to get the other repositories from,
# based on where this GHC repo came from.
...
...
@@ -10,6 +10,7 @@ my $defaultrepo = `cat _darcs/prefs/defaultrepo`;
chomp
$defaultrepo
;
my
$defaultrepo_base
;
my
$defaultrepo_lib
;
my
$hsc2hs_repo_loc
;
if
(
$defaultrepo
=~
/^...*:/
)
{
# HTTP or SSH
...
...
@@ -18,12 +19,14 @@ if ($defaultrepo =~ /^...*:/) {
$defaultrepo_base
=
$defaultrepo
;
$defaultrepo_base
=~
s#/[^/]+/?$##
;
$defaultrepo_lib
=
"
$defaultrepo_base
/packages
";
$hsc2hs_repo_loc
=
$defaultrepo_base
;
}
elsif
(
$defaultrepo
=~
/^(\.\.)?\//
)
{
# Local filesystem, either absolute or relative path
# (assumes a checked-out tree):
$defaultrepo_base
=
$defaultrepo
;
$defaultrepo_lib
=
"
$defaultrepo
/libraries
";
$hsc2hs_repo_loc
=
"
$defaultrepo_base
/utils
";
}
else
{
die
"
Couldn't work out defaultrepo
";
...
...
@@ -116,6 +119,10 @@ sub darcsget {
darcsgetpackage
(
$nofib
,
$r_flags
,
$defaultrepo_base
,
"
nofib
");
darcsgetpackage
(
$testsuite
,
$r_flags
,
$defaultrepo_base
,
"
testsuite
");
chdir
"
utils
";
darcsgetpackage
(
1
,
$r_flags
,
$hsc2hs_repo_loc
,
"
hsc2hs
");
chdir
"
..
";
chdir
"
libraries
";
my
@packages
;
...
...
utils/hsc2hs/LICENSE
deleted
100644 → 0
View file @
f0d822f4
The Glasgow Haskell Compiler License
Copyright 2002, The University Court of the University of Glasgow.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither name of the University nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
utils/hsc2hs/Main.hs
deleted
100644 → 0
View file @
f0d822f4
This diff is collapsed.
Click to expand it.
utils/hsc2hs/Makefile
deleted
100644 → 0
View file @
f0d822f4
TOP
=
../..
ENABLE_SHELL_WRAPPERS
=
YES
include
$(TOP)/mk/boilerplate.mk
include
$(TOP)/mk/cabal.mk
utils/hsc2hs/Makefile.inc
deleted
100644 → 0
View file @
f0d822f4
ifeq
"" "${MKDIR}"
MKDIR
:=
$(
shell
pwd
)
#MKDIR:=$(PWD)
else
MKDIR
:=
$(
patsubst
%/
$(
notdir
${MKDIR}
)
,%,
${MKDIR}
)
endif
include
${MKDIR}/Makefile.inc
utils/hsc2hs/Makefile.nhc98
deleted
100644 → 0
View file @
f0d822f4
include
Makefile.inc
OBJDIR
=
${BUILDDIR}
/obj/hsc2hs
TARGET
=
${DST}
/hsc2hs
$(EXE)
SRCS
=
Main.hs
FROMC
=
../libraries/base/System/Console/GetOpt.
$C
\
../libraries/base/Data/List.
$C
\
../libraries/base/System/Cmd.
$C
ifeq
"$(findstring ghc, ${HC})" "ghc"
HFLAGS
=
$(
shell
$(LOCAL)
fixghc
$(GHCSYM)
-package
base
-package
lang
)
export
HFLAGS
endif
ifeq
"$(findstring hbc, ${HC})" "hbc"
HFLAGS
=
export
HFLAGS
endif
ifeq
"$(findstring nhc98, ${HC})" "nhc98"
HFLAGS
=
-package
base +CTS
-H4M
-CTS
export
HFLAGS
endif
all
:
$(TARGET)
install
:
$(TARGET)
cfiles
:
cleanC $(SRCS)
$(HMAKE)
-hc
=
$(LOCAL)
nhc98
-package
base
-C
Main.hs
clean
:
-
rm
-f
*
.hi
*
.o
$(OBJDIR)
/
*
.o
cleanC
:
clean
-
rm
-f
*
.hc
*
.c
realclean
:
clean cleanC
-
rm
-f
$(OBJDIR)
/Main
$(EXE)
$(TARGET)
:
$(OBJDIR) $(SRCS)
$(HMAKE)
-hc
=
$(HC)
Main
-d
$(OBJDIR)
-DBUILD_NHC
\
$(
shell
echo
"
${BUILDOPTS}
"
)
$(HFLAGS)
$(CYGFLAG)
mv
$(OBJDIR)
/Main
$(EXE)
$(TARGET)
$(STRIP)
$(TARGET)
$(OBJDIR)
:
mkdir
-p
$(OBJDIR)
fromC
:
$(OBJDIR)
cp
$(FROMC)
.
$(LOCAL)
nhc98
-cpp
-o
$(TARGET)
-d
$(OBJDIR)
*
.
$C
$(STRIP)
$(TARGET)
utils/hsc2hs/hsc2hs.cabal
deleted
100644 → 0
View file @
f0d822f4
Name: hsc2hs
Version: 0.67
Copyright: 2000, Marcin Kowalczyk
Build-Depends: base, directory, process
License: BSD3
License-File: LICENSE
Author: Marcin Kowalczyk <qrczak@knm.org.pl>
Maintainer: cvs-fptools@haskell.org
Synopsis: A preprocessor that helps with writing Haskell bindings to C code
Description:
The hsc2hs program can be used to automate some parts of the
process of writing Haskell bindings to C code. It reads an
almost-Haskell source file with embedded special constructs, and
outputs a real Haskell file with these constructs processed, based
on information taken from some C headers. The extra constructs
provide Haskell counterparts of C types, values of C constants,
including sizes of C types, and access to fields of C structs.
.
For more details, see
http://www.haskell.org/ghc/docs/latest/html/users_guide/hsc2hs.html
Category: Development
Data-Files: template-hsc.h
build-type: Simple
cabal-version: >=1.2
Flag base3
Description: Choose the new smaller, split-up base package.
Executable hsc2hs
Main-Is: Main.hs
-- needed for ReadP (used by Data.Version)
Hugs-Options: -98
Extensions: CPP, ForeignFunctionInterface
if flag(base3)
Build-Depends: base >= 3 && < 4,
directory >= 1 && < 1.1,
process >= 1 && < 1.1
else
Build-Depends: base < 3
Build-Depends: haskell98, Cabal
utils/hsc2hs/hsc2hs.sh
deleted
100644 → 0
View file @
f0d822f4
tflag
=
"--template=
$HSC2HS_DIR
/template-hsc.h"
$HSC2HS_BINDIR
/
$HS_PROG
$tflag
$HSC2HS_EXTRA
"
$@
"
utils/hsc2hs/hsc2hs.wrapper
deleted
100644 → 0
View file @
f0d822f4
tflag="--template=$datadir/template-hsc.h"
for arg do
case "$arg" in
-c*) HSC2HS_EXTRA=;;
--cc=*) HSC2HS_EXTRA=;;
-t*) tflag=;;
--template=*) tflag=;;
--) break;;
esac
done
exec $executablename $tflag $HSC2HS_EXTRA ${1+"$@"}
utils/hsc2hs/template-hsc.h
deleted
100644 → 0
View file @
f0d822f4
#if __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 409
#include <Rts.h>
#endif
#include <HsFFI.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
#ifndef offsetof
#define offsetof(t, f) ((size_t) &((t *)0)->f)
#endif
#if __NHC__
#define hsc_line(line, file) \
printf ("# %d \"%s\"\n", line, file);
#else
#define hsc_line(line, file) \
printf ("{-# LINE %d \"%s\" #-}\n", line, file);
#endif
#define hsc_const(x) \
if ((x) < 0) \
printf ("%ld", (long)(x)); \
else \
printf ("%lu", (unsigned long)(x));
#define hsc_const_str(x) \
{ \
const char *s = (x); \
printf ("\""); \
while (*s != '\0') \
{ \
if (*s == '"' || *s == '\\') \
printf ("\\%c", *s); \
else if (*s >= 0x20 && *s <= 0x7E) \
printf ("%c", *s); \
else \
printf ("\\%d%s", \
(unsigned char) *s, \
s[1] >= '0' && s[1] <= '9' ? "\\&" : ""); \
++s; \
} \
printf ("\""); \
}
#define hsc_type(t) \
if ((t)(int)(t)1.4 == (t)1.4) \
printf ("%s%d", \
(t)(-1) < (t)0 ? "Int" : "Word", \
sizeof (t) * 8); \
else \
printf ("%s", \
sizeof (t) > sizeof (double) ? "LDouble" : \
sizeof (t) == sizeof (double) ? "Double" : \
"Float");
#define hsc_peek(t, f) \
printf ("(\\hsc_ptr -> peekByteOff hsc_ptr %ld)", (long) offsetof (t, f));
#define hsc_poke(t, f) \
printf ("(\\hsc_ptr -> pokeByteOff hsc_ptr %ld)", (long) offsetof (t, f));
#define hsc_ptr(t, f) \
printf ("(\\hsc_ptr -> hsc_ptr `plusPtr` %ld)", (long) offsetof (t, f));
#define hsc_offset(t, f) \
printf("(%ld)", (long) offsetof (t, f));
#define hsc_size(t) \
printf("(%ld)", (long) sizeof(t));
#define hsc_enum(t, f, print_name, x) \
print_name; \
printf (" :: %s\n", #t); \
print_name; \
printf (" = %s ", #f); \
if ((x) < 0) \
printf ("(%ld)\n", (long)(x)); \
else \
printf ("%lu\n", (unsigned long)(x));
#define hsc_haskellize(x) \
{ \
const char *s = (x); \
int upper = 0; \
if (*s != '\0') \
{ \
putchar (tolower (*s)); \
++s; \
while (*s != '\0') \
{ \
if (*s == '_') \
upper = 1; \
else \
{ \
putchar (upper ? toupper (*s) : tolower (*s)); \
upper = 0; \
} \
++s; \
} \
} \
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment