add a build target without mrg

parent d79e4966
all: coloritto-cli coloritto
coloritto-cli: *.c argvs-commands.inc *.h *.inc Makefile
ccache gcc *.c -o coloritto-cli -lm `pkg-config babl --cflags --libs` -Wall -Wno-unused-but-set-variable -g
coloritto: *.c argvs-commands.inc *.h Makefile
ccache gcc *.c -o coloritto -lm `pkg-config mrg babl --cflags --libs` -Wall -Wno-unused-but-set-variable -g
coloritto: *.c argvs-commands.inc *.h *.inc Makefile
ccache gcc *.c -o coloritto -DHAVE_MRG -lm `pkg-config mrg babl --cflags --libs` -Wall -Wno-unused-but-set-variable -g
clean:
rm -f coloritto argvs-commands.inc
rm -f coloritto coloritto-cli argvs-commands.inc
argvs-commands.inc: *.c Makefile
@echo " GEN" $@
......
......@@ -24,6 +24,7 @@
#endif
#include "argvs.h"
#ifdef HAVE_MRG
#define MRG_PRINTF 1
#ifdef MRG_PRINTF
#include <mrg.h>
......@@ -43,6 +44,7 @@ extern int use_ui;
}\
}while(0)
#endif
#endif
typedef struct _CmdIterator CmdIterator;
typedef struct _CmdEntry CmdEntry;
......
This diff is collapsed.
......@@ -40,12 +40,12 @@ static const char *config_internal =
// default configuration:
"observer_x=observer_x_1931jv\n"
"observer_y=observer_y_1931jv\n"
"observer_z=observer_z_1931jv\n"
"observer_x=observer_x_1964\n"
"observer_y=observer_y_1964\n"
"observer_z=observer_z_1964\n"
"observer_x=observer_x_1931jv\n"
"observer_y=observer_y_1931jv\n"
"observer_z=observer_z_1931jv\n"
"observer_x=observer_x_1931\n"
"observer_y=observer_y_1931\n"
"observer_z=observer_z_1931\n"
......
/* luz - MicroRaptor Gui
* Copyright (c) 2014 Øyvind Kolås <pippin@hodefoting.com>
*
* This library 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 2 of the License, or (at your option) any later version.
*
* This library 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 library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LUZ_LIST__
#define __LUZ_LIST__
#include <stdlib.h>
/* The whole luz_list implementation is in the header and will be inlined
* wherever it is used.
*/
typedef struct _LuzList LuzList;
struct _LuzList {void *data;LuzList *next;
void (*freefunc)(void *data, void *freefunc_data);
void *freefunc_data;
}
;
void luz_list_free (LuzList **list);
void luz_list_prepend_full (LuzList **list, void *data,
void (*freefunc)(void *data, void *freefunc_data),
void *freefunc_data)
{
LuzList *new_=calloc (sizeof (LuzList), 1);
new_->next=*list;
new_->data=data;
new_->freefunc=freefunc;
new_->freefunc_data = freefunc_data;
*list = new_;
}
int luz_list_length (LuzList *list)
{
int length = 0;
LuzList *l;
for (l = list; l; l = l->next, length++);
return length;
}
void luz_list_prepend (LuzList **list, void *data)
{
LuzList *new_=calloc (sizeof (LuzList), 1);
new_->next= *list;
new_->data=data;
*list = new_;
}
void
luz_list_reverse (LuzList **list)
{
LuzList *new_ = NULL;
LuzList *l;
for (l = *list; l; l=l->next)
luz_list_prepend (&new_, l->data);
luz_list_free (list);
*list = new_;
}
void luz_list_append_full (LuzList **list, void *data,
void (*freefunc)(void *data, void *freefunc_data),
void *freefunc_data)
{
LuzList *new_= calloc (sizeof (LuzList), 1);
new_->data=data;
new_->freefunc = freefunc;
new_->freefunc_data = freefunc_data;
if (*list)
{
LuzList *last;
for (last = *list; last->next; last=last->next);
last->next = new_;
return;
}
*list = new_;
return;
}
void luz_list_append (LuzList **list, void *data)
{
luz_list_append_full (list, data, NULL, NULL);
}
void luz_list_remove (LuzList **list, void *data)
{
LuzList *iter, *prev = NULL;
if ((*list)->data == data)
{
if ((*list)->freefunc)
(*list)->freefunc ((*list)->data, (*list)->freefunc_data);
prev = (void*)(*list)->next;
free (*list);
*list = prev;
return;
}
for (iter = *list; iter; iter = iter->next)
if (iter->data == data)
{
if (iter->freefunc)
iter->freefunc (iter->data, iter->freefunc_data);
prev->next = iter->next;
free (iter);
break;
}
else
prev = iter;
}
void luz_list_free (LuzList **list)
{
while (*list)
luz_list_remove (list, (*list)->data);
}
LuzList *luz_list_nth (LuzList *list, int no)
{
while(no-- && list)
list = list->next;
return list;
}
LuzList *luz_list_find (LuzList *list, void *data)
{
for (;list;list=list->next)
if (list->data == data)
break;
return list;
}
static LuzList*
luz_list_merge_sorted (LuzList* list1,
LuzList* list2,
int(*compare)(const void *a, const void *b, void *userdata), void *userdata
)
{
if (list1 == NULL)
return(list2);
else if (list2==NULL)
return(list1);
if (compare (list1->data, list2->data, userdata) >= 0)
{
list1->next = luz_list_merge_sorted (list1->next,list2, compare, userdata);
/*list1->next->prev = list1;
list1->prev = NULL;*/
return list1;
}
else
{
list2->next = luz_list_merge_sorted (list1,list2->next, compare, userdata);
/*list2->next->prev = list2;
list2->prev = NULL;*/
return list2;
}
}
static void
luz_list_split_half (LuzList* head,
LuzList** list1,
LuzList** list2)
{
LuzList* fast;
LuzList* slow;
if (head==NULL || head->next==NULL)
{
*list1 = head;
*list2 = NULL;
}
else
{
slow = head;
fast = head->next;
while (fast != NULL)
{
fast = fast->next;
if (fast != NULL)
{
slow = slow->next;
fast = fast->next;
}
}
*list1 = head;
*list2 = slow->next;
slow->next = NULL;
}
}
void luz_list_sort (LuzList **head,
int(*compare)(const void *a, const void *b, void *userdata),
void *userdata)
{
LuzList* list1;
LuzList* list2;
/* Base case -- length 0 or 1 */
if ((*head == NULL) || ((*head)->next == NULL))
{
return;
}
luz_list_split_half (*head, &list1, &list2);
luz_list_sort (&list1, compare, userdata);
luz_list_sort (&list2, compare, userdata);
*head = luz_list_merge_sorted (list1, list2, compare, userdata);
}
void
luz_list_insert_sorted (LuzList **list, void *data,
int(*compare)(const void *a, const void *b, void *userdata),
void *userdata)
{
luz_list_prepend (list, data);
luz_list_sort (list, compare, userdata);
}
static inline void *luz_list_last (LuzList *list)
{
if (list)
{
LuzList *last;
for (last = list; last->next; last=last->next);
return last->data;
}
return NULL;
}
#endif
/* luz - MicroRaptor Gui
* Copyright (c) 2014 Øyvind Kolås <pippin@hodefoting.com>
*
* This library 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 2 of the License, or (at your option) any later version.
*
* This library 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 library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LUZ_LIST__
#define __LUZ_LIST__
#include <stdlib.h>
/* The whole luz_list implementation is in the header and will be inlined
* wherever it is used.
*/
typedef struct _LuzList LuzList;
struct _LuzList {void *data;LuzList *next;
void (*freefunc)(void *data, void *freefunc_data);
void *freefunc_data;
}
;
static inline void luz_list_prepend_full (LuzList **list, void *data,
void (*freefunc)(void *data, void *freefunc_data),
void *freefunc_data)
{
LuzList *new_=calloc (sizeof (LuzList), 1);
new_->next=*list;
new_->data=data;
new_->freefunc=freefunc;
new_->freefunc_data = freefunc_data;
*list = new_;
}
static inline int luz_list_length (LuzList *list)
{
int length = 0;
LuzList *l;
for (l = list; l; l = l->next, length++);
return length;
}
static inline void luz_list_prepend (LuzList **list, void *data)
{
LuzList *new_=calloc (sizeof (LuzList), 1);
new_->next= *list;
new_->data=data;
*list = new_;
}
static inline void *luz_list_last (LuzList *list)
{
if (list)
{
LuzList *last;
for (last = list; last->next; last=last->next);
return last->data;
}
return NULL;
}
static inline void luz_list_append_full (LuzList **list, void *data,
void (*freefunc)(void *data, void *freefunc_data),
void *freefunc_data)
{
LuzList *new_= calloc (sizeof (LuzList), 1);
new_->data=data;
new_->freefunc = freefunc;
new_->freefunc_data = freefunc_data;
if (*list)
{
LuzList *last;
for (last = *list; last->next; last=last->next);
last->next = new_;
return;
}
*list = new_;
return;
}
static inline void luz_list_append (LuzList **list, void *data)
{
luz_list_append_full (list, data, NULL, NULL);
}
static inline void luz_list_remove (LuzList **list, void *data)
{
LuzList *iter, *prev = NULL;
if ((*list)->data == data)
{
if ((*list)->freefunc)
(*list)->freefunc ((*list)->data, (*list)->freefunc_data);
prev = (void*)(*list)->next;
free (*list);
*list = prev;
return;
}
for (iter = *list; iter; iter = iter->next)
if (iter->data == data)
{
if (iter->freefunc)
iter->freefunc (iter->data, iter->freefunc_data);
prev->next = iter->next;
free (iter);
break;
}
else
prev = iter;
}
static inline void luz_list_free (LuzList **list)
{
while (*list)
luz_list_remove (list, (*list)->data);
}
static inline LuzList *luz_list_nth (LuzList *list, int no)
{
while(no-- && list)
list = list->next;
return list;
}
static inline LuzList *luz_list_find (LuzList *list, void *data)
{
for (;list;list=list->next)
if (list->data == data)
break;
return list;
}
void luz_list_sort (LuzList **list,
int(*compare)(const void *a, const void *b, void *userdata),
void *userdata);
static inline void
luz_list_insert_before (LuzList **list, LuzList *sibling,
void *data)
{
if (*list == NULL || *list == sibling)
{
luz_list_prepend (list, data);
}
else
{
LuzList *prev = NULL;
for (LuzList *l = *list; l; l=l->next)
{
if (l == sibling)
break;
prev = l;
}
if (prev) {
LuzList *new_=calloc(sizeof (LuzList), 1);
new_->next = sibling;
new_->data = data;
prev->next=new_;
}
}
}
static inline void
luz_list_insert_sorted (LuzList **list, void *data,
int(*compare)(const void *a, const void *b, void *userdata),
void *userdata)
{
luz_list_prepend (list, data);
luz_list_sort (list, compare, userdata);
}
static inline void
luz_list_reverse (LuzList **list)
{
LuzList *new_ = NULL;
LuzList *l;
for (l = *list; l; l=l->next)
luz_list_prepend (&new_, l->data);
luz_list_free (list);
*list = new_;
}
#endif
......@@ -779,11 +779,11 @@ luz_parse_spectrum (Luz *luz, char *spectrum)
}
else if (nm_gap < LUZ_SPECTRUM_GAP)
{
strategy = STRATEGY_TENT;
strategy = STRATEGY_LINEAR;
}
else if (nm_gap > LUZ_SPECTRUM_GAP)
{
strategy = STRATEGY_LINEAR;
strategy = STRATEGY_TENT;
}
switch (strategy)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment