~clint-fewbar/ubuntu/precise/gearmand/drop-unneeded-patches

« back to all changes in this revision

Viewing changes to libgearman/constants.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2009-08-11 10:06:22 UTC
  • mto: (1.2.3 upstream) (6.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20090811100622-6ig4iknanc73olum
ImportĀ upstreamĀ versionĀ 0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
#define GEARMAN_TEXT_RESPONSE_SIZE 8192
52
52
#define GEARMAN_WORKER_WAIT_TIMEOUT (10 * 1000) /* Milliseconds */
53
53
#define GEARMAN_PIPE_BUFFER_SIZE 256
 
54
#define GEARMAN_CONF_MAX_OPTION_SHORT 128
 
55
#define GEARMAN_CONF_DISPLAY_WIDTH 80
54
56
 
55
57
/* Types. */
56
58
typedef struct gearman_st gearman_st;
71
73
typedef struct gearman_server_worker_st gearman_server_worker_st;
72
74
typedef struct gearman_server_job_st gearman_server_job_st;
73
75
typedef struct gearmand_st gearmand_st;
 
76
typedef struct gearmand_port_st gearmand_port_st;
74
77
typedef struct gearmand_con_st gearmand_con_st;
75
78
typedef struct gearmand_thread_st gearmand_thread_st;
 
79
typedef struct gearman_conf_st gearman_conf_st;
 
80
typedef struct gearman_conf_option_st gearman_conf_option_st;
 
81
typedef struct gearman_conf_module_st gearman_conf_module_st;
76
82
 
77
83
/**
78
84
 * Return codes.
121
127
  GEARMAN_PTHREAD,
122
128
  GEARMAN_PIPE_EOF,
123
129
  GEARMAN_QUEUE_ERROR,
 
130
  GEARMAN_FLUSH_DATA,
 
131
  GEARMAN_SEND_BUFFER_TOO_SMALL,
 
132
  GEARMAN_IGNORE_PACKET,
 
133
  GEARMAN_UNKNOWN_OPTION,
124
134
  GEARMAN_MAX_RETURN /* Always add new error code before */
125
135
} gearman_return_t;
126
136
 
133
143
  GEARMAN_VERBOSE_ERROR,
134
144
  GEARMAN_VERBOSE_INFO,
135
145
  GEARMAN_VERBOSE_DEBUG,
136
 
  GEARMAN_VERBOSE_CRAZY
 
146
  GEARMAN_VERBOSE_CRAZY,
 
147
  GEARMAN_VERBOSE_MAX
137
148
} gearman_verbose_t;
138
149
 
139
150
/** @} */
155
166
 */
156
167
typedef enum
157
168
{
158
 
  GEARMAN_CON_ALLOCATED=     (1 << 0),
159
 
  GEARMAN_CON_READY=         (1 << 1),
160
 
  GEARMAN_CON_PACKET_IN_USE= (1 << 2),
161
 
  GEARMAN_CON_EXTERNAL_FD=   (1 << 3)
 
169
  GEARMAN_CON_ALLOCATED=              (1 << 0),
 
170
  GEARMAN_CON_READY=                  (1 << 1),
 
171
  GEARMAN_CON_PACKET_IN_USE=          (1 << 2),
 
172
  GEARMAN_CON_EXTERNAL_FD=            (1 << 3),
 
173
  GEARMAN_CON_IGNORE_LOST_CONNECTION= (1 << 4),
 
174
  GEARMAN_CON_CLOSE_AFTER_FLUSH=      (1 << 5)
162
175
} gearman_con_options_t;
163
176
 
164
177
/**
330
343
  GEARMAN_CLIENT_NON_BLOCKING=      (1 << 1),
331
344
  GEARMAN_CLIENT_TASK_IN_USE=       (1 << 2),
332
345
  GEARMAN_CLIENT_UNBUFFERED_RESULT= (1 << 3),
333
 
  GEARMAN_CLIENT_NO_NEW=            (1 << 4)
 
346
  GEARMAN_CLIENT_NO_NEW=            (1 << 4),
 
347
  GEARMAN_CLIENT_FREE_TASKS=        (1 << 5)
334
348
} gearman_client_options_t;
335
349
 
336
350
/**
501
515
} gearmand_thread_options_t;
502
516
 
503
517
/**
 
518
 * @ingroup gearman_conf
 
519
 * Options for gearman_conf_st.
 
520
 */
 
