summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Edward Pax <charles.pax@gmail.com>2017-07-29 16:32:04 -0400
committerCharles Edward Pax <charles.pax@gmail.com>2017-07-29 16:32:04 -0400
commitc480044514b8d4bc6d6b523361e33900274c161c (patch)
tree606e8f9b11dc127472595c0b0251d0979b33e84a
parenta2fbd1b04efd61c61b964b69fd007e19ddd7930e (diff)
Doxygen comments in shift.c.
-rw-r--r--src/shift.c114
1 files changed, 106 insertions, 8 deletions
diff --git a/src/shift.c b/src/shift.c
index 5ee6925..a27667c 100644
--- a/src/shift.c
+++ b/src/shift.c
@@ -1,3 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2013-2017, Andrés Martinelli <andmarti@gmail.com *
+ * All rights reserved. *
+ * *
+ * This file is a part of SC-IM *
+ * *
+ * SC-IM is a spreadsheet program that is based on SC. The original authors *
+ * of SC are James Gosling and Mark Weiser, and mods were later added by *
+ * Chuck Martin. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions are met: *
+ * 1. Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * 2. Redistributions in binary form must reproduce the above copyright *
+ * notice, this list of conditions and the following disclaimer in the *
+ * documentation and/or other materials provided with the distribution. *
+ * 3. All advertising materials mentioning features or use of this software *
+ * must display the following acknowledgement: *
+ * This product includes software developed by Andrés Martinelli *
+ * <andmarti@gmail.com>. *
+ * 4. Neither the name of the Andrés Martinelli nor the *
+ * names of other contributors may be used to endorse or promote products *
+ * derived from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY ANDRES MARTINELLI ''AS IS'' AND ANY *
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
+ * DISCLAIMED. IN NO EVENT SHALL ANDRES MARTINELLI BE LIABLE FOR ANY *
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;*
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ *******************************************************************************/
+
+/**
+ * \file shift.c
+ * \author Andrés Martinelli <andmarti@gmail.com>
+ * \date 2017-07-18
+ * \brief TODO Write a tbrief file description.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include "shift.h"
@@ -14,10 +58,20 @@
extern graphADT graph;
extern int cmd_multiplier;
-/*
- * shift function - handles undo
- * should also be called from GRAM.Y
+/**
+ * @brief Shift function - handles undo
+ *
+ * Shift functin - handles unto. Should also be called form gram.y.
+ *
+ * \param[in] r
+ * \param[in] c
+ * \param[in] rf
+ * \param[in] cf
+ * \param[in] type
+ *
+ * \return none
*/
+
void shift(int r, int c, int rf, int cf, wchar_t type) {
if ( any_locked_cells(r, c, rf, cf) && (type == L'h' || type == L'k') ) {
sc_error("Locked cells encountered. Nothing changed");
@@ -107,7 +161,19 @@ void shift(int r, int c, int rf, int cf, wchar_t type) {
return;
}
-// shift a range of 'ENTS'
+/**
+ * \brief Shift a range to 'ENTS'
+ *
+ * \param[in] delta_rows
+ * \param[in] delta_cols
+ * \param[in] tlrow
+ * \param[in] tlcol
+ * \param[in] brrow
+ * \param[in] brcol
+ *
+ * \return none
+ */
+
void shift_range(int delta_rows, int delta_cols, int tlrow, int tlcol, int brrow, int brcol) {
currow = tlrow;
curcol = tlcol;
@@ -121,7 +187,15 @@ void shift_range(int delta_rows, int delta_cols, int tlrow, int tlcol, int brrow
return;
}
-// shift cells down
+/**
+ * \brief Shift cells down
+ *
+ * \param[in] deltarows
+ * \param[in] deltacols
+ *
+ * \return none
+ */
+
void shift_cells_down(int deltarows, int deltacols) {
int r, c;
struct ent ** pp;
@@ -146,7 +220,15 @@ void shift_cells_down(int deltarows, int deltacols) {
return;
}
-// shift cells right
+/**
+ * \brief Shift cells right
+ *
+ * \param[in] deltaros
+ * \param[in] deltacols
+ *
+ * \return none
+ */
+
void shift_cells_right(int deltarows, int deltacols) {
int r, c;
struct ent ** pp;
@@ -171,7 +253,15 @@ void shift_cells_right(int deltarows, int deltacols) {
return;
}
-// shift cells up
+/**
+ * \brief Shift cells up
+ *
+ * \param[in] deltarows
+ * \param[in] deltacols
+ *
+ * \return none
+ */
+
void shift_cells_up(int deltarows, int deltacols) {
int r, c;
struct ent ** pp;
@@ -209,7 +299,15 @@ void shift_cells_up(int deltarows, int deltacols) {
return;
}
-// shift cells left
+/**
+ * \brief Shift cells left
+ *
+ * \param[in] deltarows
+ * \param[in] deltacols
+ *
+ * \return none
+ */
+
void shift_cells_left(int deltarows, int deltacols) {
int r, c;
struct ent ** pp;