remove string.h
This commit is contained in:
parent
645e5bee3a
commit
cfc32a1b15
|
@ -1,4 +1,5 @@
|
||||||
#include "picrin.h"
|
#include "picrin.h"
|
||||||
|
#include "picrin/object.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
pic_str_set(pic_state *pic, struct pic_string *str, int i, char c)
|
pic_str_set(pic_state *pic, struct pic_string *str, int i, char c)
|
||||||
|
|
|
@ -69,22 +69,16 @@ pic_socket_socket_p(pic_state *pic)
|
||||||
static pic_value
|
static pic_value
|
||||||
pic_socket_make_socket(pic_state *pic)
|
pic_socket_make_socket(pic_state *pic)
|
||||||
{
|
{
|
||||||
pic_value n, s;
|
|
||||||
const char *node, *service;
|
const char *node, *service;
|
||||||
int family, socktype, flags, protocol;
|
int family, socktype, flags, protocol;
|
||||||
int result;
|
int result;
|
||||||
struct addrinfo hints, *ai, *it;
|
struct addrinfo hints, *ai, *it;
|
||||||
struct pic_socket_t *sock;
|
struct pic_socket_t *sock;
|
||||||
|
|
||||||
pic_get_args(pic, "ooiiii", &n, &s, &family, &socktype, &flags, &protocol);
|
pic_get_args(pic, "zziiii", &node, &service, &family, &socktype, &flags, &protocol);
|
||||||
|
|
||||||
node = service = NULL;
|
if (strlen(node) == 0) node = NULL;
|
||||||
if (pic_str_p(pic, n)) {
|
if (strlen(service) == 0) service = NULL;
|
||||||
node = pic_str(pic, pic_str_ptr(n));
|
|
||||||
}
|
|
||||||
if (pic_str_p(pic, s)) {
|
|
||||||
service = pic_str(pic, pic_str_ptr(s));
|
|
||||||
}
|
|
||||||
|
|
||||||
sock = pic_malloc(pic, sizeof(struct pic_socket_t));
|
sock = pic_malloc(pic, sizeof(struct pic_socket_t));
|
||||||
sock->fd = -1;
|
sock->fd = -1;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
(type *sock-stream*)
|
(type *sock-stream*)
|
||||||
(flags *ai-passive*)
|
(flags *ai-passive*)
|
||||||
(protocol *ipproto-ip*))
|
(protocol *ipproto-ip*))
|
||||||
(make-socket #f service family type flags protocol)))
|
(make-socket "" service family type flags protocol)))
|
||||||
|
|
||||||
(define %address-family `((inet . ,*af-inet*)
|
(define %address-family `((inet . ,*af-inet*)
|
||||||
(inet6 . ,*af-inet6*)
|
(inet6 . ,*af-inet6*)
|
||||||
|
|
|
@ -268,7 +268,6 @@ int pic_str_hash(pic_state *, struct pic_string *);
|
||||||
#include "picrin/port.h"
|
#include "picrin/port.h"
|
||||||
#include "picrin/proc.h"
|
#include "picrin/proc.h"
|
||||||
#include "picrin/record.h"
|
#include "picrin/record.h"
|
||||||
#include "picrin/string.h"
|
|
||||||
#include "picrin/symbol.h"
|
#include "picrin/symbol.h"
|
||||||
|
|
||||||
void *pic_default_allocf(void *, void *, size_t);
|
void *pic_default_allocf(void *, void *, size_t);
|
||||||
|
|
|
@ -10,6 +10,19 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* string */
|
||||||
|
|
||||||
|
struct pic_string {
|
||||||
|
PIC_OBJECT_HEADER
|
||||||
|
struct pic_rope *rope;
|
||||||
|
};
|
||||||
|
|
||||||
|
void pic_rope_incref(pic_state *, struct pic_rope *);
|
||||||
|
void pic_rope_decref(pic_state *, struct pic_rope *);
|
||||||
|
|
||||||
|
#define pic_str_ptr(o) ((struct pic_string *)pic_obj_ptr(o))
|
||||||
|
|
||||||
|
|
||||||
/* vector */
|
/* vector */
|
||||||
|
|
||||||
struct pic_vector {
|
struct pic_vector {
|
||||||
|
|
|
@ -9,16 +9,6 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct pic_string {
|
|
||||||
PIC_OBJECT_HEADER
|
|
||||||
struct pic_rope *rope;
|
|
||||||
};
|
|
||||||
|
|
||||||
void pic_rope_incref(pic_state *, struct pic_rope *);
|
|
||||||
void pic_rope_decref(pic_state *, struct pic_rope *);
|
|
||||||
|
|
||||||
#define pic_str_ptr(o) ((struct pic_string *)pic_obj_ptr(o))
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "picrin.h"
|
#include "picrin.h"
|
||||||
|
#include "picrin/object.h"
|
||||||
|
|
||||||
struct pic_chunk {
|
struct pic_chunk {
|
||||||
char *str;
|
char *str;
|
||||||
|
|
Loading…
Reference in New Issue