521
typedef enum
 
522
{
 
523
  GEARMAN_CONF_ALLOCATED= (1 << 0)
 
524
} gearman_conf_options_t;
 
525
 
 
526
/**
 
527
 * @ingroup gearman_conf_module
 
528
 * Options for gearman_conf_module_st.
 
529
 */
 
530
typedef enum
 
531
{
 
532
  GEARMAN_CONF_MODULE_ALLOCATED= (1 << 0)
 
533
} gearman_conf_module_options_t;
 
534
 
 
535
 
 
536
/**
504
537
 * @addtogroup gearman_constants Gearman Constants
505
538
 * @{
506
539
 */
515
548
typedef gearman_return_t (gearman_exception_fn)(gearman_task_st *task);
516
549
typedef gearman_return_t (gearman_fail_fn)(gearman_task_st *task);
517
550
 
 
551
typedef gearman_return_t (gearman_parse_server_fn)(const char *host,
 
552
                                                   in_port_t port, void *data);
 
553
 
518
554
typedef void* (gearman_worker_fn)(gearman_job_st *job, void *fn_arg,
519
555
                                  size_t *result_size,
520
556
                                  gearman_return_t *ret_ptr);
541
577
typedef void (gearman_server_thread_run_fn)(gearman_server_thread_st *thread,
542
578
                                            void *fn_arg);
543
579
 
 
580
typedef gearman_return_t (gearman_con_add_fn)(gearman_con_st *con);
 
581
 
 
582
typedef void (gearman_con_protocol_data_free_fn)(gearman_con_st *con,
 
583
                                                 void *data);
 
584
 
 
585
typedef gearman_packet_st* (gearman_con_recv_fn)(gearman_con_st *con,
 
586
                                                 gearman_packet_st *packet,
 
587
                                                 gearman_return_t *ret_ptr,
 
588
                                                 bool recv_data);
 
589
typedef size_t (gearman_con_recv_data_fn)(gearman_con_st *con, void *data,
 
590
                                          size_t data_size,
 
591
                                          gearman_return_t *ret_ptr);
 
592
 
 
593
typedef gearman_return_t (gearman_con_send_fn)(gearman_con_st *con,
 
594
                                               gearman_packet_st *packet,
 
595
                                               bool flush);
 
596
typedef size_t (gearman_con_send_data_fn)(gearman_con_st *con, const void *data,
 
597
                                          size_t data_size,
 
598
                                          gearman_return_t *ret_ptr);
 
599
 
 
600
typedef size_t (gearman_packet_pack_fn)(gearman_packet_st *packet,
 
601
                                        gearman_con_st *con,
 
602
                                        void *data, size_t data_size,
 
603
                                        gearman_return_t *ret_ptr);
 
604
typedef size_t (gearman_packet_unpack_fn)(gearman_packet_st *packet,
 
605
                                          gearman_con_st *con, const void *data,
 
606
                                          size_t data_size,
 
607
                                          gearman_return_t *ret_ptr);
 
608
 
544
609
typedef gearman_return_t (gearman_queue_add_fn)(gearman_st *gearman,
545
610
                                                void *fn_arg,
546
611
                                                const void *unique,
555
620
typedef gearman_return_t (gearman_queue_done_fn)(gearman_st *gearman,
556
621
                                                 void *fn_arg,
557
622
                                                 const void *unique,
558
 
                                                 size_t unique_size);
 
623
                                                 size_t unique_size,
 
624
                                                 const void *function_name,
 
625
                                                 size_t function_name_size);
559
626
typedef gearman_return_t (gearman_queue_replay_fn)(gearman_st *gearman,
560
627
                                                   void *fn_arg,
561
628
                                                   gearman_queue_add_fn *add_fn,