Compare commits

..

No commits in common. "28453e862a13ce6dbc9cd220b6c7a2405bcb9ab0" and "e6b72e5faa75b395b774269fc9197240d4e4e910" have entirely different histories.

5 changed files with 9 additions and 113 deletions

View File

@ -7,12 +7,12 @@ COPT = -g -fpic -no-pie -Wall -DDEBUG_LEVEL=0 -Werror=parentheses
LIBS = ../libfloatimg.a -ltiff -lpnglite -lm -lz -lcfitsio
OBJS = fifo.o sfx.o crapulator.o glitches.o metriques.o \
filterstack.o single.o utilfuncs.o
filterstack.o single.o
DEPS = ../floatimg.h \
../libfloatimg.a \
fifo.h crapulator.h metriques.h glitches.h sfx.h \
filterstack.h crapdef.h crapstr.h single.h utilfuncs.h
filterstack.h crapdef.h crapstr.h single.h
all: fonderie interpolator singlepass t
@ -71,7 +71,4 @@ metriques.o: metriques.c metriques.h Makefile
glitches.o: glitches.c glitches.h Makefile
gcc ${COPT} -c $<
utilfuncs.o: utilfuncs.c utilfuncs.h Makefile
gcc ${COPT} -c $<
# ---------------------------------------------------------

View File

@ -55,7 +55,7 @@ IdxValue *idxvalues;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p %d %p)\n", __func__, ptr_glob,
ptr_idxval, method, p_average);
ptr_idxval, method, average);
#endif
if (0==method && verbosity) {
@ -140,8 +140,8 @@ foo = glob(pattern, 0, NULL, &globbuf);
fprintf(stderr, " globbing '%s' -> %d, %d files found\n",
pattern, foo, (int)globbuf.gl_pathc);
if (0 == globbuf.gl_pathc) {
fprintf(stderr, "%s : no file found, ABEND\n", __func__);
exit(1);
fprintf(stderr, "%s : no file found, aborting\n", __func__);
return -1;
}
idx_values = NULL;
@ -240,7 +240,9 @@ puts("\t-S nn\t\tmysterious sort");
puts("\t-L\t\tlist available filters");
puts("\t-v\t\tincrease verbosity");
if (verbosity) { puts(""); fimg_print_version(2); puts(""); }
if (verbosity) {
list_crapulors("available filters");
}
exit(0);
}

View File

@ -16,8 +16,6 @@
#include "crapulator.h"
#include "single.h"
#include "utilfuncs.h"
/* ----------------------------------------------------------- */
int verbosity;
@ -30,30 +28,6 @@ int verbosity;
#define STK 6
/* ----------------------------------------------------------- */
/* new Sat Nov 9 22:17:46 UTC 2024 */
int essai_test_export_dir(char *footxt)
{
int foo;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' )\n", __func__, footxt);
#endif
foo = check_if_export_dir_is_valid("/tmp/quux", 0);
fprintf(stderr, " got %d\n\n", foo);
foo = check_if_export_dir_is_valid("/home", 0);
fprintf(stderr, " got %d\n\n", foo);
foo = check_if_export_dir_is_valid("./", 0);
fprintf(stderr, " got %d\n\n", foo);
foo = check_if_export_dir_is_valid("Makefile", 0);
fprintf(stderr, " got %d\n\n", foo);
return -1;
}
/* ----------------------------------------------------------- */
int essai_filterstack(char *fIname, char *fOname)
@ -62,11 +36,6 @@ int foo;
FloatImg image;
double debut, fin;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' '%s' )\n", __func__, fIname, fOname);
#endif
// filterstack_list(STK, __func__);
foo = fimg_create_from_dump(fIname, &image);
@ -249,23 +218,15 @@ while ((opt = getopt(argc, argv, "hF:g:i:Lo:O:svx")) != -1) {
}
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s : argc=%d, optind=%d\n", argv[0], argc, optind);
fprintf(stderr, "%s : argc = %d, optind = %d\n", argv[0], argc, optind);
#endif
foo = essai_test_export_dir("bla bla");
if (foo) {
fprintf(stderr, "err %d in essai_test_export_dir\n", foo);
exit(1);
}
exit(0);
foo = parse_filter_chain(STK, filterchain);
if (foo) {
fprintf(stderr, "err %d in parse_filter_chain\n", foo);
exit(1);
}
if (do_xper) {
experiment(infile);
return 0;

View File

@ -1,53 +0,0 @@
/*
* utilfuncs.c
*
* new Sat Nov 9 22:15:15 UTC 2024
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "utilfuncs.h"
extern int verbosity;
/* -------------------------------------------------------------- */
int check_if_export_dir_is_valid(char *path, int action)
{
int foo;
struct stat statbuf;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s', %d )\n", __func__, path, action);
#endif
foo = stat(path, &statbuf);
if (foo) {
if (verbosity) perror(path);
return 0;
}
#if DEBUG_LEVEL
fprintf(stderr, " mode 0x%x\n", statbuf.st_mode);
#endif
if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
if (verbosity) fprintf(stderr, "%s: Not a directory\n", path);
return 0;
}
/* OK, c'est un repertoire, mais peut-on écrire dedans ? */
foo = access(path, W_OK);
#if DEBUG_LEVEL
fprintf(stderr, " access '%s' = %d\n", path, foo);
#endif
if (0 != foo) {
if (verbosity) fprintf(stderr, "%s: can't write\n", path);
return 0;
}
return 1; /* export dir is OK */
}
/* -------------------------------------------------------------- */

View File

@ -1,11 +0,0 @@
/*
* utilfuncs.c
*
* new Sat Nov 9 22:15:49 UTC 2024
*/
/* -------------------------------------------------------------- */
int check_if_export_dir_is_valid(char *path, int action);
/* -------------------------------------------------------------- */