From 7f607660a91b969daa19dbdb62628691bfee8f7e Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Wed, 02 Mar 2016 16:12:06 +0000 Subject: [PATCH] Added modeline string into every c and h file --- src/constvol.c | 1 src/snapshot.c | 50 +++++++++++-------------- src/vertexmove.h | 1 src/io.c | 1 src/stats.c | 1 src/vesicle.h | 1 src/stats.h | 1 src/vesicle.c | 1 src/constvol.h | 1 src/initial_distribution.c | 1 src/general.h | 1 src/general.c | 1 src/vertexmove.c | 1 src/io.h | 1 src/snapshot.h | 1 src/timestep.c | 1 src/bond.h | 1 src/shcomplex.c | 1 src/timestep.h | 1 src/bond.c | 1 src/triangle.h | 1 src/shcomplex.h | 1 src/triangle.c | 1 src/bondflip.h | 1 src/cell.c | 1 src/main.c | 4 ++ src/bondflip.c | 1 src/cell.h | 1 src/spherical_trisurf_ff.c | 1 src/co_test.c | 1 src/poly.h | 1 src/frame.h | 1 src/dumpstate.c | 1 src/shdiscover.c | 1 src/poly.c | 1 src/vertex.c | 1 src/initial_distribution.h | 1 src/sh.h | 1 src/spherical_trisurf.c | 1 src/energy.c | 1 src/restore.h | 1 src/dumpstate.h | 1 src/frame.c | 1 src/restore.c | 1 src/sh.c | 1 src/energy.h | 1 src/vertex.h | 1 47 files changed, 71 insertions(+), 28 deletions(-) diff --git a/src/bond.c b/src/bond.c index ce255ca..21b7b56 100644 --- a/src/bond.c +++ b/src/bond.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include "general.h" #include "vertex.h" diff --git a/src/bond.h b/src/bond.h index 34cdba5..d231342 100644 --- a/src/bond.h +++ b/src/bond.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _BOND_H #define _BOND_H diff --git a/src/bondflip.c b/src/bondflip.c index bb6bd33..858dc74 100644 --- a/src/bondflip.c +++ b/src/bondflip.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include<math.h> #include "general.h" diff --git a/src/bondflip.h b/src/bondflip.h index 947555f..e3bb19d 100644 --- a/src/bondflip.h +++ b/src/bondflip.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_BONDFLIP #define _H_BONDFLIP diff --git a/src/cell.c b/src/cell.c index ed86b16..a1413eb 100644 --- a/src/cell.c +++ b/src/cell.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include "general.h" #include "vertex.h" diff --git a/src/cell.h b/src/cell.h index 20a58e4..1623846 100644 --- a/src/cell.h +++ b/src/cell.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_CELL #define _H_CELL ts_cell_list *init_cell_list(ts_uint ncmax1, ts_uint ncmax2, ts_uint ncmax3, ts_double stepsize); diff --git a/src/co_test.c b/src/co_test.c index 61a6a3a..0a5e23e 100644 --- a/src/co_test.c +++ b/src/co_test.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include "general.h" #include "sh.h" #include <stdlib.h> diff --git a/src/constvol.c b/src/constvol.c index 2a1d40d..63c07e0 100644 --- a/src/constvol.c +++ b/src/constvol.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include<stdio.h> #include<string.h> diff --git a/src/constvol.h b/src/constvol.h index 5d1eb71..341c587 100644 --- a/src/constvol.h +++ b/src/constvol.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_CONSTVOL #define _H_CONSTVOL diff --git a/src/dumpstate.c b/src/dumpstate.c index 9d1e2b2..4493f71 100644 --- a/src/dumpstate.c +++ b/src/dumpstate.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include <string.h> #include "general.h" #include <stdio.h> diff --git a/src/dumpstate.h b/src/dumpstate.h index a4ded6f..de66b70 100644 --- a/src/dumpstate.h +++ b/src/dumpstate.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_DUMPSTATE #define _H_DUMPSTATE diff --git a/src/energy.c b/src/energy.c index 3173f67..4f2b386 100644 --- a/src/energy.c +++ b/src/energy.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include "general.h" #include "energy.h" diff --git a/src/energy.h b/src/energy.h index 8a37b85..e463815 100644 --- a/src/energy.h +++ b/src/energy.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _ENERGY_H #define _ENERGY_H ts_bool mean_curvature_and_energy(ts_vesicle *vesicle); diff --git a/src/frame.c b/src/frame.c index ec94292..b29d3e3 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include "general.h" #include "cell.h" diff --git a/src/frame.h b/src/frame.h index b0e451c..fbd0a78 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_FRAME #define _H_FRAME ts_bool centermass(ts_vesicle *vesicle); diff --git a/src/general.c b/src/general.c index a600800..1ada40d 100644 --- a/src/general.c +++ b/src/general.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdio.h> #include<stdlib.h> #include "general.h" diff --git a/src/general.h b/src/general.h index 393eafe..24c5f89 100644 --- a/src/general.h +++ b/src/general.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _GENERAL_H #define _GENERAL_H diff --git a/src/initial_distribution.c b/src/initial_distribution.c index 3af821d..7dfd23d 100644 --- a/src/initial_distribution.c +++ b/src/initial_distribution.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include<math.h> #include<stdio.h> diff --git a/src/initial_distribution.h b/src/initial_distribution.h index 39815d9..c5184a6 100644 --- a/src/initial_distribution.h +++ b/src/initial_distribution.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include "io.h" diff --git a/src/io.c b/src/io.c index 8e97a8f..51ef836 100644 --- a/src/io.c +++ b/src/io.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include "general.h" #include<stdio.h> #include "io.h" diff --git a/src/io.h b/src/io.h index 6c1e18a..11555f3 100644 --- a/src/io.h +++ b/src/io.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _IO_H #define _IO_H #include <confuse.h> diff --git a/src/main.c b/src/main.c index 8cd8321..8cf3e92 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdio.h> #include<math.h> #include<stdlib.h> @@ -28,6 +29,9 @@ ts_uint start_iteration=0; force_from_tape=0; parse_args(argv,argc); // sets global variable command_line_args (defined in io.h) + ts_fprintf(stdout,"TRISURF-NG v. %s, compiled on: %s %s.\n", TS_VERSION, __DATE__, __TIME__); + ts_fprintf(stdout,"Programming done by: Samo Penic and Miha Fosnaric\n"); + ts_fprintf(stdout,"Released under terms of GPLv3\n"); ts_fprintf(stdout,"Starting program...\n\n"); // vesicle = parseDump("timestep_000000.vtu"); // run_simulation(vesicle, vesicle->tape->mcsweeps, vesicle->tape->inititer, vesicle->tape->iterations, 1); diff --git a/src/poly.c b/src/poly.c index 6af59e9..3c93d0c 100644 --- a/src/poly.c +++ b/src/poly.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include"general.h" #include"poly.h" #include<stdlib.h> diff --git a/src/poly.h b/src/poly.h index 2b37c92..33f3be8 100644 --- a/src/poly.h +++ b/src/poly.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _POLY_H #define _POLY_H #include"io.h" diff --git a/src/restore.c b/src/restore.c index 2cc83bb..b526bd5 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/src/restore.h b/src/restore.h index 84c8747..821f5a2 100644 --- a/src/restore.h +++ b/src/restore.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_RESTORE #define _H_RESTORE diff --git a/src/sh.c b/src/sh.c index 9cb623e..3f64939 100644 --- a/src/sh.c +++ b/src/sh.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<math.h> #include<stdlib.h> #include "general.h" diff --git a/src/sh.h b/src/sh.h index dabece2..ae5cd3e 100644 --- a/src/sh.h +++ b/src/sh.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_SH #define _H_SH #include "general.h" diff --git a/src/shcomplex.c b/src/shcomplex.c index 7d8c9d8..5dc6a97 100644 --- a/src/shcomplex.c +++ b/src/shcomplex.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<math.h> #include<stdlib.h> #include<gsl/gsl_complex.h> diff --git a/src/shcomplex.h b/src/shcomplex.h index fdd0eb0..63c6af5 100644 --- a/src/shcomplex.h +++ b/src/shcomplex.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_SH_COMPLEX #define _H_SH_COMPLEX #include "general.h" diff --git a/src/shdiscover.c b/src/shdiscover.c index 008d522..cf155ac 100644 --- a/src/shdiscover.c +++ b/src/shdiscover.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include "general.h" #include "vertex.h" #include "initial_distribution.h" diff --git a/src/snapshot.c b/src/snapshot.c index 9dc23a9..370ce4c 100644 --- a/src/snapshot.c +++ b/src/snapshot.c @@ -1,3 +1,5 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdio.h> #include<general.h> #include<snapshot.h> @@ -169,10 +171,7 @@ static int mod_table[] = {0, 2, 1}; -char *base64_encode(const unsigned char *data, - size_t input_length, - size_t *output_length) { - +char *base64_encode(const unsigned char *data, size_t input_length, size_t *output_length) { *output_length = 4 * ((input_length + 2) / 3); int i,j; char *encoded_data = malloc(*output_length); @@ -180,29 +179,25 @@ for (i = 0, j = 0; i < input_length;) { - uint32_t octet_a = i < input_length ? (unsigned char)data[i++] : 0; - uint32_t octet_b = i < input_length ? (unsigned char)data[i++] : 0; - uint32_t octet_c = i < input_length ? (unsigned char)data[i++] : 0; + uint32_t octet_a = i < input_length ? (unsigned char)data[i++] : 0; + uint32_t octet_b = i < input_length ? (unsigned char)data[i++] : 0; + uint32_t octet_c = i < input_length ? (unsigned char)data[i++] : 0; + uint32_t triple = (octet_a << 0x10) + (octet_b << 0x08) + octet_c; - uint32_t triple = (octet_a << 0x10) + (octet_b << 0x08) + octet_c; - - encoded_data[j++] = encoding_table[(triple >> 3 * 6) & 0x3F]; - encoded_data[j++] = encoding_table[(triple >> 2 * 6) & 0x3F]; - encoded_data[j++] = encoding_table[(triple >> 1 * 6) & 0x3F]; - encoded_data[j++] = encoding_table[(triple >> 0 * 6) & 0x3F]; + encoded_data[j++] = encoding_table[(triple >> 3 * 6) & 0x3F]; + encoded_data[j++] = encoding_table[(triple >> 2 * 6) & 0x3F]; + encoded_data[j++] = encoding_table[(triple >> 1 * 6) & 0x3F]; + encoded_data[j++] = encoding_table[(triple >> 0 * 6) & 0x3F]; } for (i = 0; i < mod_table[input_length % 3]; i++) - encoded_data[*output_length - 1 - i] = '='; + encoded_data[*output_length - 1 - i] = '='; return encoded_data; } -unsigned char *base64_decode(const char *data, - size_t input_length, - size_t *output_length) { - +unsigned char *base64_decode(const char *data, size_t input_length, size_t *output_length) { int i,j; if (decoding_table == NULL) build_decoding_table(); @@ -216,20 +211,19 @@ if (decoded_data == NULL) return NULL; for (i = 0, j = 0; i < input_length;) { + uint32_t sextet_a = data[i] == '=' ? 0 & i++ : decoding_table[(int)data[i++]]; + uint32_t sextet_b = data[i] == '=' ? 0 & i++ : decoding_table[(int)data[i++]]; + uint32_t sextet_c = data[i] == '=' ? 0 & i++ : decoding_table[(int)data[i++]]; + uint32_t sextet_d = data[i] == '=' ? 0 & i++ : decoding_table[(int)data[i++]]; - uint32_t sextet_a = data[i] == '=' ? 0 & i++ : decoding_table[(int)data[i++]]; - uint32_t sextet_b = data[i] == '=' ? 0 & i++ : decoding_table[(int)data[i++]]; - uint32_t sextet_c = data[i] == '=' ? 0 & i++ : decoding_table[(int)data[i++]]; - uint32_t sextet_d = data[i] == '=' ? 0 & i++ : decoding_table[(int)data[i++]]; - - uint32_t triple = (sextet_a << 3 * 6) + uint32_t triple = (sextet_a << 3 * 6) + (sextet_b << 2 * 6) + (sextet_c << 1 * 6) + (sextet_d << 0 * 6); - if (j < *output_length) decoded_data[j++] = (triple >> 2 * 8) & 0xFF; - if (j < *output_length) decoded_data[j++] = (triple >> 1 * 8) & 0xFF; - if (j < *output_length) decoded_data[j++] = (triple >> 0 * 8) & 0xFF; + if (j < *output_length) decoded_data[j++] = (triple >> 2 * 8) & 0xFF; + if (j < *output_length) decoded_data[j++] = (triple >> 1 * 8) & 0xFF; + if (j < *output_length) decoded_data[j++] = (triple >> 0 * 8) & 0xFF; } if(decoding_table !=NULL) free(decoding_table); return decoded_data; @@ -241,7 +235,7 @@ decoding_table = malloc(256); int i; for (i = 0; i < 64; i++) - decoding_table[(unsigned char) encoding_table[i]] = i; + decoding_table[(unsigned char) encoding_table[i]] = i; } diff --git a/src/snapshot.h b/src/snapshot.h index c6d7186..e4642e9 100644 --- a/src/snapshot.h +++ b/src/snapshot.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_SNAPSHOT #define _H_SNAPSHOT diff --git a/src/spherical_trisurf.c b/src/spherical_trisurf.c index 0669981..06a84f4 100644 --- a/src/spherical_trisurf.c +++ b/src/spherical_trisurf.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdio.h> #include<math.h> #include "general.h" diff --git a/src/spherical_trisurf_ff.c b/src/spherical_trisurf_ff.c index 157b0e4..8a0902f 100644 --- a/src/spherical_trisurf_ff.c +++ b/src/spherical_trisurf_ff.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdio.h> #include<math.h> #include "general.h" diff --git a/src/stats.c b/src/stats.c index 077781e..b63fecc 100644 --- a/src/stats.c +++ b/src/stats.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include <stdio.h> #include <time.h> //#include <gsl/gsl_math.h> diff --git a/src/stats.h b/src/stats.h index 223a99b..10ee13a 100644 --- a/src/stats.h +++ b/src/stats.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _H_STATS #define _H_STATS void gyration_eigen(ts_vesicle *vesicle, ts_double *l1, ts_double *l2, ts_double *l3); diff --git a/src/timestep.c b/src/timestep.c index 59ff8c6..9f30dda 100644 --- a/src/timestep.c +++ b/src/timestep.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include<stdio.h> #include<math.h> diff --git a/src/timestep.h b/src/timestep.h index 0d8dc74..21cb7bb 100644 --- a/src/timestep.h +++ b/src/timestep.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _TIMESTEP_H #define _TIMESTEP_H ts_bool single_timestep(ts_vesicle *vesicle, ts_double *vmsr, ts_double *bfsr); diff --git a/src/triangle.c b/src/triangle.c index 7dd5a6e..da9d7a8 100644 --- a/src/triangle.c +++ b/src/triangle.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include<stdio.h> #include "general.h" diff --git a/src/triangle.h b/src/triangle.h index a1a0fd0..dd5280e 100644 --- a/src/triangle.h +++ b/src/triangle.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _TRIANGLE_H #define _TRIANGLE_H diff --git a/src/vertex.c b/src/vertex.c index 3ae9fd1..59a6419 100644 --- a/src/vertex.c +++ b/src/vertex.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include<math.h> #include<string.h> diff --git a/src/vertex.h b/src/vertex.h index cca12ee..0eb8dd3 100644 --- a/src/vertex.h +++ b/src/vertex.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _VERTEX_H #define _VERTEX_H diff --git a/src/vertexmove.c b/src/vertexmove.c index c552a87..b065cbb 100644 --- a/src/vertexmove.c +++ b/src/vertexmove.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<stdlib.h> #include<math.h> #include "general.h" diff --git a/src/vertexmove.h b/src/vertexmove.h index c58ee64..e6a8f3c 100644 --- a/src/vertexmove.h +++ b/src/vertexmove.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ ts_bool single_verticle_timestep(ts_vesicle *vesicle,ts_vertex *vtx,ts_double *rn); diff --git a/src/vesicle.c b/src/vesicle.c index 5fc51cc..4d9e5cd 100644 --- a/src/vesicle.c +++ b/src/vesicle.c @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #include<general.h> #include "vesicle.h" #include "vertex.h" diff --git a/src/vesicle.h b/src/vesicle.h index 50a9e3e..e8f09fb 100644 --- a/src/vesicle.h +++ b/src/vesicle.h @@ -1,3 +1,4 @@ +/* vim: set ts=4 sts=4 sw=4 noet : */ #ifndef _VESICLE_H #define _VESICLE_H -- Gitblit v1.9.3