Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node in dl_show #1

Open
wants to merge 4 commits into
base: gerhard
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Source/Thing/src/AVSERVER.C
Original file line number Diff line number Diff line change
Expand Up @@ -1775,11 +1775,23 @@ short avp_checkbuf(short id, short msg, char *tmsg, char *buf, short write) {
AVINFO *ainfo;

old_sigbus = (long) Psignal(SIGBUS, (long) handle_sigbus);
/* Wenn es Psignal nicht gibt, kann man nix machen ... */
if (old_sigbus == -32L)
return (1);
origbuf = buf;
ok = 1;
/*
* Ohne setjmp()/longjmp() geht es nicht, weil bei R�ckkehr
* aus einem Signalhandler f�r SIGBUS und SIGSEGV an genau
* der Stelle weitergemacht wird, die den Fehler verursacht
* hatte -> das Signal w�rde also gleich nochmal ausgel�st
*/
if (setjmp(check)) {
/*
* Wenn dieser Teil der Routine erreicht wird, wurde der
* Signalhandler aktiviert und ist mit longjmp() hierher
* zur�ckgekehrt, um den Fehler zu melden
*/
ok = 0;
ainfo = avp_get(id);
if (ainfo)
Expand All @@ -1793,6 +1805,13 @@ short avp_checkbuf(short id, short msg, char *tmsg, char *buf, short write) {
frm_alert(1, almsg, altitle, conf.wdial, 0L);
}
} else {
/*
* Dieser Teil wird direkt nach dem Aufruf von setjmp()
* erreicht. Hier wird der Puffer gepr�ft, wobei die
* Abfrage auf Ende des Puffers erst in der Schleife
* stattfindet, um ggf. auch diese Speicherstelle
* testweise zu beschreiben
*/
for (;; buf++) {
d = *buf;
if (write)
Expand All @@ -1801,6 +1820,10 @@ short avp_checkbuf(short id, short msg, char *tmsg, char *buf, short write) {
break;
}
}
/*
* Den alten Signalhandler restaurieren und das Ergebnis des
* Tests liefern
*/
Psignal(SIGBUS, (long) old_sigbus);
return (ok);
}
Expand Down
3 changes: 3 additions & 0 deletions Source/Thing/src/DLMENU.C
Original file line number Diff line number Diff line change
Expand Up @@ -2497,6 +2497,9 @@ void dl_open(short new) {

Anzeigen/Drucken der aktuell selektierten Datei (Menuepunkt "Anzeigen",
bzw. Menuepunkt "Drucken")

mode: 0 = anzeigen, 1 = drucken

-------------------------------------------------------------------------*/
short dl_show(short mode, char *buf) {
char full[MAX_CLEN + MAX_PLEN];
Expand Down
135 changes: 135 additions & 0 deletions Source/Thing/src/DLRENAME.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/**
* Thing
* Copyright (C) 1994-2012 Arno Welzel, Thomas Binder
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*
* @copyright Arno Welzel, Thomas Binder 1994-2012
* @author Arno Welzel, Thomas Binder
* @license LGPL
*/

/**=========================================================================
DLRENAME.C

Thing
Umbenenne von Dateien oder Ordner in Gro�- bzw. Kleinbuchstaben
=========================================================================*/

#include "..\include\globdef.h"
#include "..\include\types.h"
#include "rsrc\thing.h"
#include "rsrc\thgtxt.h"

/**-------------------------------------------------------------------------
-------------------------------------------------------------------------*/

short dl_rename(short pitem) {
short i, j;
char ipath[MAX_PLEN], oldpath[MAX_PLEN], npath[MAX_PLEN], iname[MAX_FLEN];
short ok;
short whandle;
W_PATH *wpath;
char *readbuf;
FILESYS fs;

dcopy = pmalloc(sizeof(DCOPY));
if (!dcopy) {
frm_alert(1, rs_frstr[ALNOMEM], altitle, conf.wdial, 0L);
return 0;
}
for (i = 0; i < 32; i++)
dcopy->dlst[i] = 0;

/* Objekte in einem Fenster ? */
if (desk.sel.win) {
/* Jo ... */
switch (desk.sel.win->class) {
case WCPATH:
lbuf = pmalloc(MAX_KBDLEN);
if (lbuf) {
ok = sel2buf(lbuf, iname, ipath, (short)MAX_KBDLEN);
if (ok)
{
readbuf = lbuf;
while (get_buf_entry(readbuf, ipath, &readbuf) && ok) {
j = (short) strlen(ipath);
full2comp(ipath, npath, iname);
if (strlen(iname) > 0)
{
strcpy (oldpath, ipath);
if (pitem == POPBIGLETTER )
{
i = 0;
while (iname[i]) {
iname[i] = nkc_toupper(iname[i]);
i++;
}
}
else
{
i = 0;
while (iname[i]) {
iname[i] = nkc_tolower(iname[i]);
i++;
}
}
strcat (npath, iname);
Frename(0, oldpath, npath);
/* Laufwerks-Update vormerken */
fsinfo(npath, &fs);
i = fs.biosdev;
if ((i >= 0) && (i <= 31))
dcopy->dlst[i] = 1;
}
}
/* Verzeichnisse aktualisieren */
for (i = 0; i < MAX_PWIN; i++) {
if (glob.win[i].state & WSOPEN) {
wpath = (W_PATH *) glob.win[i].user;
if (wpath->rel == -1) {
/* Nicht mehr benoetigte Verzeichnisfenster schliessen */
tb.topwin = &glob.win[i];
dl_closewin();
} else {
/* Veraenderte Laufwerke aktualisieren */
j = wpath->filesys.biosdev;
if (j >= 0 && j <= 31) {
if (dcopy->dlst[j]) {
wpath_update(&glob.win[i]);
win_redraw(&glob.win[i], tb.desk.g_x, tb.desk.g_y, tb.desk.g_w, tb.desk.g_h);
win_slide(&glob.win[i], S_INIT, 0, 0);
}
}
}
}
}
/* Aktives Fenster neu ermitteln - koennte veraendert sein! */
get_twin(&whandle);
tb.topwin = win_getwinfo(whandle);
win_newtop(tb.topwin);
}
pfree(lbuf);
} else {
frm_alert(1, rs_frstr[ALNOMEM], altitle, conf.wdial, 0L);
}
break;
}
}

pfree (dcopy);
dcopy = 0L;
return (1);
}
4 changes: 4 additions & 0 deletions Source/Thing/src/HNDLEVNT.C
Original file line number Diff line number Diff line change
Expand Up @@ -3318,6 +3318,10 @@ void handle_context(short mx, short my, WININFO *win) {
case POPCAPPL:
dl_appl();
break;
case POPBIGLETTER:
case POPSMALLETTER:
dl_rename(pitem);
break;
}
}
if (count)
Expand Down
2 changes: 2 additions & 0 deletions Source/Thing/src/WINDOW.C
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,11 @@ static void winRedraw(struct wininfo *win, short type, GRECT *area) {
tchar[0] = WPentry->tchar;
else /* Nein */
{
/*
if (WPentry->aptype)
tchar[0] = '.'; /* ausf�hrbares Programm */
else
*/
tchar[0] = ' '; /* normale Datei */
}
} else {
Expand Down
Loading