compiled js conflict

This commit is contained in:
Galen Wolfe-Pauly 2015-08-31 15:52:00 -07:00
commit e3ba068424
568 changed files with 41982 additions and 4837 deletions

0
.d/v/.gitignore vendored
View File

184
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,184 @@
# Contributing to urbit
Thank you for your interest in contributing to urbit.
## Development practice
You may have an identity on the live network, but doing all your
development on the live network would be cumbersome and unnecessary.
Standard practice in urbit development is to work on a fake `~zod`. A
fake `~zod` will get its initial files from the `urb/zod/` directory
rather than trying to sync them over the network, which is invaluable
for working in Hoon. Also, a fake `~zod` or any fake urbit instances you
start do not talk to the live network, but to a fake network that exists
only on your computer.
To start a fake `~zod`, the command is:
bin/urbit -F -I zod -c [pier directory]
To resume one that was already created, just as on the live network,
remove `-c` (but leave the rest of the options there). `-F` uses the
fake network, and `-I` starts an "imperial" instance - that is, an 8-bit
galaxy.
## Kernel development
Working on either C or non-kernel Hoon should not bring any surprises,
but the Hoon kernel (anything under `urb/zod/arvo/`) is bootstrapped
from `urbit.pill` in `urb/`, and must be manually recompiled if any
changes are made. The command to manually recompile the kernel and
install the new kernel is `|reset` in `dojo`. This rebuilds from the
`arvo` directory in the `home` desk in `%clay`. Currently, `|reset`
does not reload apps like `dojo` itself, which will still reference the
old kernel. To force them to reload, make a trivial edit to their main
source file (under the `ape` directory) in `%clay`.
If you do any kernel development, be sure to read the section below about
pills.
## Git practice
Since we use the GitHub issue tracker, it is helpful to contribute via a
GitHub pull request. If you already know what you are doing, skip down
to the Style section.
Start by cloning the repository on your work machine:
git clone https://github.com/urbit/urbit
And, additionally, fork the repository on GitHub by clicking the "Fork"
button. Add your fork as a remote:
git remote add [username] https://github.com/[username]/urbit
and set it as the default remote to push to:
git config --local remote.pushDefault [username]
This is good practice for any project that uses git. You will pull
upstream branches from urbit/urbit and push to your personal urbit fork
by default.
Next, check out `test`, which is the mainline development branch, and
base a new branch on it to do your work on:
git checkout test
git checkout -b [branch name]
Now you are free to do your work on this branch. When finished, you may
want to clean up your commits:
git rebase -i test
Then you can push to your public fork with `git push` and make a pull
request via the GitHub UI. Make sure you request to merge your branch
into `test`, not `master`.
After your changes are merged upstream, you can delete your branch (via
github UI or `git push :[branch]` remotely, and with `git branch -d`
locally).
## Style
The urbit project uses two-space indentation and avoids tab characters.
In C code, it should not be too difficult to mimic the style of the code
around you, which is just fairly standard K&R with braces on every
compound statement. One thing to watch out for is top-level sections in
source files that are denoted by comments and are actually indented one
level.
Hoon will be a less familiar language to many contributors. Some of our
less obvious stylistic rules are:
- Keep your source files 80 characters or less wide. Many urbit
developers use 80 character terminals/tmux panes/&c.
- Tab characters are actually a syntax error, so be extra sure your
editor is not inserting any. Trailing whitespace is *usually* not a
syntax error, but avoiding it is encouraged.
- The kernel convention is that line comments start at column 57 with
the `::` followed by 2 spaces. This leaves 20 characters for the
comment. Outside the kernel, things are less strict.
- Tall arms within a core are conventionally separated by empty comments
(just `::`) at the same indentation level as the initial `++` or `+-`.
The last arm in a core is not followed by an empty comment, because it
is visually closed by the `--` that closes the core. The empty comment
is also sometimes omitted in data structure definitions.
## The kernel and pills
urbit bootstraps itself using a binary blob called `urbit.pill`, which
we do indeed keep in version control. This creates some special
requirements. If you are not changing anything in the kernel (everything
under `urb/zod/arvo/`) then you can skim this section (please do not
skip it entirely, though). If you *are* working there, then this
section is critically important!
The procedure for creating `urbit.pill` is often called "soliding". It
is somewhat similar to `|reset`, but instead of replacing your running
kernel, it writes the compiled kernel to a file. The command to solid
is, on a fakezod:
.urbit/pill +solid
When the compilation finishes, your `urbit.pill` will be found in the
`[pier]/.urb/put/` directory. Copy it into `urb/` and add it to your
commit.
The requirement here is that every commit that changes the kernel must
come with an `urbit.pill` built from the same code in `urb/zod/arvo/`
for that commit. (Only changing the actual Hoon code counts, so a change
to a jet with no corresponding Hoon change does not require a new pill.)
This is so that checking out an arbitrary revision and starting up a
fakezod actually works as expected. However you do this is fine, but I
like to do it as part of my committing process - just before `git
commit`, I fire up a new fakezod. This will use the previous
`urbit.pill`, but the kernel code in `%clay` will be copied from
`urb/zod/arvo/`, so `+solid` will compile it. Then I copy `urbit.pill`
into `urb/` and make my commit.
If you rebase or interactive rebase your commits, be sure to preserve
this property on all the commits you end up with. If multiple people
were collaborating on your branch, you may end up with conflicts in
`urbit.pill` and have to merge the branch into itself to resolve them.
Just do the same procedure to create a new, merged pill before
committing the merge. Otherwise, just make sure to use the correct
`urbit.pill` for each commit.
## What to work on
If you are not thinking of contributing with a specific goal in mind,
the GitHub issue tracker is the first place you should look for ideas.
Issues are tagged with a priority and a difficulty. A good place to
start is on either a low-difficulty issue or a low-priority issue.
Higher priority issues are likely to be assigned to someone - if this is
the case, then contacting that person to coordinate before starting to
work is probably a good idea.
There is also a "help wanted" tag for things that we are especially
eager to have outside contributions on. Check here first!
## Staying in touch
The urbit developers communicate on urbit itself. Joining the
`~doznec/urbit-meta` channel on `talk` is highly recommended.
Subscribing to `urbit-dev` on Google Groups is also recommended, since
this is where continuity breach notifications are sent.
You can also contact one of the following people:
- Philip Monk
email: philip.monk@tlon.io
urbit: `~wictuc-folrex`
GitHub: [@philipcmonk](https://github.com/philipcmonk/)
- Raymond Pasco
email: ray@the.ug
urbit: `~ramtev-wisbyt`
GitHub: [@juped](https://github.com/juped/)

391
Makefile
View File

@ -19,7 +19,7 @@ else ifeq ($(UNAME),FreeBSD)
OS=bsd
else ifeq ($(UNAME),OpenBSD)
OS=bsd
else
else
$(error unknown unix)
endif
@ -36,10 +36,17 @@ BIN=bin
LIB=$(shell pwd)/urb
RM=rm -f
ifneq ($(UNAME),FreeBSD)
CC=gcc
CXX=g++
CXXFLAGS=$(CFLAGS)
CLD=g++ -O3 -L/usr/local/lib -L/opt/local/lib
else
CC=cc
CXX=c++
CXXFLAGS=$(CFLAGS)
CLD=c++ -O3 -L/usr/local/lib -L/opt/local/lib
endif
ifeq ($(OS),osx)
COSFLAGS=-fno-diagnostics-fixit-info
@ -60,11 +67,12 @@ else
LIBS=-lssl -lcrypto -lgmp -lncurses -lsigsegv $(OSLIBS)
endif
INCLUDE=i
INCLUDE=include
MDEFINES=-DU3_OS_$(OS) -DU3_OS_ENDIAN_$(ENDIAN) -D U3_LIB=\"$(LIB)\"
# NOTFORCHECKIN - restore -O3
# -DGHETTO
# -DHUSH
CFLAGS= $(COSFLAGS) -O3 -msse3 -ffast-math \
-funsigned-char \
-I/usr/local/include \
@ -79,6 +87,7 @@ CFLAGS= $(COSFLAGS) -O3 -msse3 -ffast-math \
-Ioutside/commonmark/src \
-Ioutside/commonmark/build/src \
-Ioutside/scrypt \
-Ioutside/softfloat-3/source/include \
$(DEFINES) \
$(MDEFINES)
@ -106,165 +115,176 @@ else
endif
N_OFILES=\
n/a.o \
n/e.o \
n/h.o \
n/i.o \
n/j.o \
n/m.o \
n/n.o \
n/r.o \
n/t.o \
n/x.o \
n/v.o \
n/z.o
noun/allocate.o \
noun/events.o \
noun/hashtable.o \
noun/imprison.o \
noun/jets.o \
noun/manage.o \
noun/nock.o \
noun/retrieve.o \
noun/trace.o \
noun/xtract.o \
noun/vortex.o \
noun/zave.o
J_A_OFILES=\
j/a/add.o \
j/a/dec.o \
j/a/div.o \
j/a/gte.o \
j/a/gth.o \
j/a/lte.o \
j/a/lth.o \
j/a/mod.o \
j/a/mul.o \
j/a/sub.o
jets/a/add.o \
jets/a/dec.o \
jets/a/div.o \
jets/a/gte.o \
jets/a/gth.o \
jets/a/lte.o \
jets/a/lth.o \
jets/a/mod.o \
jets/a/mul.o \
jets/a/sub.o
J_B_OFILES=\
j/b/bind.o \
j/b/clap.o \
j/b/drop.o \
j/b/flop.o \
j/b/lent.o \
j/b/levy.o \
j/b/lien.o \
j/b/need.o \
j/b/reel.o \
j/b/roll.o \
j/b/skim.o \
j/b/skip.o \
j/b/scag.o \
j/b/slag.o \
j/b/snag.o \
j/b/sort.o \
j/b/turn.o \
j/b/weld.o
jets/b/bind.o \
jets/b/clap.o \
jets/b/drop.o \
jets/b/flop.o \
jets/b/lent.o \
jets/b/levy.o \
jets/b/lien.o \
jets/b/need.o \
jets/b/reel.o \
jets/b/roll.o \
jets/b/skim.o \
jets/b/skip.o \
jets/b/scag.o \
jets/b/slag.o \
jets/b/snag.o \
jets/b/sort.o \
jets/b/turn.o \
jets/b/weld.o
J_C_OFILES=\
j/c/bex.o \
j/c/can.o \
j/c/cap.o \
j/c/cat.o \
j/c/con.o \
j/c/cut.o \
j/c/dor.o \
j/c/dis.o \
j/c/end.o \
j/c/gor.o \
j/c/hor.o \
j/c/lsh.o \
j/c/mas.o \
j/c/met.o \
j/c/mix.o \
j/c/mug.o \
j/c/peg.o \
j/c/po.o \
j/c/rap.o \
j/c/rip.o \
j/c/rsh.o \
j/c/vor.o
jets/c/bex.o \
jets/c/xeb.o \
jets/c/can.o \
jets/c/cap.o \
jets/c/cat.o \
jets/c/con.o \
jets/c/cut.o \
jets/c/dor.o \
jets/c/dvr.o \
jets/c/dis.o \
jets/c/end.o \
jets/c/gor.o \
jets/c/hor.o \
jets/c/lsh.o \
jets/c/mas.o \
jets/c/met.o \
jets/c/mix.o \
jets/c/mug.o \
jets/c/peg.o \
jets/c/po.o \
jets/c/pow.o \
jets/c/rap.o \
jets/c/rip.o \
jets/c/rsh.o \
jets/c/sqt.o \
jets/c/vor.o
J_D_OFILES=\
j/d/in_has.o \
j/d/in_int.o \
j/d/in_gas.o \
j/d/in_mer.o \
j/d/in_put.o \
j/d/in_tap.o \
j/d/in_uni.o \
j/d/by_gas.o \
j/d/by_get.o \
j/d/by_has.o \
j/d/by_int.o \
j/d/by_put.o \
j/d/by_uni.o
jets/d/in_has.o \
jets/d/in_int.o \
jets/d/in_gas.o \
jets/d/in_mer.o \
jets/d/in_put.o \
jets/d/in_tap.o \
jets/d/in_uni.o \
jets/d/in_bif.o \
jets/d/in_dif.o \
jets/d/by_gas.o \
jets/d/by_get.o \
jets/d/by_has.o \
jets/d/by_int.o \
jets/d/by_put.o \
jets/d/by_uni.o \
jets/d/by_bif.o \
jets/d/by_dif.o
J_E_OFILES=\
j/e/aesc.o \
j/e/cue.o \
j/e/jam.o \
j/e/mat.o \
j/e/mink.o \
j/e/mule.o \
j/e/parse.o \
j/e/rd.o \
j/e/repg.o \
j/e/rexp.o \
j/e/rub.o \
j/e/scr.o \
j/e/shax.o \
j/e/lore.o \
j/e/loss.o \
j/e/trip.o
jets/e/aesc.o \
jets/e/cue.o \
jets/e/fl.o \
jets/e/jam.o \
jets/e/mat.o \
jets/e/mink.o \
jets/e/mule.o \
jets/e/parse.o \
jets/e/rd.o \
jets/e/rq.o \
jets/e/rs.o \
jets/e/repg.o \
jets/e/rexp.o \
jets/e/rub.o \
jets/e/scr.o \
jets/e/shax.o \
jets/e/lore.o \
jets/e/loss.o \
jets/e/trip.o
J_E_OFILES_ED=\
j/e/ed_puck.o \
j/e/ed_sign.o \
j/e/ed_veri.o
jets/e/ed_puck.o \
jets/e/ed_sign.o \
jets/e/ed_veri.o
J_F_OFILES=\
j/f/al.o \
j/f/ap.o \
j/f/bull.o \
j/f/cell.o \
j/f/comb.o \
j/f/cons.o \
j/f/core.o \
j/f/cube.o \
j/f/face.o \
j/f/fitz.o \
j/f/flan.o \
j/f/flay.o \
j/f/flip.o \
j/f/flor.o \
j/f/fork.o \
j/f/hike.o \
j/f/look.o \
jets/f/al.o \
jets/f/ap.o \
jets/f/bull.o \
jets/f/cell.o \
jets/f/comb.o \
jets/f/cons.o \
jets/f/core.o \
jets/f/cube.o \
jets/f/face.o \
jets/f/fitz.o \
jets/f/flan.o \
jets/f/flay.o \
jets/f/flip.o \
jets/f/flor.o \
jets/f/fork.o \
jets/f/hike.o \
jets/f/look.o \
J_F_OFILES_UT=\
j/f/ut.o \
j/f/ut_burn.o \
j/f/ut_busk.o \
j/f/ut_bust.o \
j/f/ut_conk.o \
j/f/ut_crop.o \
j/f/ut_cull.o \
j/f/ut_find.o \
j/f/ut_fink.o \
j/f/ut_fire.o \
j/f/ut_firm.o \
j/f/ut_fish.o \
j/f/ut_fuse.o \
j/f/ut_gain.o \
j/f/ut_heal.o \
j/f/ut_lose.o \
j/f/ut_mint.o \
j/f/ut_mull.o \
j/f/ut_nest.o \
j/f/ut_park.o \
j/f/ut_peek.o \
j/f/ut_play.o \
j/f/ut_repo.o \
j/f/ut_rest.o \
j/f/ut_seek.o \
j/f/ut_swab.o \
j/f/ut_tack.o \
j/f/ut_tock.o \
j/f/ut_wrap.o
jets/f/ut.o \
jets/f/ut_burn.o \
jets/f/ut_busk.o \
jets/f/ut_bust.o \
jets/f/ut_conk.o \
jets/f/ut_crop.o \
jets/f/ut_cull.o \
jets/f/ut_find.o \
jets/f/ut_fink.o \
jets/f/ut_fire.o \
jets/f/ut_firm.o \
jets/f/ut_fish.o \
jets/f/ut_fuse.o \
jets/f/ut_gain.o \
jets/f/ut_heal.o \
jets/f/ut_lose.o \
jets/f/ut_mint.o \
jets/f/ut_mull.o \
jets/f/ut_nest.o \
jets/f/ut_park.o \
jets/f/ut_peek.o \
jets/f/ut_play.o \
jets/f/ut_repo.o \
jets/f/ut_rest.o \
jets/f/ut_seek.o \
jets/f/ut_swab.o \
jets/f/ut_tack.o \
jets/f/ut_tock.o \
jets/f/ut_wrap.o
J_G_OFILES=\
j/g/down.o
jets/g/down.o
J_OFILES=\
$(J_A_OFILES) \
@ -276,7 +296,7 @@ J_OFILES=\
$(J_F_OFILES) \
$(J_F_OFILES_UT) \
$(J_G_OFILES) \
j/tree.o
jets/tree.o
BASE_OFILES=$(N_OFILES) $(J_OFILES)
@ -287,25 +307,25 @@ OUT_OFILES=\
outside/jhttp/http_parser.o
V_OFILES=\
v/ames.o \
v/cttp.o \
v/http.o \
v/loop.o \
v/raft.o \
v/reck.o \
v/sist.o \
v/temp.o \
v/term.o \
v/time.o \
v/unix.o \
v/save.o \
v/walk.o
vere/ames.o \
vere/behn.o \
vere/cttp.o \
vere/http.o \
vere/loop.o \
vere/raft.o \
vere/reck.o \
vere/sist.o \
vere/term.o \
vere/time.o \
vere/unix.o \
vere/save.o \
vere/walk.o
MAIN_FILE =\
v/main.o
vere/main.o
MEME_FILE =\
w/test.o
tests/test.o
VERE_OFILES=\
$(CRE2_OFILES) \
@ -325,19 +345,19 @@ VERE_DFILES=$(VERE_OFILES:%.o=.d/%.d)
-include $(VERE_DFILES)
# This is a silly hack necessitated by the fact that libuv uses configure
#
# * Making 'all' obviously requires outside/libuv,
#
# * Making 'all' obviously requires outside/libuv,
# which requires the libuv Makefile to be created.
# * Making distclean on outside/libuv destroys the makefile.
# * ...so configuring outside/libuv is parodoxically required
# * ...so configuring outside/libuv is parodoxically required
# in order to distclean it!
# * But what if developer types 'make distclean all' ?
# * first target makes libuv Makefile, then destroys it...and
# * first target makes libuv Makefile, then destroys it...and
# second target knows that it was made.
# * ...so second target borks.
# * Solution: make libuv not only depend on its own Makefile,
# * Solution: make libuv not only depend on its own Makefile,
# but on a side effect of creating its own makefile.
#
#
LIBUV_MAKEFILE=outside/libuv_0.11/Makefile
LIBUV_MAKEFILE2=outside/libuv_0.11/config.log
@ -353,6 +373,8 @@ LIBCOMMONMARK=outside/commonmark/build/src/libcmark.a
LIBSCRYPT=outside/scrypt/scrypt.a
LIBSOFTFLOAT=outside/softfloat-3/build/Linux-386-GCC/softfloat.a
all: urbit
.MAKEFILE-VERSION: Makefile .make.conf
@ -368,8 +390,23 @@ meme: $(BIN)/meme
$(LIBUV_MAKEFILE) $(LIBUV_MAKEFILE2):
cd outside/libuv_0.11 ; sh autogen.sh ; ./configure --disable-dtrace
# [h]act II: the plot thickens
#
# * Specifying two targets that each configure libuv works
# when the rules are executed sequentially,
# * but when attempting a parallel build, it is likely Make
# will try to configure libuv simultaneously.
# * We can specify a dependency between the two targets so
# that execution of their rule(s) is serialized.
# * Further, libuv does not seem to be friendly towards
# parallel builds either. A true fix is out of scope here
# * ...so we must instruct Make to only use one job when it
# attempts to build libuv.
#
$(LIBUV_MAKEFILE2): $(LIBUV_MAKEFILE)
$(LIBUV): $(LIBUV_MAKEFILE) $(LIBUV_MAKEFILE2)
$(MAKE) -C outside/libuv_0.11 all-am
$(MAKE) -C outside/libuv_0.11 all-am -j1
$(LIBRE2):
$(MAKE) -C outside/re2 obj/libre2.a
@ -386,25 +423,28 @@ $(LIBCOMMONMARK):
$(LIBSCRYPT):
$(MAKE) -C outside/scrypt MDEFINES="$(MDEFINES)"
$(LIBSOFTFLOAT):
$(MAKE) -C outside/softfloat-3/build/Linux-386-GCC
$(CRE2_OFILES): outside/cre2/src/src/cre2.cpp outside/cre2/src/src/cre2.h $(LIBRE2)
$(CXX) $(CXXFLAGS) -c $< -o $@
$(V_OFILES): i/v/vere.h
$(V_OFILES): include/vere/vere.h
ifdef NO_SILENT_RULES
$(BIN)/urbit: $(LIBCRE) $(LIBCOMMONMARK) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT)
$(BIN)/urbit: $(LIBCRE) $(LIBCOMMONMARK) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT) $(LIBSOFTFLOAT)
mkdir -p $(BIN)
$(CLD) $(CLDOSFLAGS) -o $(BIN)/urbit $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT)
$(CLD) $(CLDOSFLAGS) -o $(BIN)/urbit $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT) $(LIBSOFTFLOAT)
else
$(BIN)/urbit: $(LIBCRE) $(LIBCOMMONMARK) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT)
$(BIN)/urbit: $(LIBCRE) $(LIBCOMMONMARK) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT) $(LIBSOFTFLOAT)
@echo " CCLD $(BIN)/urbit"
@mkdir -p $(BIN)
@$(CLD) $(CLDOSFLAGS) -o $(BIN)/urbit $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT)
@$(CLD) $(CLDOSFLAGS) -o $(BIN)/urbit $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT) $(LIBSOFTFLOAT)
endif
$(BIN)/meme: $(LIBCRE) $(LIBCOMMONMARK) $(MEME_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT)
$(BIN)/meme: $(LIBCRE) $(LIBCOMMONMARK) $(MEME_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT) $(LIBSOFTFLOAT)
mkdir -p $(BIN)
$(CLD) $(CLDOSFLAGS) -o $(BIN)/meme $(MEME_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT)
$(CLD) $(CLDOSFLAGS) -o $(BIN)/meme $(MEME_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT) $(LIBSOFTFLOAT)
tags:
ctags -R -f .tags --exclude=root
@ -431,14 +471,17 @@ debinstall:
cp urb/urbit.pill $(DESTDIR)/usr/share/urb
cp -R urb/zod $(DESTDIR)/usr/share/urb
clean:
clean:
$(RM) $(VERE_OFILES) $(BIN)/urbit urbit.pkg $(VERE_DFILES)
# 'make distclean all -jn' ∀ n>1 still does not work because it is possible
# Make will attempt to build urbit while it is also cleaning urbit..
distclean: clean $(LIBUV_MAKEFILE)
$(MAKE) -C outside/libuv_0.11 distclean
$(MAKE) -C outside/re2 clean
$(MAKE) -C outside/ed25519 clean
$(MAKE) -C outside/anachronism clean
$(MAKE) -C outside/scrypt clean
$(MAKE) -C outside/softfloat-3/build/Linux-386-GCC clean
.PHONY: clean debbuild debinstalldistclean etags osxpackage tags

