diff options
Diffstat (limited to 'ao-tools/libaltos')
-rw-r--r-- | ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui-contents.xml | 1 | ||||
-rw-r--r-- | ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui.xml | 1 | ||||
-rw-r--r-- | ao-tools/libaltos/AltOS Package Configuration.pmdoc/index.xml | 1 | ||||
-rw-r--r-- | ao-tools/libaltos/Makefile | 2 | ||||
-rw-r--r-- | ao-tools/libaltos/libaltos.c | 12 | ||||
-rw-r--r-- | ao-tools/libaltos/libaltos.h | 2 |
6 files changed, 15 insertions, 4 deletions
diff --git a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui-contents.xml b/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui-contents.xml deleted file mode 100644 index e19a1e4c..00000000 --- a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui-contents.xml +++ /dev/null @@ -1 +0,0 @@ -<pkg-contents spec="1.12"><f n="AltosUI.app" o="keithp" g="keithp" p="16877" pt="/Users/keithp/AltosUI.app" m="false" t="file"><f n="Contents" o="keithp" g="keithp" p="16877"><f n="Info.plist" o="keithp" g="keithp" p="33188"/><f n="MacOS" o="keithp" g="keithp" p="16877"><f n="JavaApplicationStub" o="keithp" g="keithp" p="33133"/></f><f n="PkgInfo" o="keithp" g="keithp" p="33188"/><f n="Resources" o="keithp" g="keithp" p="16877"><f n="AltosUIIcon.icns" o="keithp" g="keithp" p="33188"/><f n="Java" o="keithp" g="keithp" p="16877"><f n="altosui.jar" o="keithp" g="keithp" p="33188"/><f n="cmu_time_awb.jar" o="keithp" g="keithp" p="33188"/><f n="cmu_us_kal.jar" o="keithp" g="keithp" p="33188"/><f n="cmudict04.jar" o="keithp" g="keithp" p="33188"/><f n="cmulex.jar" o="keithp" g="keithp" p="33188"/><f n="cmutimelex.jar" o="keithp" g="keithp" p="33188"/><f n="en_us.jar" o="keithp" g="keithp" p="33188"/><f n="freetts-jsapi10.jar" o="keithp" g="keithp" p="33188"/><f n="freetts.jar" o="keithp" g="keithp" p="33188"/><f n="libaltos.dylib" o="keithp" g="keithp" p="33188"/></f></f></f></f></pkg-contents>
\ No newline at end of file diff --git a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui.xml b/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui.xml deleted file mode 100644 index 5d84e5f0..00000000 --- a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/01altosui.xml +++ /dev/null @@ -1 +0,0 @@ -<pkgref spec="1.12" uuid="C5762664-2F26-4536-94C4-56F0FBC08D1A"><config><identifier>org.altusmetrum.altosUi.AltosUI.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><installFrom>/Users/keithp/AltosUI.app</installFrom><installTo mod="true" relocatable="true">/Applications/AltosUI.app</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo.path</mod><mod>parent</mod><mod>requireAuthorization</mod><mod>installTo</mod></config><contents><file-list>01altosui-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file diff --git a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/index.xml b/ao-tools/libaltos/AltOS Package Configuration.pmdoc/index.xml deleted file mode 100644 index 1277db62..00000000 --- a/ao-tools/libaltos/AltOS Package Configuration.pmdoc/index.xml +++ /dev/null @@ -1 +0,0 @@ -<pkmkdoc spec="1.12"><properties><title>AltOS UI</title><build>/Users/keithp/Documents/AltosUI.pkg</build><organization>org.altusmetrum</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="AltosUI" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.altusmetrum.altosUi.AltosUI.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/><item type="file">01altosui.xml</item><mod>properties.title</mod></pkmkdoc>
\ No newline at end of file diff --git a/ao-tools/libaltos/Makefile b/ao-tools/libaltos/Makefile index 0bbd304c..fa5127eb 100644 --- a/ao-tools/libaltos/Makefile +++ b/ao-tools/libaltos/Makefile @@ -51,7 +51,7 @@ JAVAFLAGS=-Xlint:unchecked all: libaltos.$(LIBEXT) cjnitest $(CLASSFILES) .java.class: - javac -cp "$(CLASSPATH)" $(JAVAFLAGS) $*.java + javac -encoding UTF8 -classpath "$(CLASSPATH)" $(JAVAFLAGS) $*.java CFLAGS=$(OS_CFLAGS) -O0 -g -I. diff --git a/ao-tools/libaltos/libaltos.c b/ao-tools/libaltos/libaltos.c index df0d5b2e..00fb2125 100644 --- a/ao-tools/libaltos/libaltos.c +++ b/ao-tools/libaltos/libaltos.c @@ -567,6 +567,14 @@ void altos_close(struct altos_file *file) { close(file->fd); + file->fd = -1; +} + +void +altos_free(struct altos_file *file) +{ + if (file->fd != -1) + close(file->fd); free(file); } @@ -592,6 +600,8 @@ altos_flush(struct altos_file *file) while (file->out_used) { int ret; + if (file->fd < 0) + return -EBADF; ret = write (file->fd, file->out_data, file->out_used); if (ret < 0) return -errno; @@ -610,6 +620,8 @@ altos_getchar(struct altos_file *file, int timeout) int ret; altos_flush(file); + if (file->fd < 0) + return -EBADF; ret = read(file->fd, file->in_data, USB_BUF_SIZE); if (ret < 0) return -errno; diff --git a/ao-tools/libaltos/libaltos.h b/ao-tools/libaltos/libaltos.h index 782f244e..53026e0a 100644 --- a/ao-tools/libaltos/libaltos.h +++ b/ao-tools/libaltos/libaltos.h @@ -42,6 +42,8 @@ altos_open(struct altos_device *device); void altos_close(struct altos_file *file); +void altos_free(struct altos_file *file); + int altos_putchar(struct altos_file *file, char c); |