| Revision 49,
1.2 KB
checked in by micael, 21 months ago
(diff) |
- Added 'Id' to svn:keywords.
|
-
Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | Copyright (C) 2011 J. Alberdi, M. Oliveira, Y. Pouillon, and M. Verstraete |
|---|
| 3 | |
|---|
| 4 | This program is free software; you can redistribute it and/or modify |
|---|
| 5 | it under the terms of the GNU Lesser General Public License as published by |
|---|
| 6 | the Free Software Foundation; either version 3 of the License, or |
|---|
| 7 | (at your option) any later version. |
|---|
| 8 | |
|---|
| 9 | This program is distributed in the hope that it will be useful, |
|---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | GNU Lesser General Public License for more details. |
|---|
| 13 | |
|---|
| 14 | You should have received a copy of the GNU Lesser General Public License |
|---|
| 15 | along with this program; if not, write to the Free Software |
|---|
| 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 17 | |
|---|
| 18 | $Id$ |
|---|
| 19 | */ |
|---|
| 20 | |
|---|
| 21 | #include <stdio.h> |
|---|
| 22 | #include <string.h> |
|---|
| 23 | #include "pspio_error.h" |
|---|
| 24 | #include "pspio_state.h" |
|---|
| 25 | |
|---|
| 26 | int pspio_state_wf_set(pspio_state_t state, const double *wf) { |
|---|
| 27 | int wf_size; |
|---|
| 28 | |
|---|
| 29 | if ( state.wf != NULL ) { |
|---|
| 30 | return PSPIO_ERROR; |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | wf_size = sizeof(wf); |
|---|
| 34 | |
|---|
| 35 | state.wf = (double *)malloc(wf_size); |
|---|
| 36 | if ( state.wf == NULL ) { |
|---|
| 37 | return PSPIO_ERROR; |
|---|
| 38 | } else { |
|---|
| 39 | memcpy(state.wf,wf,wf_size); |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | return PSPIO_SUCCESS; |
|---|
| 43 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.