[Commit] librr/src rr.h,1.2,1.3 rr_board.c,1.3,1.4

Carl Worth commit at keithp.com
Mon Jun 2 08:46:18 PDT 2003


Committed by: cworth

Update of /local/src/CVS/librr/src
In directory home.keithp.com:/tmp/cvs-serv7591/src

Modified Files:
	rr.h rr_board.c 
Log Message:
Added rr_board_create_from_str convenience function

Index: rr.h
===================================================================
RCS file: /local/src/CVS/librr/src/rr.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- rr.h	2 Jun 2003 14:16:52 -0000	1.2
+++ rr.h	2 Jun 2003 14:46:15 -0000	1.3
@@ -119,6 +119,9 @@
 rr_board_t *
 rr_board_create (int width, int height);
 
+rr_board_t *
+rr_board_create_from_str (const char *str);
+
 void
 rr_board_destroy (rr_board_t *board);
 

Index: rr_board.c
===================================================================
RCS file: /local/src/CVS/librr/src/rr_board.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rr_board.c	2 Jun 2003 14:16:52 -0000	1.3
+++ rr_board.c	2 Jun 2003 14:46:15 -0000	1.4
@@ -63,6 +63,25 @@
     return board;
 }
 
+rr_board_t *
+rr_board_create_from_str (const char *str)
+{
+    rr_status_t status;
+    rr_board_t *board;
+
+    board = rr_board_create (0, 0);
+    if (board == NULL)
+	return NULL;
+
+    status = rr_board_parse (board, str);
+    if (status) {
+	rr_board_destroy (board);
+	return NULL;
+    }
+
+    return board;
+}
+
 static rr_status_t
 _rr_board_init (rr_board_t *board, int width, int height)
 {




More information about the Commit mailing list