Update of /cvsroot/dhcp-agent/dhcp-agent/src
In directory sc8-pr-cvs1:/tmp/cvs-serv25098/src
Modified Files:
Makefile.am
Added Files:
dhcp-guile-util.c dhcp-guile-util.h
Log Message:
guile utility code now in seperate file
--- NEW FILE: dhcp-guile-util.c ---
/* $Header: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-guile-util.c,v 1.1 2003/08/05 04:49:09 actmodern Exp $
*
* Copyright 2002 Thamer Alharbash
*
* 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. The names of the authors may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* guile utility routines which guile should be offering but isn't :|
*
*/
#include "dhcp-local.h"
#include "dhcp-libutil.h"
#include "dhcp-guile-util.h"
char *x_scm_symbol2newstr(SCM symbol)
{
size_t len;
char *newstr;
len = SCM_SYMBOL_LENGTH(symbol);
newstr = xmalloc((len + 1) * sizeof(char));
memcpy(newstr, SCM_SYMBOL_CHARS(symbol), len);
newstr[len] = 0;
return newstr;
}
char *x_scm_string2newstr(SCM string)
{
size_t len;
char *newstr;
len = SCM_STRING_LENGTH(string);
newstr = xmalloc((len + 1) * sizeof(char));
memcpy(newstr, SCM_STRING_CHARS(string), len);
newstr[len] = 0;
return newstr;
}
--- NEW FILE: dhcp-guile-util.h ---
/* $Header: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-guile-util.h,v 1.1 2003/08/05 04:49:09 actmodern Exp $
*
* Copyright 2003 Thamer Alharbash <tm...@wh...>
*
* 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. The names of the authors may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifndef DHCP_GUILE_UTIL_H
#define DHCP_GUILE_UTIL_H
#include <libguile.h>
extern char *x_scm_symbol2newstr(SCM symbol);
extern char *x_scm_string2newstr(SCM string);
#endif /* DHCP_GUILE_UTIL_H */
Index: Makefile.am
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/Makefile.am,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** Makefile.am 28 Jul 2003 00:34:08 -0000 1.33
--- Makefile.am 5 Aug 2003 04:49:09 -0000 1.34
***************
*** 23,27 ****
dhcp-client-guile.h dhcp-sniff-defaults.h dhcp-client-defaults.h dhcp-lease.h \
dhcp-server.h dhcp-server-guile.h dhcp-server-conf.h dhcp-server-defaults.h \
! dhcp-server-guile.h
libdhcputil_la_SOURCES = dhcp-util.c \
--- 23,27 ----
dhcp-client-guile.h dhcp-sniff-defaults.h dhcp-client-defaults.h dhcp-lease.h \
dhcp-server.h dhcp-server-guile.h dhcp-server-conf.h dhcp-server-defaults.h \
! dhcp-server-guile.h dhcp-server-lease-manager.h dhcp-guile-util.h
libdhcputil_la_SOURCES = dhcp-util.c \
***************
*** 69,73 ****
dhcp-client-states.c \
dhcp-sysconf.c \
! dhcp-client-guile.c
dhcp_server_SOURCES = dhcp-server.c \
--- 69,74 ----
dhcp-client-states.c \
dhcp-sysconf.c \
! dhcp-client-guile.c \
! dhcp-guile-util.c
dhcp_server_SOURCES = dhcp-server.c \
***************
*** 76,80 ****
dhcp-server-control.c \
dhcp-server-states.c \
! dhcp-server-guile.c
dhcp_client_LDADD = -ldhcputil ${GUILE_LIB}
--- 77,83 ----
dhcp-server-control.c \
dhcp-server-states.c \
! dhcp-server-guile.c \
! dhcp-guile-util.c \
! dhcp-server-lease-manager.c
dhcp_client_LDADD = -ldhcputil ${GUILE_LIB}
|