Browse Source

Kinda coded the whole thing

master
Jules Roumieux 3 years ago
parent
commit
2eea7c4443
8 changed files with 33 additions and 1458 deletions
  1. +3
    -1
      .gitignore
  2. +0
    -296
      config.log
  3. +0
    -1051
      config.status
  4. +3
    -0
      configure.ac
  5. +0
    -103
      src/.deps/main.Po
  6. +2
    -0
      src/Makefile.am
  7. BIN
      src/c2m
  8. +25
    -7
      src/main.c

+ 3
- 1
.gitignore View File

@@ -1,4 +1,4 @@
*.o
.o
Makefile
Makefile.in
configure
@@ -8,3 +8,5 @@ autom4te.cache
depcomp
install-sh
missing
c2m
aur.jpg

+ 0
- 296
config.log View File

@@ -1,296 +0,0 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by c2m configure 0.0.1, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ ./configure --no-create --no-recursion

## --------- ##
## Platform. ##
## --------- ##

hostname = Galaxy-Jules
uname -m = x86_64
uname -r = 4.5.0-2-MANJARO
uname -s = Linux
uname -v = #1 SMP PREEMPT Wed Mar 16 04:25:52 CET 2016

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/lib/hardening-wrapper/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /opt/devkitpro/devkitARM/bin
PATH: /usr/lib/jvm/default/bin
PATH: /usr/bin/site_perl
PATH: /usr/bin/vendor_perl
PATH: /usr/bin/core_perl
PATH: /home/archjules/src/Ndless/ndless-sdk/toolchain/install/bin
PATH: /home/archjules/src/Ndless/ndless-sdk/toolchain/../bin
PATH: /home/archjules/toolchains/bin
PATH: /home/archjules/.gem/ruby/2.3.0/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1831: checking for a BSD-compatible install
configure:1899: result: /usr/bin/install -c
configure:1910: checking whether build environment is sane
configure:1965: result: yes
configure:2116: checking for a thread-safe mkdir -p
configure:2155: result: /usr/bin/mkdir -p
configure:2162: checking for gawk
configure:2178: found /usr/bin/gawk
configure:2189: result: gawk
configure:2200: checking whether make sets $(MAKE)
configure:2222: result: yes
configure:2251: checking whether make supports nested variables
configure:2268: result: yes
configure:2446: checking for gcc
configure:2462: found /usr/bin/gcc
configure:2473: result: gcc
configure:2702: checking for C compiler version
configure:2711: gcc --version >&5
gcc (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2722: $? = 0
configure:2711: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-5-20160209/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 5.3.0 (GCC)
configure:2722: $? = 0
configure:2711: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2722: $? = 1
configure:2711: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2722: $? = 1
configure:2742: checking whether the C compiler works
configure:2764: gcc conftest.c >&5
configure:2768: $? = 0
configure:2816: result: yes
configure:2819: checking for C compiler default output file name
configure:2821: result: a.out
configure:2827: checking for suffix of executables
configure:2834: gcc -o conftest conftest.c >&5
configure:2838: $? = 0
configure:2860: result:
configure:2882: checking whether we are cross compiling
configure:2890: gcc -o conftest conftest.c >&5
configure:2894: $? = 0
configure:2901: ./conftest
configure:2905: $? = 0
configure:2920: result: no
configure:2925: checking for suffix of object files
configure:2947: gcc -c conftest.c >&5
configure:2951: $? = 0
configure:2972: result: o
configure:2976: checking whether we are using the GNU C compiler
configure:2995: gcc -c conftest.c >&5
configure:2995: $? = 0
configure:3004: result: yes
configure:3013: checking whether gcc accepts -g
configure:3033: gcc -c -g conftest.c >&5
configure:3033: $? = 0
configure:3074: result: yes
configure:3091: checking for gcc option to accept ISO C89
configure:3154: gcc -c -g -O2 conftest.c >&5
configure:3154: $? = 0
configure:3167: result: none needed
configure:3192: checking whether gcc understands -c and -o together
configure:3214: gcc -c conftest.c -o conftest2.o
configure:3217: $? = 0
configure:3214: gcc -c conftest.c -o conftest2.o
configure:3217: $? = 0
configure:3229: result: yes
configure:3257: checking for style of include used by make
configure:3285: result: GNU
configure:3311: checking dependency style of gcc
configure:3422: result: gcc3
configure:3594: checking that generated files are newer than configure
configure:3600: result: done
configure:3623: creating ./config.status

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/usr/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_make_make_set=yes
am_cv_CC_dependencies_compiler_type=gcc3
am_cv_make_support_nested_variables=yes
am_cv_prog_cc_c_o=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /home/archjules/Documents/c2m/missing aclocal-1.15'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AUTOCONF='${SHELL} /home/archjules/Documents/c2m/missing autoconf'
AUTOHEADER='${SHELL} /home/archjules/Documents/c2m/missing autoheader'
AUTOMAKE='${SHELL} /home/archjules/Documents/c2m/missing automake-1.15'
AWK='gawk'
CC='gcc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
CPPFLAGS=''
CYGPATH_W='echo'
DEFS='-DPACKAGE_NAME=\"c2m\" -DPACKAGE_TARNAME=\"c2m\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"c2m\ 0.0.1\" -DPACKAGE_BUGREPORT=\"julese50@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"c2m\" -DVERSION=\"0.0.1\"'
DEPDIR='.deps'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /home/archjules/Documents/c2m/missing makeinfo'
MKDIR_P='/usr/bin/mkdir -p'
OBJEXT='o'
PACKAGE='c2m'
PACKAGE_BUGREPORT='julese50@gmail.com'
PACKAGE_NAME='c2m'
PACKAGE_STRING='c2m 0.0.1'
PACKAGE_TARNAME='c2m'
PACKAGE_URL=''
PACKAGE_VERSION='0.0.1'
PATH_SEPARATOR=':'
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION='0.0.1'
ac_ct_CC='gcc'
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE='#'
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='${prefix}'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/archjules/Documents/c2m/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "c2m"
#define PACKAGE_TARNAME "c2m"
#define PACKAGE_VERSION "0.0.1"
#define PACKAGE_STRING "c2m 0.0.1"
#define PACKAGE_BUGREPORT "julese50@gmail.com"
#define PACKAGE_URL ""
#define PACKAGE "c2m"
#define VERSION "0.0.1"

configure: exit 0

## ---------------------- ##
## Running config.status. ##
## ---------------------- ##

This file was extended by c2m config.status 0.0.1, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status

on Galaxy-Jules

config.status:774: creating Makefile
config.status:774: creating man/Makefile
config.status:774: creating src/Makefile
config.status:946: executing depfiles commands

+ 0
- 1051
config.status
File diff suppressed because it is too large
View File


+ 3
- 0
configure.ac View File

@@ -16,6 +16,9 @@ AC_PROG_CC

# Checks for libraries.

PKG_CHECK_MODULES(WAND, [MagickWand], [], AC_MSG_ERROR([ImageMagick is not installed.]))
AC_SUBST(WAND_LIBS)
AC_SUBST(WAND_CFLAGS)

# Checks for header files.


+ 0
- 103
src/.deps/main.Po View File

@@ -1,103 +0,0 @@
main.o: main.c /usr/include/stdc-predef.h /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/bits/byteswap-16.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/bits/stdlib-bsearch.h /usr/include/bits/stdlib-float.h \
/usr/include/errno.h /usr/include/bits/errno.h \
/usr/include/linux/errno.h /usr/include/asm/errno.h \
/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h

/usr/include/stdc-predef.h:

/usr/include/stdio.h:

/usr/include/features.h:

/usr/include/sys/cdefs.h:

/usr/include/bits/wordsize.h:

/usr/include/gnu/stubs.h:

/usr/include/gnu/stubs-64.h:

/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include/stddef.h:

/usr/include/bits/types.h:

/usr/include/bits/typesizes.h:

/usr/include/libio.h:

/usr/include/_G_config.h:

/usr/include/wchar.h:

/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include/stdarg.h:

/usr/include/bits/stdio_lim.h:

/usr/include/bits/sys_errlist.h:

/usr/include/bits/stdio.h:

/usr/include/stdlib.h:

/usr/include/bits/waitflags.h:

/usr/include/bits/waitstatus.h:

/usr/include/endian.h:

/usr/include/bits/endian.h:

/usr/include/bits/byteswap.h:

/usr/include/bits/byteswap-16.h:

/usr/include/sys/types.h:

/usr/include/time.h:

/usr/include/sys/select.h:

/usr/include/bits/select.h:

/usr/include/bits/sigset.h:

/usr/include/bits/time.h:

/usr/include/sys/sysmacros.h:

/usr/include/bits/pthreadtypes.h:

/usr/include/alloca.h:

/usr/include/bits/stdlib-bsearch.h:

/usr/include/bits/stdlib-float.h:

/usr/include/errno.h:

/usr/include/bits/errno.h:

/usr/include/linux/errno.h:

/usr/include/asm/errno.h:

/usr/include/asm-generic/errno.h:

/usr/include/asm-generic/errno-base.h:

+ 2
- 0
src/Makefile.am View File

@@ -1,3 +1,5 @@
bin_PROGRAMS = c2m

c2m_SOURCES = main.c
c2m_CFLAGS = $(WAND_CFLAGS)
c2m_LDADD = $(WAND_LIBS)

BIN
src/c2m View File


+ 25
- 7
src/main.c View File

@@ -1,9 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <wand/MagickWand.h>

#include "image.h"

int main(int argc, char ** argv) {
FILE * file_in = NULL, * file_out = NULL;
MagickBooleanType status;
MagickWand * magick_wand = NULL;

MagickWandGenesis();
magick_wand = NewMagickWand();

fprintf(stderr, PACKAGE_NAME " v" PACKAGE_VERSION ", written by CoiledSpring.\n\n");

@@ -13,17 +20,28 @@ int main(int argc, char ** argv) {
return 1;
}

file_in = fopen(argv[1], "r");
if(!file_in) {
fprintf(stderr, "Could not open \"%s\" read-only. Error %d.\n", argv[1], errno);
status = MagickReadImage(magick_wand, argv[1]);
if(status = MagickFalse) {
fprintf(stderr, "Could not open \"%s\" read-only.\n", argv[1]);
return 1;
}

file_out = fopen(argv[2], "w");
if(!file_out) {
fprintf(stderr, "Could not open \"%s\" write-only. Error %d.\n", argv[2], errno);
printf("Converting to monochromatic …\n");

status = MagickQuantizeImage(magick_wand, 2, GRAYColorspace, 1, MagickTrue, MagickFalse);
if(status = MagickFalse) {
fprintf(stderr, "Could not quantize the image.\n");
return 1;
}

printf("Writing the image …\n");
status = MagickWriteImage(magick_wand, argv[2]);
if(status = MagickFalse) {
fprintf(stderr, "Could not write the image.\n");
return 1;
}

printf("Convertion done.\n");

return 0;
}

Loading…
Cancel
Save