View File

@ -17,9 +17,21 @@ keeping in touch or following the project you can:
All of the source code is distributed under the MIT license, but is for
all intents and purposes in the public domain.
Install
-------
Pacakges
--------
#### Ubuntu or Debian
Third-party pacakge files are maintained at https://github.com/yebyen/urbit-deb. Urbit is only supported on Jessie onward.
#### OS X - Homebrew
brew install --HEAD homebrew/head-only/urbit
If this succeeds, proceed to the [Run section](#run). Otherwise, the build must be done manually:
Dependencies
------------
urbit depends on:
gcc
@ -39,9 +51,12 @@ urbit depends on:
sudo apt-get install libgmp3-dev libsigsegv-dev openssl libssl-dev libncurses5-dev git make exuberant-ctags automake autoconf libtool g++ ragel cmake re2c
*note: http requests are not supported on debian jessie
due to an ssl issue*
#### Fedora
sudo yum install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool cmake re2c
sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c
#### AWS
@ -59,6 +74,10 @@ Although `automake`/`autoconf`/`libtool` are generally installed by
default, some have reported needing to uninstall and reinstall those
three packages, at least with Homebrew. Your mileage may vary.
#### FreeBSD
pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
Build
-----
@ -74,7 +93,9 @@ Just run `make`:
make
Run
(On FreeBSD, use `gmake` instead.)
Run <a id="run"/>
---
Inside of the `urbit` directory run
@ -102,9 +123,13 @@ Basics
`^v` will switch between the task manager and the focussed process. `^x`
will switch between processes.
To start a process that is not yet started run `*proc` from the task
To start a process that is not yet started, run `*proc` from the task
manager.
To connect your console to a process that has already been started, run
`+proc` from the task manager. Note that the process must be one that
supports console access, such as dojo and talk.
`^d` will exit the pier from the task manager. No matter how you shut
your urbit down you'll be returned to exactly the same state as when you
turned it off.
@ -140,6 +165,24 @@ clipped.
`;<target>` sets the target for your messages, such as `;~urbit-name`
for a private message.
Filesystem Sync
---------------
Our filesystem, `%clay` does not automatically sync to unix. If you want
to get files in and out of urbit, you'll need to setup a mount point.
Since each mount point is always watching for changes you may also want
to unmount from time to time.
The syntax is as follows (from `dojo`):
|mount <clay-path> <mount-name>
|unmount <mount-name>
or:
|unmount <clay-path>
Sysadmin
--------

2
debian/control vendored
View File

@ -2,7 +2,7 @@ Source: urbit
Section: unknown
Priority: extra
Maintainer: Urbit <urbit@urbit.org>
Build-Depends: debhelper (>= 8.0.0), libssl-dev, libncurses5-dev, libgmp-dev, libsigsegv-dev, ragel
Build-Depends: debhelper (>= 8.0.0), libssl-dev, libncurses5-dev, libgmp-dev, libsigsegv-dev, ragel, cmake, libtool, autoconf
Standards-Version: 3.9.3
Homepage: http://urbit.org/

32
i/all.h
View File

@ -1,32 +0,0 @@
/* include/all.h
**
** This file is in the public domain.
*/
/** c3: C environment.
**/
# include "c/portable.h" // C and OS portability
# include "c/types.h" // c3 types
# include "c/defs.h" // c3 macros
# include "c/motes.h" // c3 constants
/** u3: noun environment.
**/
# include "n/u.h" // general u3
# include "n/a.h" // u3a: allocation
# include "n/e.h" // u3e: persistence
# include "n/h.h" // u3h: hashtables
# include "n/i.h" // u3i: noun construction
# include "n/j.h" // u3j: jet control
# include "n/m.h" // u3m: master state
# include "n/n.h" // u3n: nock execution
# include "n/o.h" // u3o: config options
# include "n/r.h" // u3r: noun access (error returns)
# include "n/t.h" // u3t: profiling / tracing
# include "n/x.h" // u3x: noun access (error crashes)
# include "n/v.h" // u3v: arvo kernel
# include "n/z.h" // u3z: memoization
# include "j/k.h" // u3k: jets (transfer, args)
# include "j/q.h" // u3q: jets (retain, args)
# include "j/w.h" // u3w: jets (retain, core)

32
include/all.h Normal file
View File

@ -0,0 +1,32 @@
/* include/all.h
**
** This file is in the public domain.
*/
/** c3: C environment.
**/
# include "c/portable.h" // C and OS portability
# include "c/types.h" // c3 types
# include "c/defs.h" // c3 macros
# include "c/motes.h" // c3 constants
/** u3: noun environment.
**/
# include "noun/aliases.h" // general u3
# include "noun/allocate.h" // u3a: allocation
# include "noun/events.h" // u3e: persistence
# include "noun/hashtable.h" // u3h: hashtables
# include "noun/imprison.h" // u3i: noun construction
# include "noun/jets.h" // u3j: jet control
# include "noun/manage.h" // u3m: master state
# include "noun/nock.h" // u3n: nock execution
# include "noun/options.h" // u3o: config options
# include "noun/retrieve.h" // u3r: noun access (error returns)
# include "noun/trace.h" // u3t: profiling / tracing
# include "noun/xtract.h" // u3x: noun access (error crashes)
# include "noun/vortex.h" // u3v: arvo kernel
# include "noun/zave.h" // u3z: memoization
# include "jets/k.h" // u3k: jets (transfer, args)
# include "jets/q.h" // u3q: jets (retain, args)
# include "jets/w.h" // u3w: jets (retain, core)

View File

@ -99,6 +99,7 @@
# define c3__bong c3_s4('b','o','n','g')
# define c3__book c3_s4('b','o','o','k')
# define c3__bool c3_s4('b','o','o','l')
# define c3__boat c3_s4('b','o','a','t')
# define c3__boot c3_s4('b','o','o','t')
# define c3__born c3_s4('b','o','r','n')
# define c3__both c3_s4('b','o','t','h')
@ -173,6 +174,7 @@
# define c3__cbpm c3_s4('c','b','p','m')
# define c3__cbtr c3_s4('c','b','t','r')
# define c3__cdr c3_s3('c','d','r')
# define c3__ce c3_s2('c','e')
# define c3__cell c3_s4('c','e','l','l')
# define c3__chaf c3_s4('c','h','a','f')
# define c3__chan c3_s4('c','h','a','n')
@ -264,6 +266,7 @@
# define c3__ctl c3_s3('c','t','l')
# define c3__cut c3_s3('c','u','t')
# define c3__cyl c3_s3('c','y','l')
# define c3__d c3_s1('d')
# define c3__da c3_s2('d','a')
# define c3__dago c3_s4('d','a','g','o')
# define c3__dant c3_s4('d','a','n','t')
@ -350,6 +353,7 @@
# define c3__etch c3_s4('e','t','c','h')
# define c3__exit c3_s4('e','x','i','t')
# define c3__eyre c3_s4('e','y','r','e')
# define c3__f c3_s1('f')
# define c3__fab c3_s3('f','a','b')
# define c3__face c3_s4('f','a','c','e')
# define c3__fail c3_s4('f','a','i','l')
@ -377,6 +381,7 @@
# define c3__fist c3_s4('f','i','s','t')
# define c3__fit c3_s3('f','i','t')
# define c3__fix c3_s3('f','i','x')
# define c3__fl c3_s2('f','l')
# define c3__flac c3_s4('f','l','a','c')
# define c3__flag c3_s4('f','l','a','g')
# define c3__flat c3_s4('f','l','a','t')
@ -489,6 +494,7 @@
# define c3__hide c3_s4('h','i','d','e')
# define c3__high c3_s4('h','i','g','h')
# define c3__hike c3_s4('h','i','k','e')
# define c3__hill c3_s4('h','i','l','l')
# define c3__hind c3_s4('h','i','n','d')
# define c3__hint c3_s4('h','i','n','t')
# define c3__hit c3_s3('h','i','t')
@ -526,6 +532,7 @@
# define c3__hxts c3_s4('h','x','t','s')
# define c3__hxgl c3_s4('h','x','g','l')
# define c3__hxgr c3_s4('h','x','g','r')
# define c3__i c3_s1('i')
# define c3__ic c3_s2('i','c')
# define c3__ice c3_s3('i','c','e')
# define c3__if c3_s2('i','f')
@ -608,6 +615,7 @@
# define c3__lee c3_s3('l','e','e')
# define c3__leg c3_s3('l','e','g')
# define c3__lest c3_s4('l','e','s','t')
# define c3__lg c3_s2('l','g')
# define c3__lib c3_s3('l','i','b')
# define c3__libd c3_s4('l','i','b','d')
# define c3__life c3_s4('l','i','f','e')
@ -702,6 +710,8 @@
# define c3__mull c3_s4('m','u','l','l')
# define c3__mung c3_s4('m','u','n','g')
# define c3__mut c3_s3('m','u','t')
# define c3__n c3_s1('n')
# define c3__na c3_s2('n','a')
# define c3__nail c3_s4('n','a','i','l')
# define c3__name c3_s4('n','a','m','e')
# define c3__nap c3_s3('n','a','p')
@ -728,12 +738,14 @@
# define c3__not c3_s3('n','o','t')
# define c3__note c3_s4('n','o','t','e')
# define c3__noun c3_s4('n','o','u','n')
# define c3__nt c3_s2('n','t')
# define c3__nub c3_s3('n','u','b')
# define c3__null c3_s4('n','u','l','l')
# define c3__nz c3_s2('n','z')
# define c3__oak c3_s3('o','a','k')
# define c3__of c3_s2('o','f')
# define c3__off c3_s3('o','f','f')
# define c3__ogre c3_s4('o','g','r','e')
# define c3__old c3_s3('o','l','d')
# define c3__on c3_s2('o','n')
# define c3__onan c3_s4('o','n','a','n')
@ -962,6 +974,7 @@
# define c3__slow c3_s4('s','l','o','w')
# define c3__slur c3_s4('s','l','u','r')
# define c3__slux c3_s4('s','l','u','x')
# define c3__sm c3_s2('s','m')
# define c3__smcl c3_s4('s','m','c','l')
# define c3__smdq c3_s4('s','m','d','q')
# define c3__smsg c3_s4('s','m','s','g')
@ -1016,7 +1029,6 @@
# define c3__teal c3_s4('t','e','a','l')
# define c3__teck c3_s4('t','e','c','k')
# define c3__tell c3_s4('t','e','l','l')
# define c3__temp c3_s4('t','e','m','p')
# define c3__terg c3_s4('t','e','r','g')
# define c3__term c3_s4('t','e','r','m')
# define c3__test c3_s4('t','e','s','t')
@ -1098,6 +1110,7 @@
# define c3__twix c3_s4('t','w','i','x')
# define c3__txt c3_s3('t','x','t')
# define c3__type c3_s4('t','y','p','e')
# define c3__u c3_s1('u')
# define c3__ubin c3_s4('u','b','i','n')
# define c3__ubit c3_s4('u','b','i','t')
# define c3__ud c3_s2('u','d')
@ -1172,6 +1185,7 @@
# define c3__wyrd c3_s4('w','y','r','d')
# define c3__yew c3_s3('y','a','w')
# define c3__yell c3_s4('y','e','l','l')
# define c3__z c3_s1('z')
# define c3__yelp c3_s4('y','e','l','p')
# define c3__zact c3_s4('z','a','c','t')
# define c3__zalt c3_s4('z','a','l','t')

View File

@ -146,10 +146,12 @@
/* Sync
*/
# if defined(U3_OS_linux) || defined(U3_OS_bsd)
# if defined(U3_OS_linux)
# define c3_sync(fd) (fdatasync(fd))
# elif defined(U3_OS_osx)
# define c3_sync(fd) (fcntl(fd, F_FULLFSYNC, 0))
# elif defined(U3_OS_bsd)
# define c3_sync(fd) (fsync(fd))
# else
# error "port: sync"
# endif

View File

@ -40,6 +40,7 @@
/** Tier 3.
**/
u3_noun u3qc_bex(u3_atom);
u3_noun u3qc_xeb(u3_atom);
u3_noun u3qc_can(u3_atom, u3_noun);
u3_noun u3qc_cap(u3_atom);
u3_noun u3qc_cat(u3_atom, u3_atom, u3_atom);
@ -47,6 +48,7 @@
u3_noun u3qc_cut(u3_atom, u3_atom, u3_atom, u3_atom);
u3_noun u3qc_dis(u3_atom, u3_atom);
u3_noun u3qc_dor(u3_atom, u3_atom);
u3_noun u3qc_dvr(u3_atom, u3_atom);
u3_noun u3qc_end(u3_atom, u3_atom, u3_atom);
u3_noun u3qc_gor(u3_atom, u3_atom);
u3_noun u3qc_hor(u3_atom, u3_atom);
@ -55,13 +57,17 @@
u3_noun u3qc_met(u3_atom, u3_atom);
u3_noun u3qc_mix(u3_atom, u3_atom);
u3_noun u3qc_peg(u3_atom, u3_atom);
u3_noun u3qc_pow(u3_atom, u3_atom);
u3_noun u3qc_rap(u3_atom, u3_noun);
u3_noun u3qc_rip(u3_atom, u3_atom);
u3_noun u3qc_rsh(u3_atom, u3_atom, u3_atom);
u3_noun u3qc_sqt(u3_atom);
u3_noun u3qc_vor(u3_atom, u3_atom);
/** Tier 4.
**/
u3_noun u3qdb_bif(u3_noun, u3_noun);
u3_noun u3qdb_dif(u3_noun, u3_noun);
u3_noun u3qdb_gas(u3_noun, u3_noun);
u3_noun u3qdb_get(u3_noun, u3_noun);
u3_noun u3qdb_has(u3_noun, u3_noun);
@ -70,6 +76,8 @@
# define u3qdb_tap u3qdi_tap
u3_noun u3qdb_uni(u3_noun, u3_noun);
u3_noun u3qdi_bif(u3_noun, u3_noun);
u3_noun u3qdi_dif(u3_noun, u3_noun);
u3_noun u3qdi_gas(u3_noun, u3_noun);
u3_noun u3qdi_has(u3_noun, u3_noun);
u3_noun u3qdi_int(u3_noun, u3_noun);
@ -106,16 +114,44 @@
u3_noun u3qeo_raw(u3_atom, u3_atom);
u3_noun u3qer_sun(u3_atom);
u3_noun u3qer_mul(u3_atom, u3_atom);
u3_noun u3qer_div(u3_atom, u3_atom);
u3_noun u3qer_add(u3_atom, u3_atom);
u3_noun u3qer_sub(u3_atom, u3_atom);
u3_noun u3qer_lte(u3_atom, u3_atom);
u3_noun u3qef_drg(u3_noun, u3_atom);
u3_noun u3qef_lug(u3_noun, u3_noun, u3_atom, u3_atom);
u3_noun u3qer_add(u3_atom, u3_atom, u3_atom);
u3_noun u3qer_sub(u3_atom, u3_atom, u3_atom);
u3_noun u3qer_mul(u3_atom, u3_atom, u3_atom);
u3_noun u3qer_div(u3_atom, u3_atom, u3_atom);
u3_noun u3qer_sqt(u3_atom, u3_atom);
u3_noun u3qer_fma(u3_atom, u3_atom, u3_atom, u3_atom);
u3_noun u3qer_lth(u3_atom, u3_atom);
u3_noun u3qer_lte(u3_atom, u3_atom);
u3_noun u3qer_equ(u3_atom, u3_atom);
u3_noun u3qer_gte(u3_atom, u3_atom);
u3_noun u3qer_gth(u3_atom, u3_atom);
u3_noun u3qet_add(u3_atom, u3_atom, u3_atom);
u3_noun u3qet_sub(u3_atom, u3_atom, u3_atom);
u3_noun u3qet_mul(u3_atom, u3_atom, u3_atom);
u3_noun u3qet_div(u3_atom, u3_atom, u3_atom);
u3_noun u3qet_sqt(u3_atom, u3_atom);
u3_noun u3qet_fma(u3_atom, u3_atom, u3_atom, u3_atom);
u3_noun u3qet_lth(u3_atom, u3_atom);
u3_noun u3qet_lte(u3_atom, u3_atom);
u3_noun u3qet_equ(u3_atom, u3_atom);
u3_noun u3qet_gte(u3_atom, u3_atom);
u3_noun u3qet_gth(u3_atom, u3_atom);
u3_noun u3qeq_add(u3_atom, u3_atom, u3_atom);
u3_noun u3qeq_sub(u3_atom, u3_atom, u3_atom);
u3_noun u3qeq_mul(u3_atom, u3_atom, u3_atom);
u3_noun u3qeq_div(u3_atom, u3_atom, u3_atom);
u3_noun u3qeq_sqt(u3_atom, u3_atom);
u3_noun u3qeq_fma(u3_atom, u3_atom, u3_atom, u3_atom);
u3_noun u3qeq_lth(u3_atom, u3_atom);
u3_noun u3qeq_lte(u3_atom, u3_atom);
u3_noun u3qeq_equ(u3_atom, u3_atom);
u3_noun u3qeq_gte(u3_atom, u3_atom);
u3_noun u3qeq_gth(u3_atom, u3_atom);
/** Tier 6.
**/

View File

@ -39,6 +39,7 @@
/** Tier 3.
**/
u3_noun u3wc_bex(u3_noun);
u3_noun u3wc_xeb(u3_noun);
u3_noun u3wc_can(u3_noun);
u3_noun u3wc_cap(u3_noun);
u3_noun u3wc_cat(u3_noun);
@ -46,6 +47,7 @@
u3_noun u3wc_cut(u3_noun);
u3_noun u3wc_dis(u3_noun);
u3_noun u3wc_dor(u3_noun);
u3_noun u3wc_dvr(u3_noun);
u3_noun u3wc_end(u3_noun);
u3_noun u3wc_gor(u3_noun);
u3_noun u3wc_hor(u3_noun);
@ -55,9 +57,11 @@
u3_noun u3wc_mix(u3_noun);
u3_noun u3wc_mug(u3_noun);
u3_noun u3wc_peg(u3_noun);
u3_noun u3wc_pow(u3_noun);
u3_noun u3wc_rap(u3_noun);
u3_noun u3wc_rip(u3_noun);
u3_noun u3wc_rsh(u3_noun);
u3_noun u3wc_sqt(u3_noun);
u3_noun u3wc_vor(u3_noun);
u3_noun u3wcp_ins(u3_noun);
@ -67,6 +71,8 @@
/** Tier 4.
**/
u3_noun u3wdb_bif(u3_noun);
u3_noun u3wdb_dif(u3_noun);
u3_noun u3wdb_gas(u3_noun);
u3_noun u3wdb_get(u3_noun);
u3_noun u3wdb_has(u3_noun);
@ -75,6 +81,8 @@
# define u3wdb_tap u3wdi_tap
u3_noun u3wdb_uni(u3_noun);
u3_noun u3wdi_bif(u3_noun);
u3_noun u3wdi_dif(u3_noun);
u3_noun u3wdi_gas(u3_noun);
u3_noun u3wdi_has(u3_noun);
u3_noun u3wdi_int(u3_noun);
@ -135,16 +143,44 @@
u3_noun u3we_stew_fun(u3_noun);
u3_noun u3we_stir_fun(u3_noun);
u3_noun u3wer_sun(u3_noun);
u3_noun u3wer_mul(u3_noun);
u3_noun u3wer_div(u3_noun);
u3_noun u3wef_drg(u3_noun);
u3_noun u3wef_lug(u3_noun);
u3_noun u3wer_add(u3_noun);
u3_noun u3wer_sub(u3_noun);
u3_noun u3wer_lte(u3_noun);
u3_noun u3wer_mul(u3_noun);
u3_noun u3wer_div(u3_noun);
u3_noun u3wer_sqt(u3_noun);
u3_noun u3wer_fma(u3_noun);
u3_noun u3wer_lth(u3_noun);
u3_noun u3wer_lte(u3_noun);
u3_noun u3wer_equ(u3_noun);
u3_noun u3wer_gte(u3_noun);
u3_noun u3wer_gth(u3_noun);
u3_noun u3wet_add(u3_noun);
u3_noun u3wet_sub(u3_noun);
u3_noun u3wet_mul(u3_noun);
u3_noun u3wet_div(u3_noun);
u3_noun u3wet_sqt(u3_noun);
u3_noun u3wet_fma(u3_noun);
u3_noun u3wet_lth(u3_noun);
u3_noun u3wet_lte(u3_noun);
u3_noun u3wet_equ(u3_noun);
u3_noun u3wet_gte(u3_noun);
u3_noun u3wet_gth(u3_noun);
u3_noun u3weq_add(u3_noun);
u3_noun u3weq_sub(u3_noun);
u3_noun u3weq_mul(u3_noun);
u3_noun u3weq_div(u3_noun);
u3_noun u3weq_sqt(u3_noun);
u3_noun u3weq_fma(u3_noun);
u3_noun u3weq_lth(u3_noun);
u3_noun u3weq_lte(u3_noun);
u3_noun u3weq_equ(u3_noun);
u3_noun u3weq_gte(u3_noun);
u3_noun u3weq_gth(u3_noun);
/** Tier 6.
**/

View File

@ -8,12 +8,15 @@
*/
# undef U3_MEMORY_DEBUG
/* U3_CELLOC_TOGGLE: enable toggling of the custum cell allocator
/* U3_CELLOC_TOGGLE: enable toggling of the custom cell allocator
* via -g. This slightly slows down the cell allocator even when
* it's on. Note that toggling -g breaks (maybe?) the image. If
* U3_MEMORY_DEBUG is on, this should generally be on as well.
*/
# undef U3_CELLOC_TOGGLE
/* U3_PRINT_WATERMARK: print watermark information for each road
*/
# undef U3_PRINT_WATERMARK
/** Constants.
**/
@ -131,6 +134,9 @@
u3p(u3a_fbox) fre_p[u3a_fbox_no]; // heap by node size log
u3p(u3a_fbox) cel_p; // custom cell allocator
c3_w fre_w; // number of free words
#ifdef U3_MEMORY_DEBUG
c3_w max_w; // maximum allocated
#endif
} all;
struct { // jet dashboard

View File

@ -54,6 +54,14 @@
u3r_mug_words(const c3_w *buf_w,
c3_w len_w);
/* u3r_mug_bytes():
**
** Compute the mug of `buf`, `len`, LSW first.
*/
c3_w
u3r_mug_bytes(const c3_y *buf_w,
c3_w len_w);
/* u3r_mug_cell():
**
** Compute the mug of `[a b]`.

View File

@ -293,56 +293,53 @@
c3_d len_d; // length in words
} u3_ulog;
struct _u3_uhot;
struct _u3_umon;
struct _u3_udir;
struct _u3_ufil;
/* u3_unod: in-file or in-directory.
/* u3_unod: file or directory.
*/
typedef struct _u3_unod {
uv_fs_event_t was_u; // stat watcher
c3_o dir; // always
c3_o dry; // ie, unmodified
c3_c* pax_c; // in absolute path
c3_c* pot_c; // out absolute path
struct _u3_udir* par_u; // directory
uv_fs_event_t was_u; // stat watcher
c3_o dir; // c3y if dir, c3n if file
c3_o dry; // ie, unmodified
c3_c* pax_c; // absolute path
struct _u3_udir* par_u; // parent
struct _u3_unod* nex_u; // internal list
} u3_unod;
/* u3_ufil: synchronized in-file.
/* u3_ufil: synchronized file.
*/
typedef struct _u3_ufil {
uv_fs_event_t was_u; // stat watcher
c3_o non; // always u3_no
c3_o dry; // ie, unmodified
c3_c* pax_c; // in absolute path
c3_c* pot_c; // out absolute path
struct _u3_udir* par_u; // directory
c3_c* dot_c; // extension point or 0
c3_w mod_w[4]; // mtime
struct _u3_ufil* nex_u; // internal list
uv_fs_event_t was_u; // stat watcher
c3_o dir; // c3y if dir, c3n if file
c3_o dry; // ie, unmodified
c3_c* pax_c; // absolute path
struct _u3_udir* par_u; // parent
struct _u3_unod* nex_u; // internal list
c3_w mug_w; // mug of last %into
c3_w gum_w; // mug of last %ergo
} u3_ufil;
/* u3_udir: synchronized in-directory.
/* u3_ufil: synchronized directory.
*/
typedef struct _u3_udir {
uv_fs_event_t was_u; // stat watcher
c3_o yes; // always u3_yes
c3_o dry; // ie, unmodified
c3_c* pax_c; // in absolute path
c3_c* pot_c; // out absolute path
struct _u3_udir* par_u; // parent directory
struct _u3_udir* dis_u; // subdirectories
struct _u3_ufil* fil_u; // files
struct _u3_udir* nex_u; // internal list
uv_fs_event_t was_u; // stat watcher
c3_o dir; // c3y if dir, c3n if file
c3_o dry; // ie, unmodified
c3_c* pax_c; // absolute path
struct _u3_udir* par_u; // parent
struct _u3_unod* nex_u; // internal list
u3_unod* kid_u; // subnodes
} u3_udir;
/* u3_uhot: synchronized host.
/* u3_ufil: synchronized mount point.
*/
typedef struct _u3_uhot {
u3_udir dir_u; // in directory
c3_w who_w[4]; // owner as words
struct _u3_uhot* nex_u; // internal list
} u3_uhot;
typedef struct _u3_umon {
u3_udir dir_u; // root directory, must be first
c3_c* nam_c; // mount point name
struct _u3_umon* nex_u; // internal list
} u3_umon;
/* u3_usig: receive signals.
*/
@ -355,9 +352,12 @@
/* u3_unix: clay support system, also
*/
typedef struct _u3_unix {
uv_check_t syn_u; // fs sync check
u3_uhot* hot_u; // host state
u3_usig* sig_u; // signal list
uv_check_t syn_u; // fs sync check
uv_timer_t tim_u; // timer
u3_umon* mon_u; // mount points
u3_usig* sig_u; // signal list
c3_o alm; // timer set
c3_o dyr; // ready to update
#ifdef SYNCLOG
c3_w lot_w; // sync-slot
struct _u3_sylo {
@ -369,13 +369,13 @@
#endif
} u3_unix;
/* u3_temp: just a timer for ever
/* u3_behn: just a timer for ever
*/
typedef struct _u3_temp {
uv_timer_t tim_u; // temp timer
typedef struct _u3_behn {
uv_timer_t tim_u; // behn timer
c3_w run_w; // run of consecutive alarms
c3_o alm; // alarm
} u3_temp;
} u3_behn;
/* u2_utfo: unix terminfo strings.
*/
@ -547,7 +547,7 @@
*/
typedef struct _u3_host {
c3_w kno_w; // current executing stage
c3_c* dir_c; // pier path
c3_c* dir_c; // pier path (no trailing /)
c3_d now_d; // event tick
uv_loop_t* lup_u; // libuv event loop
u3_http* htp_u; // http servers
@ -558,7 +558,7 @@
u3_save sav_u; // autosave
u3_opts ops_u; // commandline options
u3_unix unx_u; // sync and clay
u3_temp teh_u; // temp timer
u3_behn teh_u; // behn timer
c3_o liv; // if u3_no, shut down
c3_i xit_i; // exit code for shutdown
void* ssl_u; // struct SSL_CTX*
@ -930,23 +930,30 @@
void
u3_unix_ef_move();
/* u3_unix_ef_look(): update filesystem, inbound.
/* u3_unix_initial_into(): intialize filesystem from urb/zod
*/
void
u3_unix_ef_look(void);
u3_unix_ef_initial_into();
/* u3_unix_ef_init(): update filesystem for new acquisition.
/* u3_unix_ef_look(): update filesystem from unix
*/
void
u3_unix_ef_init(u3_noun who);
u3_unix_ef_look(u3_noun all);
/* u3_unix_ef_ergo(): update filesystem, outbound.
/* u3_unix_ef_ergo(): update filesystem from urbit
*/
void
u3_unix_ef_ergo(u3_noun who,
u3_noun syd,
u3_noun rel,
u3_noun can);
u3_unix_ef_ergo(u3_noun mon, u3_noun can);
/* u3_unix_ef_ogre(): delete mount point
*/
void
u3_unix_ef_ogre(u3_noun mon);
/* u3_unix_ef_ogre(): delete mount point
*/
void
u3_unix_ef_hill(u3_noun hil);
/* u3_unix_io_init(): initialize storage.
*/
@ -969,22 +976,22 @@
u3_unix_io_poll(void);
/** Temp, just a timer.
/** behn, just a timer.
**/
/* u2_temp_io_init(): initialize temp timer.
/* u2_behn_io_init(): initialize behn timer.
*/
void
u2_temp_io_init(void);
u2_behn_io_init(void);
/* u2_temp_io_exit(): terminate timer.
/* u2_behn_io_exit(): terminate timer.
*/
void
u2_temp_io_exit(void);
u2_behn_io_exit(void);
/* u2_temp_io_poll(): update temp IO state.
/* u2_behn_io_poll(): update behn IO state.
*/
void
u2_temp_io_poll(void);
u2_behn_io_poll(void);
/** HTTP server.
@ -1118,20 +1125,20 @@
/** New timer system.
**/
/* u3_temp_io_init(): initialize time timer.
/* u3_behn_io_init(): initialize time timer.
*/
void
u3_temp_io_init(void);
u3_behn_io_init(void);
/* u3_temp_io_exit(): terminate timer.
/* u3_behn_io_exit(): terminate timer.
*/
void
u3_temp_io_exit(void);
u3_behn_io_exit(void);
/* u3_temp_io_poll(): update temp IO state.
/* u3_behn_io_poll(): update behn IO state.
*/
void
u3_temp_io_poll(void);
u3_behn_io_poll(void);
/** HTTP client.

View File

@ -1,129 +0,0 @@
/* j/4/by_uni.c
** XXX THIS IS DISABLED
** specifically, s/hor/gor/g (already done?)
** and eliminate memory leaks
*/
#include "all.h"
/* functions
*/
u3_noun
u3qdb_uni(
u3_noun a,
u3_noun b)
{
if ( u3_nul == a ) {
return u3k(b);
}
else if ( u3_nul == b ) {
return u3k(a);
}
else {
u3_noun l_a, n_a, r_a, lr_a, p_n_a, q_n_a;
u3_noun l_b, n_b, r_b, lr_b, p_n_b, q_n_b;
if ( (c3n == u3r_cell(a, &n_a, &lr_a)) ) {
return u3m_bail(c3__exit);
}
else if ( (c3n == u3r_cell(b, &n_b, &lr_b)) ) {
return u3m_bail(c3__exit);
}
else if ( (c3n == u3r_cell(n_a, &p_n_a, &q_n_a)) ) {
return u3m_bail(c3__exit);
}
else if ( (c3n == u3r_cell(n_b, &p_n_b, &q_n_b)) ) {
return u3m_bail(c3__exit);
}
else if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) {
return u3m_bail(c3__exit);
}
else if ( c3n == u3r_cell(lr_b, &l_b, &r_b) ) {
return u3m_bail(c3__exit);
}
else if ( c3y == u3qc_vor(p_n_a, p_n_b) ) {
if ( c3y == u3r_sing(p_n_a, p_n_b) ) {
return u3nt(u3k(n_b),
u3qdb_uni(
u3k(l_a), u3k(l_b)),
u3qdb_uni(
u3k(r_a), u3k(r_b)));
}
else if ( c3y == u3qc_gor(p_n_b, p_n_a) ) {
return u3qdb_uni(
u3nt(
u3k(n_a),
u3qdb_uni(
u3k(l_a),
u3nt(
u3k(n_b),
u3k(l_b),
u3k(u3_nul))),
u3k(r_a)),
u3k(r_b));
}
else {
return u3qdb_uni(
u3nt(
u3k(n_a),
u3k(l_a),
u3qdb_uni(
u3k(r_a),
u3nt(
u3k(n_b),
u3k(u3_nul),
u3k(r_b)))),
u3k(l_b));
}
}
else if ( c3y == u3r_sing(p_n_b, p_n_a) ) {
return u3nt(
u3k(n_b),
u3qdb_uni(u3k(r_b), u3k(r_a)),
u3qdb_uni(u3k(l_b), u3k(l_a)));
}
else if ( c3y == u3qc_gor(p_n_a, p_n_b) ) {
return u3qdb_uni(
u3k(r_a),
u3nt(
u3k(n_b),
u3qdb_uni(
u3nt(
u3k(n_a),
u3k(l_a),
u3k(u3_nul)),
u3k(l_b)),
u3k(r_b)));
}
else {
return u3qdb_uni(
u3k(l_a),
u3nt(
u3k(n_b),
u3k(l_b),
u3qdb_uni(
u3k(r_b),
u3nt(
u3k(n_a),
u3k(u3_nul),
u3k(r_a)))));
}
}
}
u3_noun
u3wdb_uni(
u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) {
return u3m_bail(c3__exit);
} else {
return u3qdb_uni(a, b);
}
}

View File

@ -1,86 +0,0 @@
/* j/4/in_int.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qdi_int(
u3_noun a,
u3_noun b)
{
if ( u3_nul == a ) {
return u3k(u3_nul);
}
else if ( u3_nul == b ) {
return u3k(u3_nul);
}
else {
u3_noun l_a, n_a, r_a, lr_a;
u3_noun l_b, n_b, r_b, lr_b;
u3_noun c;
if ( (c3n == u3r_cell(a, &n_a, &lr_a)) ) {
return u3m_bail(c3__exit);
}
else if ( (c3n == u3r_cell(b, &n_b, &lr_b)) ) {
return u3m_bail(c3__exit);
}
else {
if ( c3y == u3qc_vor(n_b, n_a) ) {
c = a; a = b; b = c;
c = n_a; n_a = n_b; n_b = c;
c = lr_a; lr_a = lr_b; lr_b = c;
}
if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) {
return u3m_bail(c3__exit);
}
else if ( c3n == u3r_cell(lr_b, &l_b, &r_b) ) {
return u3m_bail(c3__exit);
}
else if ( c3y == u3r_sing(n_a, n_b) ) {
return u3nt(u3k(n_a),
u3qdi_int(l_a, l_b),
u3qdi_int(r_a, r_b));
}
else if ( c3y == u3qc_hor(n_b, n_a) ) {
return u3qdi_uni(
u3qdi_int(
l_a,
u3nt(
n_b,
l_b,
u3_nul)),
u3qdi_int(
a,
r_b));
}
else {
return u3qdi_uni(
u3qdi_int(
r_a,
u3nt(
n_b,
u3_nul,
r_b)),
u3qdi_int(
a,
l_b));
}
}
}
}
u3_noun
u3wdi_int(
u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) {
return u3m_bail(c3__exit);
} else {
return u3qdi_int(a, b);
}
}

View File

@ -1,130 +0,0 @@
/* j/4/in_uni.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qdi_uni(
u3_noun a,
u3_noun b)
{
if ( u3_nul == a ) {
return u3k(b);
}
else if ( u3_nul == b ) {
return u3k(a);
}
else {
u3_noun l_a, n_a, r_a, lr_a;
u3_noun l_b, n_b, r_b, lr_b;
if ( (c3n == u3r_cell(a, &n_a, &lr_a)) ) {
return u3m_bail(c3__exit);
}
else if ( (c3n == u3r_cell(b, &n_b, &lr_b)) ) {
return u3m_bail(c3__exit);
}
else {
if ( c3y == u3qc_vor(n_a, n_b) ) {
if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) {
return u3m_bail(c3__exit);
}
else if ( c3n == u3r_cell(lr_b, &l_b, &r_b) ) {
return u3m_bail(c3__exit);
}
else if ( c3y == u3r_sing(n_a, n_b) ) {
return u3nt(
u3k(n_b),
u3qdi_uni(u3k(l_a), u3k(l_b)),
u3qdi_uni(u3k(r_a), u3k(r_b)));
}
else if ( c3y == u3qc_hor(n_b, n_a) ) {
return u3qdi_uni(
u3nt(
u3k(n_a),
u3qdi_uni(
u3k(l_a),
u3nt(
u3k(n_b),
u3k(l_b),
u3k(u3_nul))),
u3k(r_a)),
u3k(r_b));
}
else {
return u3qdi_uni(
u3nt(
u3k(n_a),
u3k(l_a),
u3qdi_uni(
u3k(r_a),
u3nt(
u3k(n_b),
u3k(u3_nul),
u3k(r_b)))),
u3k(l_b));
}
}
else if ( c3n == u3r_cell(lr_b, &l_b, &r_b) ) {
return u3m_bail(c3__exit);
}
else if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) {
return u3m_bail(c3__exit);
}
else if ( c3y == u3r_sing(n_b, n_a) ) {
return u3nt(
u3k(n_b),
u3qdi_uni(u3k(r_b), u3k(r_a)),
u3qdi_uni(u3k(l_b), u3k(l_a)));
}
else if ( c3y == u3qc_hor(n_a, n_b) ) {
return u3qdi_uni(
u3k(r_a),
u3nt(
u3k(n_b),
u3qdi_uni(
u3nt(
u3k(n_a),
u3k(l_a),
u3_nul),
u3k(l_b)),
u3k(r_b)));
}
else {
return u3qdi_uni(
u3k(l_a),
u3nt(
u3k(n_b),
u3k(l_b),
u3qdi_uni(
u3nt(
u3k(n_a),
u3k(u3_nul),
u3k(r_a)),
u3k(r_b))));
}
}
}
}
u3_noun
u3wdi_uni(
u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) {
return u3m_bail(c3__exit);
} else {
return u3qdi_uni(a, b);
}
}

266
j/e/rd.c
View File

@ -1,266 +0,0 @@
/* j/5/aes.c
**
*/
#include "all.h"
union doub {
double d;
c3_d c;
};
/* functions
*/
/* sun
*/
u3_noun
u3qer_sun(u3_atom a)
{
union doub b;
b.d = (double) u3r_chub(0, a);
return u3i_chubs(1, &b.c);
}
u3_noun
u3wer_sun(u3_noun cor)
{
u3_noun a;
if (c3n == u3r_mean(cor, u3x_sam, &a, 0)
|| c3n == u3ud(a)) {
return u3m_bail(c3__exit);
}
else {
return u3qer_sun(a);
}
}
/* mul
*/
u3_noun
u3qer_mul(u3_atom a, u3_atom b)
{
union doub c, d, e;
c.c = u3r_chub(0, a);
d.c = u3r_chub(0, b);
e.d = c.d * d.d;
return u3i_chubs(1, &e.c);
}
u3_noun
u3wer_mul(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ||
c3n == u3ud(a) ||
c3n == u3ud(b) )
{
return u3m_bail(c3__exit);
}
else {
return u3qer_mul(a, b);
}
}
/* div
*/
u3_noun
u3qer_div(u3_atom a, u3_atom b)
{
union doub c, d, e;
c.c = u3r_chub(0, a);
d.c = u3r_chub(0, b);
e.d = c.d / d.d;
return u3i_chubs(1, &e.c);
}
u3_noun
u3wer_div(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ||
c3n == u3ud(a) ||
c3n == u3ud(b) )
{
return u3m_bail(c3__exit);
}
else {
return u3qer_div(a, b);
}
}
/* add
*/
u3_noun
u3qer_add(u3_atom a, u3_atom b)
{
union doub c, d, e;
c.c = u3r_chub(0, a);
d.c = u3r_chub(0, b);
e.d = c.d + d.d;
return u3i_chubs(1, &e.c);
}
u3_noun
u3wer_add(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ||
c3n == u3ud(a) ||
c3n == u3ud(b) )
{
return u3m_bail(c3__exit);
}
else {
return u3qer_add(a, b);
}
}
/* sub
*/
u3_noun
u3qer_sub(u3_atom a, u3_atom b)
{
union doub c, d, e;
c.c = u3r_chub(0, a);
d.c = u3r_chub(0, b);
e.d = c.d - d.d;
return u3i_chubs(1, &e.c);
}
u3_noun
u3wer_sub(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ||
c3n == u3ud(a) ||
c3n == u3ud(b) )
{
return u3m_bail(c3__exit);
}
else {
return u3qer_sub(a, b);
}
}
/* lte
*/
u3_noun
u3qer_lte(u3_atom a, u3_atom b)
{
union doub c, d;
c.c = u3r_chub(0, a);
d.c = u3r_chub(0, b);
return __(c.d <= d.d);
}
u3_noun
u3wer_lte(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ||
c3n == u3ud(a) ||
c3n == u3ud(b) )
{
return u3m_bail(c3__exit);
}
else {
return u3qer_lte(a, b);
}
}
/* lth
*/
u3_noun
u3qer_lth(u3_atom a, u3_atom b)
{
union doub c, d;
c.c = u3r_chub(0, a);
d.c = u3r_chub(0, b);
return __(c.d < d.d);
}
u3_noun
u3wer_lth(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ||
c3n == u3ud(a) ||
c3n == u3ud(b) )
{
return u3m_bail(c3__exit);
}
else {
return u3qer_lth(a, b);
}
}
/* gte
*/
u3_noun
u3qer_gte(u3_atom a, u3_atom b)
{
union doub c, d;
c.c = u3r_chub(0, a);
d.c = u3r_chub(0, b);
return __(c.d >= d.d);
}
u3_noun
u3wer_gte(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ||
c3n == u3ud(a) ||
c3n == u3ud(b) )
{
return u3m_bail(c3__exit);
}
else {
return u3qer_gte(a, b);
}
}
/* gth
*/
u3_noun
u3qer_gth(u3_atom a, u3_atom b)
{
union doub c, d;
c.c = u3r_chub(0, a);
d.c = u3r_chub(0, b);
return __(c.d > d.d);
}
u3_noun
u3wer_gth(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ||
c3n == u3ud(a) ||
c3n == u3ud(b) )
{
return u3m_bail(c3__exit);
}
else {
return u3qer_gth(a, b);
}
}

View File

@ -1,36 +0,0 @@
/* j/6/fine.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qf_fine(
u3_noun fuv,
u3_noun lup,
u3_noun mar)
{
if ( (c3__void == lup) || (c3__void == mar) ) {
return c3__void;
} else {
return u3nq(c3__fine, u3k(fuv),
u3k(lup),
u3k(mar));
}
}
u3_noun
u3wf_fine(
u3_noun cor)
{
u3_noun fuv, lup, mar;
if ( c3n == u3r_mean(cor, u3x_sam_2, &fuv,
u3x_sam_6, &lup,
u3x_sam_7, &mar, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qf_fine(fuv, lup, mar);
}
}

View File

@ -1,18 +0,0 @@
/* j/6/tack.c
**
*/
#include "all.h"
u3_noun
u3qfu_tack(u3_noun van,
u3_noun sut,
u3_noun peh,
u3_noun mur)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "tack");
return u3n_kick_on
(u3i_molt(gat, u3x_sam_2, u3k(peh), u3x_sam_3, u3k(mur), 0));
}

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qa_add(u3_atom a,
u3_atom b)
u3_atom b)
{
if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
c3_w c = a + b;
@ -43,7 +43,8 @@
}
u3_noun
u3ka_add(u3_noun a, u3_noun b)
u3ka_add(u3_noun a,
u3_noun b)
{
u3_noun c = u3qa_add(a, b);

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qa_div(u3_atom a,
u3_atom b)
u3_atom b)
{
if ( 0 == b ) {
return u3m_bail(c3__exit);

View File

@ -7,7 +7,8 @@
/* functions
*/
u3_noun
u3qa_gte(u3_atom a, u3_atom b)
u3qa_gte(u3_atom a,
u3_atom b)
{
if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
return __(a >= b);
@ -28,8 +29,7 @@
}
}
u3_noun
u3wa_gte(
u3_noun cor)
u3wa_gte(u3_noun cor)
{
u3_noun a, b;

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qa_gth(u3_atom a,
u3_atom b)
u3_atom b)
{
if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
return __(a > b);
@ -44,7 +44,8 @@
}
u3_noun
u3ka_gth(u3_noun a, u3_noun b)
u3ka_gth(u3_noun a,
u3_noun b)
{
u3_noun c = u3qa_gth(a, b);

View File

@ -7,7 +7,8 @@
/* functions
*/
u3_noun
u3qa_lte(u3_atom a, u3_atom b)
u3qa_lte(u3_atom a,
u3_atom b)
{
if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
return __(a <= b);
@ -42,7 +43,8 @@
}
}
u3_noun
u3ka_lte(u3_noun a, u3_noun b)
u3ka_lte(u3_noun a,
u3_noun b)
{
u3_noun c = u3qa_lte(a, b);

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qa_lth(u3_atom a,
u3_atom b)
u3_atom b)
{
if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
return __(a < b);

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qa_mod(
u3_atom a,
u3_atom b)
u3qa_mod(u3_atom a,
u3_atom b)
{
#if 0
if ( b == 3 && a == 2684227708 ) {

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qa_mul(u3_atom a,
u3_atom b)
u3_atom b)
{
if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
c3_d c = ((c3_d) a) * ((c3_d) b);
@ -42,7 +42,8 @@
}
}
u3_noun
u3ka_mul(u3_noun a, u3_noun b)
u3ka_mul(u3_noun a,
u3_noun b)
{
u3_noun c = u3qa_mul(a, b);

View File

@ -7,7 +7,8 @@
/* functions
*/
u3_noun
u3qa_sub(u3_atom a, u3_atom b)
u3qa_sub(u3_atom a,
u3_atom b)
{
if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
if ( a < b ) {
@ -50,7 +51,8 @@
}
u3_noun
u3ka_sub(u3_noun a, u3_noun b)
u3ka_sub(u3_noun a,
u3_noun b)
{
u3_noun c = u3qa_sub(a, b);

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qb_bind(
u3_noun a,
u3_noun b)
u3qb_bind(u3_noun a,
u3_noun b)
{
if ( 0 == a ) {
return 0;
@ -18,8 +17,7 @@
}
}
u3_noun
u3wb_bind(
u3_noun cor)
u3wb_bind(u3_noun cor)
{
u3_noun a, b;

View File

@ -8,8 +8,8 @@
*/
u3_noun
u3qb_clap(u3_noun a,
u3_noun b,
u3_noun c)
u3_noun b,
u3_noun c)
{
if ( 0 == a ) {
return u3k(b);
@ -27,8 +27,8 @@
u3_noun a, b, c;
if ( c3n == u3r_mean(cor, u3x_sam_2, &a,
u3x_sam_6, &b,
u3x_sam_7, &c, 0) ) {
u3x_sam_6, &b,
u3x_sam_7, &c, 0) ) {
return u3m_bail(c3__exit);
} else {
return u3qb_clap(a, b, c);

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qb_levy(
u3_noun a,
u3_noun b)
u3qb_levy(u3_noun a,
u3_noun b)
{
if ( 0 == a ) {
return c3y;
@ -28,8 +27,7 @@
}
}
u3_noun
u3wb_levy(
u3_noun cor)
u3wb_levy(u3_noun cor)
{
u3_noun a, b;

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qb_lien(u3_noun a,
u3_noun b)
u3_noun b)
{
if ( 0 == a ) {
return c3n;
@ -20,9 +20,9 @@
}
else switch ( (loz = u3n_slam_on(u3k(b), u3k(u3h(a)))) ) {
case c3y: return c3y;
case c3n: return u3qb_lien(u3t(a), b);
default: u3z(loz);
return u3m_bail(c3__exit);
case c3n: return u3qb_lien(u3t(a), b);
default: u3z(loz);
return u3m_bail(c3__exit);
}
}
}

View File

@ -7,8 +7,7 @@
/* functions
*/
u3_noun
u3qb_need(
u3_noun a)
u3qb_need(u3_noun a)
{
if ( 0 == a ) {
return u3m_bail(c3__exit);
@ -18,8 +17,7 @@
}
}
u3_noun
u3wb_need(
u3_noun cor)
u3wb_need(u3_noun cor)
{
u3_noun a;

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qb_reel(
u3_noun a,
u3_noun b)
u3qb_reel(u3_noun a,
u3_noun b)
{
if ( 0 == a ) {
return u3k(u3r_at(u3x_sam_3, b));
@ -25,8 +24,7 @@
}
}
u3_noun
u3wb_reel(
u3_noun cor)
u3wb_reel(u3_noun cor)
{
u3_noun a, b;

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qb_roll(u3_noun a,
u3_noun b)
u3_noun b)
{
if ( 0 == a ) {
return u3k(u3r_at(u3x_sam_3, b));

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qb_scag(
u3_atom a,
u3_noun b)
u3qb_scag(u3_atom a,
u3_noun b)
{
if ( !_(u3a_is_cat(a)) ) {
return u3m_bail(c3__fail);
@ -35,8 +34,7 @@
}
u3_noun
u3wb_scag(
u3_noun cor)
u3wb_scag(u3_noun cor)
{
u3_noun a, b;

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qb_skim(
u3_noun a,
u3_noun b)
u3qb_skim(u3_noun a,
u3_noun b)
{
if ( 0 == a ) {
return a;
@ -22,10 +21,10 @@
switch ( hoz ) {
case c3y: return u3nc(u3k(u3h(a)), vyr);
case c3n: return vyr;
default: u3z(hoz);
u3z(vyr);
return u3m_bail(c3__exit);
case c3n: return vyr;
default: u3z(hoz);
u3z(vyr);
return u3m_bail(c3__exit);
}
}
}

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qb_skip(
u3_noun a,
u3_noun b)
u3qb_skip(u3_noun a,
u3_noun b)
{
if ( 0 == a ) {
return a;
@ -22,16 +21,15 @@
switch ( hoz ) {
case c3y: return vyr;
case c3n: return u3nc(u3k(u3h(a)), vyr);
default: u3z(hoz);
u3z(vyr);
return u3_none;
case c3n: return u3nc(u3k(u3h(a)), vyr);
default: u3z(hoz);
u3z(vyr);
return u3_none;
}
}
}
u3_noun
u3wb_skip(
u3_noun cor)
u3wb_skip(u3_noun cor)
{
u3_noun a, b;

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qb_snag(u3_atom a,
u3_noun b)
u3_noun b)
{
if ( !_(u3a_is_cat(a)) ) {
return u3m_bail(c3__fail);

View File

@ -7,17 +7,15 @@
/* functions
*/
u3_noun
u3qb_sort(
u3_noun a,
u3_noun b)
u3qb_sort(u3_noun a,
u3_noun b)
{
// must think about
//
return u3m_bail(c3__fail);
}
u3_noun
u3wb_sort(
u3_noun cor)
u3wb_sort(u3_noun cor)
{
u3_noun a, b;

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qb_weld(u3_noun a,
u3_noun b)
u3_noun b)
{
if ( 0 == a ) {
return u3k(b);
@ -32,7 +32,8 @@
}
}
u3_noun
u3kb_weld(u3_noun a, u3_noun b)
u3kb_weld(u3_noun a,
u3_noun b)
{
u3_noun c = u3qb_weld(a, b);

View File

@ -22,8 +22,7 @@
}
}
u3_noun
u3wc_bex(
u3_noun cor)
u3wc_bex(u3_noun cor)
{
u3_noun a;

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qc_can(u3_atom a,
u3_noun b)
u3_noun b)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
return u3m_bail(c3__fail);

View File

@ -7,8 +7,7 @@
/* functions
*/
u3_noun
u3qc_cap(
u3_atom a)
u3qc_cap(u3_atom a)
{
c3_w met_w = u3r_met(0, a);
@ -22,8 +21,7 @@
}
}
u3_noun
u3wc_cap(
u3_noun cor)
u3wc_cap(u3_noun cor)
{
u3_noun a;

View File

@ -8,8 +8,8 @@
*/
u3_noun
u3qc_cat(u3_atom a,
u3_atom b,
u3_atom c)
u3_atom b,
u3_atom c)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
return u3m_bail(c3__fail);

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qc_con(u3_atom a,
u3_atom b)
u3_atom b)
{
c3_w lna_w = u3r_met(5, a);
c3_w lnb_w = u3r_met(5, b);

View File

@ -7,11 +7,10 @@
/* functions
*/
u3_noun
u3qc_cut(
u3_atom a,
u3_atom b,
u3_atom c,
u3_atom d)
u3qc_cut(u3_atom a,
u3_atom b,
u3_atom c,
u3_atom d)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
return u3m_bail(c3__fail);
@ -51,8 +50,7 @@
}
}
u3_noun
u3wc_cut(
u3_noun cor)
u3wc_cut(u3_noun cor)
{
u3_noun a, b, c, d;

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qc_dis(u3_atom a,
u3_atom b)
u3_atom b)
{
c3_w lna_w = u3r_met(5, a);
c3_w lnb_w = u3r_met(5, b);

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qc_dor(
u3_atom a,
u3_atom b)
u3qc_dor(u3_atom a,
u3_atom b)
{
if ( c3y == u3r_sing(a, b) ) {
return c3y;
@ -37,8 +36,7 @@
}
}
u3_noun
u3wc_dor(
u3_noun cor)
u3wc_dor(u3_noun cor)
{
u3_noun a, b;

45
jets/c/dvr.c Normal file
View File

@ -0,0 +1,45 @@
/* j/3/dvr.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qc_dvr(u3_atom a,
u3_atom b)
{
if ( 0 == b) {
return u3m_bail(c3__exit);
}
else {
if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
return u3nc(a / b, a % b);
}
else {
mpz_t a_mp, b_mp;
u3r_mp(a_mp, a);
u3r_mp(b_mp, b);
mpz_tdiv_qr(a_mp, b_mp, a_mp, b_mp);
return u3nc(u3k(u3i_mp(a_mp)), u3k(u3i_mp(b_mp)));
}
}
}
u3_noun
u3wc_dvr(u3_noun cor)
{
u3_noun a, b;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) )
{
return u3m_bail(c3__exit);
} else {
return u3qc_dvr(a, b);
}
}

View File

@ -7,10 +7,9 @@
/* functions
*/
u3_noun
u3qc_end(
u3_atom a,
u3_atom b,
u3_atom c)
u3qc_end(u3_atom a,
u3_atom b,
u3_atom c)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
return u3m_bail(c3__fail);
@ -42,8 +41,7 @@
}
}
u3_noun
u3wc_end(
u3_noun cor)
u3wc_end(u3_noun cor)
{
u3_noun a, b, c;

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qc_gor(u3_noun a,
u3_noun b)
u3_noun b)
{
c3_w c_w = u3r_mug(a);
c3_w d_w = u3r_mug(b);

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qc_hor(u3_noun a,
u3_noun b)
u3_noun b)
{
if ( c3y == u3ud(a) ) {
if ( c3y == u3ud(b) ) {

View File

@ -7,7 +7,9 @@
/* functions
*/
u3_noun
u3qc_lsh(u3_atom a, u3_atom b, u3_atom c)
u3qc_lsh(u3_atom a,
u3_atom b,
u3_atom c)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
return u3m_bail(c3__fail);
@ -57,7 +59,9 @@
}
}
u3_noun
u3kc_lsh(u3_noun a, u3_noun b, u3_noun c)
u3kc_lsh(u3_noun a,
u3_noun b,
u3_noun c)
{
u3_noun d = u3qc_lsh(a, b, c);

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qc_met(
u3_atom a,
u3_atom b)
u3qc_met(u3_atom a,
u3_atom b)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
if ( 0 == b ) {
@ -26,8 +25,7 @@
}
}
u3_noun
u3wc_met(
u3_noun cor)
u3wc_met(u3_noun cor)
{
u3_noun a, b;

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qc_mix(u3_atom a,
u3_atom b)
u3_atom b)
{
c3_w lna_w = u3r_met(5, a);
c3_w lnb_w = u3r_met(5, b);

View File

@ -7,9 +7,8 @@
/* functions
*/
u3_noun
u3qc_peg(
u3_atom a,
u3_atom b)
u3qc_peg(u3_atom a,
u3_atom b)
{
u3_atom c, d, e, f, g, h;
@ -29,8 +28,7 @@
return h;
}
u3_noun
u3wc_peg(
u3_noun cor)
u3wc_peg(u3_noun cor)
{
u3_noun a, b;

View File

@ -7,7 +7,8 @@
// good old linear search
//
static u3_noun
_po_find(u3_noun buf, u3_noun a)
_po_find(u3_noun buf,
u3_noun a)
{
if ( !_(u3a_is_cat(a)) ) {
return u3_nul;
@ -32,8 +33,7 @@
}
u3_noun
u3wcp_ins(
u3_noun cor)
u3wcp_ins(u3_noun cor)
{
u3_noun x, a, buf;
@ -48,8 +48,7 @@
}
}
u3_noun
u3wcp_ind(
u3_noun cor)
u3wcp_ind(u3_noun cor)
{
u3_noun x, a, buf;
@ -65,8 +64,7 @@
}
u3_noun
u3wcp_tos(
u3_noun cor)
u3wcp_tos(u3_noun cor)
{
u3_noun x, a, buf;
@ -86,8 +84,7 @@
}
}
u3_noun
u3wcp_tod(
u3_noun cor)
u3wcp_tod(u3_noun cor)
{
u3_noun x, a, buf;

38
jets/c/pow.c Normal file
View File

@ -0,0 +1,38 @@
/* j/3/pow.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qc_pow(u3_atom a,
u3_atom b)
{
if ( !_(u3a_is_cat(b)) ) {
return u3m_bail(c3__fail);
}
else {
mpz_t a_mp;
u3r_mp(a_mp, a);
mpz_pow_ui(a_mp, a_mp, b);
return u3i_mp(a_mp);
}
}
u3_noun
u3wc_pow(u3_noun cor)
{
u3_noun a, b;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) )
{
return u3m_bail(c3__exit);
} else {
return u3qc_pow(a, b);
}
}

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qc_rap(u3_atom a,
u3_noun b)
u3_noun b)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
return u3m_bail(c3__exit);

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qc_rip(u3_atom a,
u3_atom b)
u3_atom b)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
return u3m_bail(c3__fail);

View File

@ -7,10 +7,9 @@
/* functions
*/
u3_noun
u3qc_rsh(
u3_atom a,
u3_atom b,
u3_atom c)
u3qc_rsh(u3_atom a,
u3_atom b,
u3_atom c)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
return u3m_bail(c3__fail);
@ -40,8 +39,7 @@
}
}
u3_noun
u3wc_rsh(
u3_noun cor)
u3wc_rsh(u3_noun cor)
{
u3_noun a, b, c;
@ -58,7 +56,9 @@
}
}
u3_noun
u3kc_rsh(u3_noun a, u3_noun b, u3_noun c)
u3kc_rsh(u3_noun a,
u3_noun b,
u3_noun c)
{
u3_noun d = u3qc_rsh(a, b, c);

33
jets/c/sqt.c Normal file
View File

@ -0,0 +1,33 @@
/* j/3/sqt.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qc_sqt(u3_atom a)
{
mpz_t a_mp, b_mp;
u3r_mp(a_mp, a);
mpz_init(b_mp);
mpz_sqrtrem(a_mp, b_mp, a_mp);
return u3nc(u3k(u3i_mp(a_mp)), u3k(u3i_mp(b_mp)));
}
u3_noun
u3wc_sqt(u3_noun cor)
{
u3_noun a;
if ( (u3_none == (a = u3r_at(u3x_sam, cor))) ||
(c3n == u3ud(a)) )
{
return u3m_bail(c3__exit);
} else {
return u3qc_sqt(a);
}
}

View File

@ -8,7 +8,7 @@
*/
u3_noun
u3qc_vor(u3_atom a,
u3_atom b)
u3_atom b)
{
c3_w c_w = u3r_mug(u3r_mug(a));
c3_w d_w = u3r_mug(u3r_mug(b));

42
jets/c/xeb.c Normal file
View File

@ -0,0 +1,42 @@
/* j/3/xeb.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qc_xeb(u3_atom a)
{
mpz_t a_mp;
if ( __(u3a_is_dog(a)) ) {
u3r_mp(a_mp, a);
c3_d x = mpz_sizeinbase(a_mp, 2);
mpz_t b_mp;
mpz_init_set_ui(b_mp, x);
return u3i_mp(b_mp);
}
else {
mpz_init_set_ui(a_mp, a);
c3_d x = mpz_sizeinbase(a_mp, 2);
mpz_t b_mp;
mpz_init_set_ui(b_mp, x);
return u3i_mp(b_mp);
}
}
u3_noun
u3wc_xeb(u3_noun cor)
{
u3_noun a;
if ( (u3_none == (a = u3r_at(u3x_sam, cor))) ||
(c3n == u3ud(a)) )
{
return u3m_bail(c3__exit);
} else {
return u3qc_xeb(a);
}
}

81
jets/d/by_bif.c Normal file
View File

@ -0,0 +1,81 @@
/* jets/d/by_bif.c
**
*/
#include "all.h"
/* internal functions
*/
u3_noun _b_bif_putroot(u3_noun a,
u3_noun b)
{
if ( u3_nul == a) {
return u3nt(u3k(b), u3_nul, u3_nul);
}
else {
u3_noun n_a, l_a, r_a;
u3_noun p_n_a, q_n_a;
u3_noun p_b, q_b;
if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a))
|| (c3n == u3r_cell(b, &p_b, &q_b))
|| (c3n == u3r_cell(n_a, &p_n_a, &q_n_a)) ) {
return u3m_bail(c3__exit);
}
else if ( c3y == u3r_sing(p_b, p_n_a) ) {
return u3nt(u3k(b), u3k(l_a), u3k(r_a));
}
else {
u3_noun c, n_c, l_c, r_c;
u3_noun d;
if ( c3y == u3qc_gor(p_b, p_n_a) ) {
c = _b_bif_putroot(l_a, b);
u3r_trel(c, &n_c, &l_c, &r_c);
d = u3nt(u3k(n_c),
u3k(l_c),
u3nt(u3k(n_a), u3k(r_c), u3k(r_a))
);
u3z(c);
return d;
} else {
c = _b_bif_putroot(r_a, b);
u3r_trel(c, &n_c, &l_c, &r_c);
d = u3nt(u3k(n_c),
u3nt(u3k(n_a), u3k(l_a), u3k(l_c)),
u3k(r_c)
);
u3z(c);
return d;
}
}
}
}
/* functions
*/
u3_noun u3wdb_bif(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) {
return u3m_bail(c3__exit);
} else {
return u3qdb_bif(a, b);
}
}
u3_noun u3qdb_bif(u3_noun a,
u3_noun b)
{
u3_noun c, n_c, l_c, r_c;
u3_noun d;
c = _b_bif_putroot(a, b);
u3r_trel(c, &n_c, &l_c, &r_c);
d = u3nc(u3k(l_c), u3k(r_c));
u3z(c);
return d;
}
/*
u3_weak u3kdi_bif(u3_noun a, u3_noun b);
*/

85
jets/d/by_dif.c Normal file
View File

@ -0,0 +1,85 @@
/* jets/d/by_dif.c
**
*/
#include "all.h"
/* internal functions
*/
u3_noun _b_dif_join(u3_noun d,
u3_noun e)
{
if ( u3_nul == d ) {
return u3k(e);
} else if (u3_nul == e) {
return u3k(d);
} else {
u3_noun n_d, l_d, r_d;
u3_noun n_e, l_e, r_e;
u3_noun p_n_d, q_n_d;
u3_noun p_n_e, q_n_e;
if ( c3n == u3r_trel(d, &n_d, &l_d, &r_d)
|| c3n == u3r_trel(e, &n_e, &l_e, &r_e)
|| c3n == u3r_cell(n_d, &p_n_d, &q_n_d)
|| c3n == u3r_cell(n_e, &p_n_e, &q_n_e) ) {
return u3m_bail(c3__exit);
} else {
if ( c3y == u3qc_vor(p_n_d, p_n_e) ) {
return u3nt(u3k(n_d),
u3k(l_d),
_b_dif_join(u3k(r_d), u3k(e)));
} else {
return u3nt(u3k(n_e),
_b_dif_join(u3k(d), u3k(l_e)),
u3k(r_e));
}
}
}
}
/* functions
*/
u3_noun u3wdb_dif(u3_noun cor)
{
u3_noun a, b;
if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) {
return u3m_bail(c3__exit);
} else {
return u3qdb_dif(a, b);
}
}
u3_noun u3qdb_dif(u3_noun a,
u3_noun b)
{
if ( u3_nul == b ) {
return u3k(a);
} else {
u3_noun n_b, l_b, r_b;
u3_noun c, l_c, r_c;
if ( c3n == u3r_trel(b, &n_b, &l_b, &r_b) ) {
return u3m_bail(c3__exit);
} else {
c = u3qdb_bif(a, n_b);
if ( c3n == u3r_cell(c, &l_c, &r_c) ) {
return u3m_bail(c3__exit);
} else {
u3_noun d;
u3_noun e;
d = u3qdb_dif(l_c, l_b);
e = u3qdb_dif(r_c, r_b);
u3z(c);
return _b_dif_join(d, e);
}
}
}
}
/*
u3_weak u3kdb_dif(u3_noun a, u3_noun b);
*/

Some files were not shown because too many files have changed in this diff Show More