File: curb_upload.h

package info (click to toggle)
ruby-curb 0.8.6-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 604 kB
  • ctags: 880
  • sloc: ansic: 4,242; ruby: 2,768; makefile: 3
file content (30 lines) | stat: -rw-r--r-- 754 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* curb_upload.h - Curl upload handle
 * Copyright (c)2009 Todd A Fisher. 
 * Licensed under the Ruby License. See LICENSE for details.
 */
#ifndef __CURB_UPLOAD_H
#define __CURB_UPLOAD_H

#include "curb.h"

#include <curl/easy.h>

/*
 * Maintain the state of an upload e.g. for putting large streams with very little memory
 * out to a server. via PUT requests
 */
typedef struct {
  VALUE stream;
  size_t offset;
} ruby_curl_upload;

extern VALUE cCurlUpload;
void init_curb_upload();

VALUE ruby_curl_upload_new(VALUE klass);
VALUE ruby_curl_upload_stream_set(VALUE self, VALUE stream);
VALUE ruby_curl_upload_stream_get(VALUE self);
VALUE ruby_curl_upload_offset_set(VALUE self, VALUE offset);
VALUE ruby_curl_upload_offset_get(VALUE self);

#endif