Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/rinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ SEXP R_igraph_vcount(SEXP graph) {
/* Convert input */
R_SEXP_to_igraph(graph, &c_graph);
/* Call igraph */
c_result= igraph_vcount(&c_graph);
c_result=igraph_vcount(&c_graph);

/* Convert output */

Expand Down Expand Up @@ -2337,7 +2337,7 @@ SEXP R_igraph_centralization(SEXP scores, SEXP theoretical_max, SEXP normalized)
c_theoretical_max=REAL(theoretical_max)[0];
c_normalized=LOGICAL(normalized)[0];
/* Call igraph */
c_result= igraph_centralization(&c_scores, c_theoretical_max, c_normalized);
c_result=igraph_centralization(&c_scores, c_theoretical_max, c_normalized);

/* Convert output */

Expand Down
3 changes: 3 additions & 0 deletions tools/stimulus/rinterface.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

#include "config.h"

// Require R_ and Rf_ prefixes for R API
#define R_NO_REMAP

#include <R.h>
#include <Rinternals.h>
#include <Rdefines.h>
Expand Down
78 changes: 39 additions & 39 deletions tools/stimulus/types-RC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ GRAPH:
IGRAPH_FINALLY_CLEAN(1);

GRAPH_OR_0:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_igraph(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_igraph(%I%, &%C%); }
INOUT: |-
if (!isNull(%I%)) { R_SEXP_to_igraph_copy(%I%, &%C%);
if (!Rf_isNull(%I%)) { R_SEXP_to_igraph_copy(%I%, &%C%);
IGRAPH_FINALLY(igraph_destroy, &%C%); }
OUT: '%I%=R_GlobalEnv; /* hack to have a non-NULL value */'
OUTCONV:
INOUT: |-
if (!isNull(%I%)) { PROTECT(%I%=R_igraph_to_SEXP(&%C%));
if (!Rf_isNull(%I%)) { PROTECT(%I%=R_igraph_to_SEXP(&%C%));
igraph_destroy(&%C%);
IGRAPH_FINALLY_CLEAN(1); }
OUT: |-
Expand Down Expand Up @@ -251,7 +251,7 @@ VERTEXSETLIST:
CALL: '&%C%'
CTYPE: igraph_vector_ptr_t
INCONV:
IN: if (!isNull(%I%)) { R_igraph_SEXP_to_vectorlist(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_igraph_SEXP_to_vectorlist(%I%, &%C%); }
OUT: |-
if (0 != igraph_vector_ptr_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand All @@ -267,7 +267,7 @@ VERTEXSETLIST_INT:
CALL: '&%C%'
CTYPE: igraph_vector_ptr_t
INCONV:
IN: if (!isNull(%I%)) { R_igraph_SEXP_to_vectorlist_int(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_igraph_SEXP_to_vectorlist_int(%I%, &%C%); }

EDGESETLIST:
CALL: '&%C%'
Expand All @@ -294,12 +294,12 @@ ADJLIST:
}

VECTOR_OR_0:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_vector_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
INOUT: |-
if (!isNull(%I%)) {
if (!Rf_isNull(%I%)) {
if (0 != R_SEXP_to_vector_copy(%I%, &%C%)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
Expand All @@ -323,12 +323,12 @@ VECTOR_OR_0:
IGRAPH_FINALLY_CLEAN(1);

VECTORM1_OR_0:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_vector_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
INOUT: |-
if (!isNull(%I%)) {
if (!Rf_isNull(%I%)) {
if (0 != R_SEXP_to_vector_copy(%I%, &%C%)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
Expand All @@ -352,10 +352,10 @@ VECTORM1_OR_0:
IGRAPH_FINALLY_CLEAN(1);

EDGEWEIGHTS:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_vector_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
OUT: |-
if (0 != igraph_vector_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand All @@ -369,10 +369,10 @@ EDGEWEIGHTS:
IGRAPH_FINALLY_CLEAN(1);

VERTEXWEIGHTS:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_vector_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
OUT: |-
if (0 != igraph_vector_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand All @@ -386,10 +386,10 @@ VERTEXWEIGHTS:
IGRAPH_FINALLY_CLEAN(1);

EDGECAPACITY:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_vector_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector(%I%, &%C%); }
OUT: |-
if (0 != igraph_vector_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand All @@ -403,10 +403,10 @@ EDGECAPACITY:
IGRAPH_FINALLY_CLEAN(1);

VECTOR_BOOL_OR_0:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_vector_bool_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector_bool(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector_bool(%I%, &%C%); }
OUT: |-
if (0 != igraph_vector_bool_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand Down Expand Up @@ -441,12 +441,12 @@ MATRIX:
IGRAPH_FINALLY_CLEAN(1);

MATRIX_OR_0:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_matrix_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_matrix(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_matrix(%I%, &%C%); }
INOUT: |-
if (!isNull(%I%)) {
if (!Rf_isNull(%I%)) {
if (0 != R_SEXP_to_igraph_matrix_copy(%I%, &%C%)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
Expand Down Expand Up @@ -486,10 +486,10 @@ ARRAY3:
IGRAPH_FINALLY_CLEAN(1);

ARRAY3_OR_0:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_array3_t
INCONV:
IN: if (!isNull(%I%)) { R_igraph_SEXP_to_array3(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_igraph_SEXP_to_array3(%I%, &%C%); }
OUT: |-
if (0 != igraph_array3_init(&%C%, 0, 0, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand Down Expand Up @@ -635,11 +635,11 @@ STRVECTOR:

BIPARTITE_TYPES:
CALL:
IN: '(isNull(%I%) ? 0 : &%C%)'
IN: '(Rf_isNull(%I%) ? 0 : &%C%)'
OUT: '&%C%'
CTYPE: igraph_vector_bool_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector_bool(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector_bool(%I%, &%C%); }
OUT: |-
if (0 != igraph_vector_bool_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand All @@ -653,11 +653,11 @@ BIPARTITE_TYPES:

VERTEX_COLOR:
CALL:
IN: '(isNull(%I%) ? 0 : &%C%)'
IN: '(Rf_isNull(%I%) ? 0 : &%C%)'
OUT: '&%C%'
CTYPE: igraph_vector_int_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector_int(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector_int(%I%, &%C%); }
OUT: |-
if (0 != igraph_vector_int_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand All @@ -671,11 +671,11 @@ VERTEX_COLOR:

EDGE_COLOR:
CALL:
IN: '(isNull(%I%) ? 0 : &%C%)'
IN: '(Rf_isNull(%I%) ? 0 : &%C%)'
OUT: '&%C%'
CTYPE: igraph_vector_int_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector_int(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector_int(%I%, &%C%); }
OUT: |-
if (0 != igraph_vector_int_init(&%C%, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand Down Expand Up @@ -768,10 +768,10 @@ SPARSEMATPTR:
igraph_sparsemat_destroy(&%C%);

SPARSEMAT_OR_0:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_sparsemat_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_sparsemat(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_sparsemat(%I%, &%C%); }
OUT: |-
if (0 != igraph_sparsemat_init(&%C%, 0, 0, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand All @@ -785,12 +785,12 @@ SPARSEMAT_OR_0:
IGRAPH_FINALLY_CLEAN(1);

VECTOR_COMPLEX:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_vector_complex_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_vector_complex(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_vector_complex(%I%, &%C%); }
INOUT: |-
if (!isNull(%I%)) {
if (!Rf_isNull(%I%)) {
if (0 != R_SEXP_to_vector_complex_copy(%I%, &%C%)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
Expand All @@ -814,12 +814,12 @@ VECTOR_COMPLEX:
IGRAPH_FINALLY_CLEAN(1);

MATRIX_COMPLEX:
CALL: '(isNull(%I%) ? 0 : &%C%)'
CALL: '(Rf_isNull(%I%) ? 0 : &%C%)'
CTYPE: igraph_matrix_complex_t
INCONV:
IN: if (!isNull(%I%)) { R_SEXP_to_matrix_complex(%I%, &%C%); }
IN: if (!Rf_isNull(%I%)) { R_SEXP_to_matrix_complex(%I%, &%C%); }
INOUT: |-
if (!isNull(%I%)) {
if (!Rf_isNull(%I%)) {
if (0 != R_SEXP_to_matrix_complex_copy(%I%, &%C%)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
}
Expand Down