Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gnumeric
Commits
5908feed
Commit
5908feed
authored
Aug 04, 1998
by
Arturo Espinosa
Browse files
The actual sin
parent
ba9e130e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/dependent.c
0 → 100644
View file @
5908feed
/*
* eval.c: Cell recomputation routines.
* (C) 1998 The Free Software Foundation
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
* Recomputations:
update_cell (cell)
{
cells_referenced = eval_expression (cell->formula);
if (cells_referenced){
push_refs (cells_referenced);
return;
}
cell->cycle = current_cycle;
return eval (cell);
}
push_refs (list)
{
foreach i in (list){
cell = findcell (i);
if (cell->cell_cycle = current_cycle)
loop;
else
push_cell(cell);
}
}
int
eval_next_cell()
{
cell = pop_cell (cell);
if (cell){
if (cell->cell_cycle == current_cycle)
--loop_counter;
else
loop_counter = 40;
update_cell (cell);
return loop_counter;
} else
return 0;
}
*/
#include
<config.h>
#include
<gnome.h>
#include
"gnumeric.h"
#include
"gnumeric-sheet.h"
#include
"utils.h"
void
sheet_compute_cell
(
Sheet
*
sheet
,
Cell
*
cell
)
{
char
*
error_msg
;
Value
*
v
;
if
(
cell
->
text
)
string_unref_ptr
(
&
cell
->
text
);
v
=
eval_expr
(
sheet
,
cell
->
parsed_node
,
cell
->
col
->
pos
,
cell
->
row
->
pos
,
&
error_msg
);
if
(
cell
->
value
)
value_release
(
cell
->
value
);
if
(
v
==
NULL
){
cell
->
text
=
string_get
(
error_msg
);
cell
->
value
=
NULL
;
}
else
{
/* FIXME: Use the format stuff */
char
*
str
=
value_string
(
v
);
cell
->
value
=
v
;
cell
->
text
=
string_get
(
str
);
g_free
(
str
);
}
}
static
void
sheet_recompute_one_cell
(
Sheet
*
sheet
,
int
col
,
int
row
,
Cell
*
cell
)
{
if
(
cell
->
parsed_node
==
NULL
)
return
;
printf
(
"recomputing %d %d
\n
"
,
col
,
row
);
sheet_compute_cell
(
sheet
,
cell
);
sheet_redraw_cell_region
(
sheet
,
cell
->
col
->
pos
,
cell
->
row
->
pos
,
cell
->
col
->
pos
,
cell
->
row
->
pos
);
}
src/eval.c
0 → 100644
View file @
5908feed
/*
* eval.c: Cell recomputation routines.
* (C) 1998 The Free Software Foundation
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
* Recomputations:
update_cell (cell)
{
cells_referenced = eval_expression (cell->formula);
if (cells_referenced){
push_refs (cells_referenced);
return;
}
cell->cycle = current_cycle;
return eval (cell);
}
push_refs (list)
{
foreach i in (list){
cell = findcell (i);
if (cell->cell_cycle = current_cycle)
loop;
else
push_cell(cell);
}
}
int
eval_next_cell()
{
cell = pop_cell (cell);
if (cell){
if (cell->cell_cycle == current_cycle)
--loop_counter;
else
loop_counter = 40;
update_cell (cell);
return loop_counter;
} else
return 0;
}
*/
#include
<config.h>
#include
<gnome.h>
#include
"gnumeric.h"
#include
"gnumeric-sheet.h"
#include
"utils.h"
void
sheet_compute_cell
(
Sheet
*
sheet
,
Cell
*
cell
)
{
char
*
error_msg
;
Value
*
v
;
if
(
cell
->
text
)
string_unref_ptr
(
&
cell
->
text
);
v
=
eval_expr
(
sheet
,
cell
->
parsed_node
,
cell
->
col
->
pos
,
cell
->
row
->
pos
,
&
error_msg
);
if
(
cell
->
value
)
value_release
(
cell
->
value
);
if
(
v
==
NULL
){
cell
->
text
=
string_get
(
error_msg
);
cell
->
value
=
NULL
;
}
else
{
/* FIXME: Use the format stuff */
char
*
str
=
value_string
(
v
);
cell
->
value
=
v
;
cell
->
text
=
string_get
(
str
);
g_free
(
str
);
}
}
static
void
sheet_recompute_one_cell
(
Sheet
*
sheet
,
int
col
,
int
row
,
Cell
*
cell
)
{
if
(
cell
->
parsed_node
==
NULL
)
return
;
printf
(
"recomputing %d %d
\n
"
,
col
,
row
);
sheet_compute_cell
(
sheet
,
cell
);
sheet_redraw_cell_region
(
sheet
,
cell
->
col
->
pos
,
cell
->
row
->
pos
,
cell
->
col
->
pos
,
cell
->
row
->
pos
);
}
src/func.c
0 → 100644
View file @
5908feed
/*
* func.c: Built in functions
* (C) 1998 The Free Software Foundation
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
*
*/
#include
<config.h>
#include
<gnome.h>
#include
"gnumeric.h"
#include
"gnumeric-sheet.h"
#include
"utils.h"
static
void
gnumeric_sin
(
void
)
{
printf
(
"Sinning
\n
"
);
}
static
struct
{
char
*
name
;
void
(
*
fn
)(
void
);
}
internal_functions
[]
=
{
{
"sin"
,
gnumeric_sin
},
{
NULL
,
NULL
},
};
void
functions_init
(
void
)
{
int
i
;
for
(
i
=
0
;
internal_functions
[
i
].
name
;
i
++
){
symbol_install
(
internal_functions
[
i
].
name
,
SYMBOL_FUNCTION
,
internal_functions
[
i
].
fn
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment