Commit 307232c7 authored by Stephanie Gawroriski's avatar Stephanie Gawroriski
Browse files

Initial commit with the basic tree.

parent 1e1396ef
This diff is collapsed.
# Multi-Phasic Applications: SquirrelJME
* Copyright (C) 2013-2016 Steven Gawroriski
<steven@multiphasicapps.net>
* Copyright (C) 2013-2016 Multi-Phasic Applications
<http://multiphasicapps.net>
SquirrelJME is intended to be a JavaME 8 compatible environment for strange and
many other devices.
Licenses:
* [GNU Affero General Public License, Version 3 or later](license.mkd)
Links:
* [Online repository](http://multiphasicapps.net:8080/squirreljme)
You may donate to SquirrelJME to help keep the author alive:
* BitCoin (**BTC/XBT**): [`1HNRD44krsCFUzUvVWaXr5jqvuyZDZy71M`](
bitcoin:1HNRD44krsCFUzUvVWaXr5jqvuyZDZy71M)
* LiteCoin (**LTC**): [`LKytAQcbPyox75uYMKo1NH1w2k1SqBaELi`](
litecoin:LKytAQcbPyox75uYMKo1NH1w2k1SqBaELi)
* DogeCoin (**DOGE**): [`DPsW21MV8RMuXhA3GoN8VPjkmQEugrEn8h`](
dogecoin:DPsW21MV8RMuXhA3GoN8VPjkmQEugrEn8h)
#!/bin/sh
# ---------------------------------------------------------------------------
# Multi-Phasic Applications: SquirrelJME
# Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
# Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
# ---------------------------------------------------------------------------
# SquirrelJME is under the GNU Affero General Public License v3, or later.
# For more information see license.txt.
# ---------------------------------------------------------------------------
# DESCRIPTION: Calculates the absolute path of a file
# File to check
__check="$1"
# path is absolute, just needs . and .. removed
if echo "$__check" | grep '^\/' > /dev/null
then
__yuck="$__check"
# Get relative path from PWD
else
__yuck="$(pwd)/$__check"
fi
# Split path by slashes and handle each line
# Need file due to argument stuff.
rm -f /tmp/$$.abs
touch /tmp/$$.abs
echo "$__yuck" | sed 's/\//\n/g' | while read __seg
do
# If this segment is ".", ignore it
# Also ignore blank segments too
if [ "$__seg" = "." ] || [ -z "$__seg" ]
then
continue
# If this is .., remove the topmost path element
elif [ "$__seg" = ".." ]
then
sed 's/\/[^/]*$//g' < /tmp/$$.abs > /tmp/$$.abs2
mv /tmp/$$.abs2 /tmp/$$.abs
# Otherwise append to path
else
echo -n "/$__seg" >> /tmp/$$.abs
fi
done
# Blank result ends in /
__result="$(cat /tmp/$$.abs)"
rm -f /tmp/$$.abs
if [ -z "$__result" ]
then
echo "/"
else
echo "$__result"
fi
#!/bin/sh
# ---------------------------------------------------------------------------
# Multi-Phasic Applications: SquirrelJME
# Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
# Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
# ---------------------------------------------------------------------------
# SquirrelJME is under the GNU Affero General Public License v3, or later.
# For more information see license.txt.
# ---------------------------------------------------------------------------
# DESCRIPTION: Creates a new blog entry! joy!
# Force C locale
export LC_ALL=C
# Directory of this script
__exedir="$(dirname -- "$0")"
# Requires command
if [ "$#" -lt "1" ]
then
echo "Usage: $0 (command) [...]"
exit 1
fi
# Get command and shift down
__cmd=$1
shift 1
# Current user
__myname="$(fossil user default 2> /dev/null)"
if [ -z "$__myname" ]
then
__myname="$USER"
fi
# Dots to dashes
__myname="$(echo "$__myname" | sed 's/\./-/g')"
# Get the current date in string form.
__nowyear="$(date +%Y)"
__nowmont="$(date +%m)"
__nowdayy="$(date +%d)"
__nowtime="$__nowyear$__nowmont$__nowdayy"
__htmtime="$__nowyear\/$__nowmont\/$__nowdayy"
#__nowfile="$__exedir/../chm/blog/$__nowtime.htm"
__sublet="$__nowyear/$__nowmont/$__nowdayy.mkd"
__nowfile="$__exedir/../dev-notes/$__sublet"
# Create if missing
if [ ! -f "$__nowfile" ]
then
echo "Does not exist, creating."
"$__exedir/create.sh" "$__nowfile"
sed "s/YYYYMMDD/$__htmtime/g" < "$__exedir/crtmpl/blog.mkd" > "$__nowfile"
fi
# Open it
"$__cmd" $* "$__nowfile"
begin-base64 644 cldc.gz
H4sICMsquVYC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z5wkNSlvWin25vYzwOMT6UWxtsoM6oYqkmuJeI9oPASIQyLvmkSo
ftN2JSpMonFYmK//wkupfdHdC0UFjWel827u6NAtWTaQfWdr5rlAO0ybG1ey
OSDw5m0EzNXo/giuahYuP9lYYCg2/HSItIWPCyGqtBq+swZbEI4Itik8OLIK
ZfNAPXCPYPiBFcqW3EkRvDKy4qOmZVgdCa2jDpfgl8Umi6XvrSnSacZWVGl0
Q4Ho35Ir2isKU3svFVt8OE9zRyEdWTsM3rTY826iI26NqzjBYGtVswM1Qljo
jGuSRzJuIArLlCsavHCIyTdn0o3ziacxx2h0COKjx3KUJynuIB/HQBpi6JqQ
shgccc1iGmZSm2CbG2ohM0Cj38Iq9dTYaimBH7m70HPpT6+gf8T8sVxC4kEz
bswr2h5X4anTZzpI22Oqpj5z39sdjrqmowESJnIo4hl9/4LZZ9r0i+mAgGJv
UgA66yTPfWqLof0lyc6EuZlsDB5K7fporqBxerGMUvAfnA8DEZf2yN2VvYUa
Cp1qfHNOoQdlzmcaDPBmh9PtIxqlIg4EOCj8GgU7uCGu7cx5HC+QfAFhbENU
YpDGckaRbacg64qQM2r8H8yl478tDQAA
====
#!/bin/sh
# ---------------------------------------------------------------------------
# Multi-Phasic Applications: SquirrelJME
# Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
# Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
# ---------------------------------------------------------------------------
# SquirrelJME is under the GNU Affero General Public License v3, or later.
# For more information see license.txt.
# ---------------------------------------------------------------------------
# DESCRIPTION: Creates files and adds them in one go, faster typing.
# Enhanced on 2015/06/23 to auto templatize files based on their name and
# extension.
# Force C locale
export LC_ALL=C
# Directory of this script
__exedir="$(dirname -- "$0")"
# Handle arguments
__cmd=""
__makex="0"
__noadd="0"
__notemplate="0"
# Get the current date in string form.
__nowyear="$(date +%Y)"
__nowmont="$(date +%m)"
__nowdayy="$(date +%d)"
__nowtime="$__nowyear$__nowmont$__nowdayy"
__htmtime="$__nowyear\/$__nowmont\/$__nowdayy"
# Help
print_help()
{
echo "Usage: $0 [-b] [-x] [-n] [-c command] [files...]"
echo ""
echo " -b Do not use a template."
echo " -x Make the files executable."
echo " -n Do not add files to the fossil repository."
echo " -c Run the specified command for each file."
}
# Handle arguments
while getopts "bnxc:" FOO
do
case $FOO in
c)
__cmd="$OPTARG"
;;
x)
__makex="1"
;;
b)
__notemplate="1"
;;
n)
__noadd="1"
;;
*)
print_help
exit 1
;;
esac
done
# Down they go
shift $(($OPTIND - 1))
# All files
__files=""
# Returns the absolute oath of a file
__absolutepath()
{
"$__exedir/absolute.sh" "$1"
}
# Find the name of the package (looks for the vmjar directory which contains
# REPOSITORY).
__findpkname()
{
# Get directory file is in
__indir="$(dirname "$(__absolutepath "$1")")"
__want="$2"
# Directory loop
__pkout="unknown.package"
__chop=""
while [ "$__indir" != "/" ]
do
# Wanting
if [ "$__want" -eq "0" ]
then
# Has repository file right above this path
if [ -f "$__indir/front.wiki" ] || [ -f "$__indir/../HALT" ]
then
__pkout="$__chop"
break
fi
# Want name of project this is
elif [ "$__want" -eq "1" ]
then
# pk: unknown.package; ch: ; in: /home/steven/k8/vmjar/kernel-asm
# pk: unknown.package; ch: kernel-asm; in: /home/steven/k8/vmjar
# pk: unknown.package; ch: vmjar.kernel-asm; in: /home/steven/k8
# pk: unknown.package; ch: k8.vmjar.kernel-asm; in: /home/steven
# pk: unknown.package; ch: steven.k8.vmjar.kernel-asm; in: /home
# If repository file in same dir
if [ -f "$__indir/front.wiki" ] || [ -f "$__indir/HALT" ]
then
echo "$__chop" | \
sed 's/^\([a-zA-Z0-9-]\{1,\}\)[^a-zA-Z0-9-]*.*/\1/'
return
fi
fi
# Get base name and chop down
if [ -z "$__chop" ]
then
__chop="$(basename "$__indir")"
else
__chop="$(basename "$__indir").$__chop"
fi
__indir="$(dirname "$__indir")"
done
# Want project directory, here it is unknown
if [ "$__want" -eq "1" ]
then
echo "untitled-project"
# Normal thing
else
# Use it directly
echo "$__pkout"
fi
}
# Go through all arguments
while [ "$#" -gt "0" ]
do
# Create upper directoroies
mkdir -p "$(dirname -- "$1")"
# Extra file
__extra="$1"
# Until there is no extra
while [ -n "$__extra" ]
do
# Get the absolute path of the current file
__tabsf="$(__absolutepath "$__extra")"
# Get location and name of file
__tfile="$(basename -- "$__tabsf")"
__tidir="$(dirname -- "$__tabsf")"
# Get extension of file
__tbase="$(echo -n "$__tfile" | sed 's/\(.*\)\..*$/\1/')"
if echo "$__tfile" | grep '\.' > /dev/null
then
__tfext="$(echo -n "$__tfile" | sed 's/.*\.\(.*\)$/\1/')"
else
__tfext=""
fi
# If the extension contains a plus, then more stuff can be created
# This is so instead of "Foo.java Foo.properties" one can just do
# "Foo.java+properties" to save on typing.
if echo "$__tfext" | grep '\+' > /dev/null
then
# Before and after the plus
__befp="$(echo "$__tfext" | sed 's/^\([^\+]*\)+\(.*\)$/\1/')"
__aftp="$(echo "$__tfext" | sed 's/^\([^\+]*\)+\(.*\)$/\2/')"
# Extra is after the plus
__extra="$__tidir/$__tbase.$__aftp"
__tfext="$__befp"
# Need to use an alternate output file
__afil="$__tidir/$__tbase.$__tfext"
# Nothing extra to do
else
# Keep actual file as is
__afil="$__extra"
# No file
__extra=""
fi
# Actual file to create
if [ -n "$__tfext" ]
then
__afile="$__tidir/$__tbase.$__tfext"
else
__afile="$__tidir/$__tbase"
fi
# Add to all files
__files="$__files $__afile"
# Create file
if [ ! -f "$1" ]
then
# From a template?
if [ "$__notemplate" -eq "0" ]
then
# Name of the package
__tpack="$(__findpkname "$__tabsf" 0)"
# Name of the project
__tproj="$(__findpkname "$__tabsf" 1)"
# Name of class
__tclas="$__tbase"
# C header clipped
__cheadname="$__tbase.h"
__cheadclip="$(echo "$__tpack/$__cheadname" | \
sed 's/[^a-zA-Z0-9_]//g' | \
sed 'y/qwertyuiopasdfghjklzxcvbnm/QWERTYUIOPASDFGHJKLZXCVBNM/' |
sed 's/^\(.\{1,13\}\).*\(.\{11\}\)$/\1\2/')"
# C stuff
__cheadgard="SJME_hG${__cheadclip}"
__ccxxisbad="SJME_cX${__cheadclip}"
# Java source code
(if [ "$__tfext" = "java" ]
then
# Package file
if [ "$__tbase" = "package-info" ]
then
cat "$__exedir/crtmpl/package-info"
else
cat "$__exedir/crtmpl/java"
fi
# Other template
elif [ -f "$__exedir/crtmpl/$__tfext" ]
then
cat "$__exedir/crtmpl/$__tfext"
# Unknown, blank file
else
echo
fi) | sed 's/ZZZCLASSZZZ/'"$__tclas"'/g' \
| sed 's/ZZZPACKAGEZZZ/'"$__tpack"'/g' \
| sed 's/ZZZSINCEZZZ/'"$__htmtime"'/g' \
| sed 's/ZZZPROJECTZZZ/'"$__tproj"'/g' \
| sed 's/ZZZSDATEZZZ/'"$__nowtime"'/g' \
| sed 's/ZZZCHEADERNAMEZZZ/'"$__cheadname"'/g' \
| sed 's/ZZZCHEADERCLIPZZZ/'"$__cheadclip"'/g' \
| sed 's/ZZZCHEADERGUARDZZZ/'"$__cheadgard"'/g' \
| sed 's/ZZZCXXISBADZZZ/'"$__ccxxisbad"'/g' > "$__afil"
# Not wanting a template
else
# Touch base file so it exists
touch "$__afil"
fi
fi
# Make it executable
if [ "$__makex" -ne "0" ]
then
chmod +x "$__afil"
fi
# Add to repo
if [ "$__noadd" -eq "0" ]
then
fossil add "$__afil"
fi
done
# Down one
shift 1
done
# Run command on it
if [ -n "$__cmd" ] && [ -n "$__files" ]
then
"$__cmd" $__files
fi
/* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
// Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU Affero General Public License v3+, or later.
// For more information see license.txt.
// --------------------------------------------------------------------------*/
/**
* DESCRIBE THIS.
*
* @since ZZZSINCEZZZ
*/
#include "ZZZCHEADERNAMEZZZ"
/* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
// Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU Affero General Public License v3+, or later.
// For more information see license.txt.
// --------------------------------------------------------------------------*/
/**
* DESCRIBE THIS.
*
* @since ZZZSINCEZZZ
*/
/** Header guard. */
#ifndef ZZZCHEADERGUARDZZZ
#define ZZZCHEADERGUARDZZZ
/** Anti-C++. */
#ifdef _cplusplus
#ifndef SJME_CXX_IS_EXTERNED
#define SJME_CXX_IS_EXTERNED
#define ZZZCXXISBADZZZ
extern "C"
{
#endif /** #ifdef SJME_CXX_IS_EXTERNED */
#endif /** #ifdef __cplusplus */
/****************************************************************************/
/****************************************************************************/
/** Anti-C++. */
#ifdef __cplusplus
#ifdef ZZZCXXISBADZZZ
}
#undef ZZZCXXISBADZZZ
#undef SJME_CXX_IS_EXTERNED
#endif /** #ifdef ZZZCXXISBADZZZ */
#endif /** #ifdef __cplusplus */
/** Header guard. */
#endif /* #ifndef ZZZCHEADERGUARDZZZ */
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
// Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU Affero General Public License v3+, or later.
// For more information see license.txt.
// ---------------------------------------------------------------------------
package ZZZPACKAGEZZZ;
/**
* DESCRIBE THIS.
*
* @since ZZZSINCEZZZ
*/
public class ZZZCLASSZZZ
{
}
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
// Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU Affero General Public License v3+, or later.
// For more information see license.txt.
// ---------------------------------------------------------------------------
/**
* DESCRIBE THIS.
*
* @since ZZZSINCEZZZ
*/
package ZZZPACKAGEZZZ;
# ---------------------------------------------------------------------------
# Multi-Phasic Applications: SquirrelJME
# Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
# Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
# ---------------------------------------------------------------------------
# SquirrelJME is under the GNU Affero General Public License v3, or later.
# For more information see license.txt.
# ---------------------------------------------------------------------------
# Std
na=Null arguments.
#!/bin/sh
# ---------------------------------------------------------------------------
# Multi-Phasic Applications: SquirrelJME
# Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
# Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
# ---------------------------------------------------------------------------
# SquirrelJME is under the GNU Affero General Public License v3, or later.
# For more information see license.txt.
# ---------------------------------------------------------------------------
# DESCRIPTION: Describe this.
# Force C locale
export LC_ALL=C
# Directory of this script
__exedir="$(dirname -- "$0")"
#!/bin/sh
# ---------------------------------------------------------------------------
# Multi-Phasic Applications: SquirrelJME
# Copyright (C) 2013-2016 Steven Gawroriski <steven@multiphasicapps.net>
# Copyright (C) 2013-2016 Multi-Phasic Applications <multiphasicapps.net>
# ---------------------------------------------------------------------------
# SquirrelJME is under the GNU Affero General Public License v3, or later.
# For more information see license.txt.
# ---------------------------------------------------------------------------
# DESCRIPTION: Moves a file with fossil mv and then mv
# Force C locale
export LC_ALL=C