move emacs "local-variables-block" to end of the files and place (c)

at the begining


git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@896 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
drdani 2006-09-08 07:53:32 +00:00 committed by Adam Visegradi
parent 51e87c981a
commit 0795837fd0
23 changed files with 403 additions and 200 deletions

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_common.c
*
* DC-API functions common for master and slave side
*
* (c) Daniel Drotos, 2006
*/
#include <glib.h>
#include <stdio.h>
@ -86,3 +90,7 @@ unsigned DC_getGridCapabilities(void)
/* End of condor/condor_common.c */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,11 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_common.h
*
* DC-API functions common for master and slave side
*
* (c) Daniel Drotos, 2006
*/
#ifndef _DC_API_CONDOR_COMMON_H_
#define _DC_API_CONDOR_COMMON_H_
@ -59,3 +64,7 @@ extern void _DC_init_common(void);
#endif
/* End of condor/condor_common.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,11 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_defs.h
*
* DC-API type definitions for master side
*
* (c) Daniel Drotos, 2006
*/
#ifndef __DC_API_CONDOR_DEFS_H_
#define __DC_API_CONDOR_DEFS_H_
@ -112,3 +117,7 @@ typedef enum
#endif
/* End of condor/condor_defs.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,11 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_event.c
*
* DC-API functions to handle DC_MasterEvent data type
*
* (c) Daniel Drotos, 2006
*/
#include <glib.h>
@ -74,3 +79,7 @@ _DC_event_destroy(DC_MasterEvent *event)
/* End of condor/condor_event.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,11 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_event.h
*
* DC-API functions to handle DC_MasterEvent data type
*
* (c) Daniel Drotos, 2006
*/
#ifndef _DC_API_CONDOR_EVENT_H_
#define _DC_API_CONDOR_EVENT_H_
@ -26,3 +31,7 @@ extern void _DC_event_destroy(DC_MasterEvent *event);
#endif
/* End of condor/condor_event.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,11 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_log.cc
*
* DC-API utils to read and process condor "user log" file
*
* (c) Daniel Drotos, 2006
*/
#include <stdio.h>
#include <time.h>
@ -215,3 +220,7 @@ _DC_wu_exit_code(DC_Workunit *wu, int *res)
/* End of condor_log.cc */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,11 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_log.h
*
* DC-API utils to read and process condor "user log" file
*
* (c) Daniel Drotos, 2006
*/
#ifndef _DC_API_CONDOR_LOG_H_
#define _DC_API_CONDOR_LOG_H_
@ -24,3 +29,7 @@ extern int _DC_wu_exit_code(DC_Workunit *wu, int *res);
#endif
/* End of condor/condor_log.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,11 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_managewu.c
*
* DC-API wu management functions
*
* (c) Daniel Drotos, 2006
*/
#include <stdio.h>
#include <stdlib.h>
@ -207,3 +212,7 @@ DC_resumeWU(DC_Workunit *wu)
/* End of condor/condor_managewu.c */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,11 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_master.c
*
* DC-API functions of master side
*
* (c) Daniel Drotos, 2006
*/
#include <glib.h>
#include <stdio.h>
@ -968,3 +973,7 @@ _DC_acfg(enum _DC_e_param what)
/* End of condor/condor_master.c */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_master.h
*
* DC-API functions of master side
*
* (c) Daniel Drotos, 2006
*/
#ifndef _DC_API_CONDOR_MASTER_H_
#define _DC_API_CONDOR_MASTER_H_
@ -26,3 +30,7 @@ extern char *_DC_acfg(enum _DC_e_param what);
#endif
/* End of condor/condor_master.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_result.c
*
* DC-API functions to handle DC_Result data type
*
* (c) Daniel Drotos, 2006
*/
#include "condor_result.h"
@ -26,3 +30,7 @@ _DC_result_destroy(DC_Result *result)
/* End of condor_result.c */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_result.h
*
* DC-API functions to handle DC_Result data type
*
* (c) Daniel Drotos, 2006
*/
#ifndef _DC_API_CONDOR_RESULT_H_
#define _DC_API_CONDOR_RESULT_H_
@ -23,3 +27,7 @@ extern void _DC_result_destroy(DC_Result *result);
#endif
/* End of condor/condor_result.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_slave.c
*
* DC-API functions of slave side
*
* (c) Daniel Drotos, 2006
*/
#include <stdio.h>
#include <string.h>
@ -343,3 +347,7 @@ void DC_finishClient(int exitcode)
/* End of condor/condor_slave.c */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_slave.h
*
* DC-API functions of slave side
*
* (c) Daniel Drotos, 2006
*/
#ifndef __DC_API_CONDOR_SLAVE_H_
#define __DC_API_CONDOR_SLAVE_H_
@ -21,3 +25,7 @@ extern "C" {
#endif
/* End of condor/condor_slave.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_utils.c
*
* DC-API usefull functions
*
* (c) Daniel Drotos, 2006
*/
#include <stdio.h>
#include <sys/stat.h>
@ -407,3 +411,7 @@ _DC_unquote_string(char *str)
/* End of condor_utils.c */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_utils.h
*
* DC-API usefull functions
*
* (c) Daniel Drotos, 2006
*/
#ifndef __DC_API_CONDOR_UTILS_H_
#define __DC_API_CONDOR_UTILS_H_
@ -41,3 +45,7 @@ extern char *_DC_unquote_string(char *str);
#endif
/* End of condor/condor_utils.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_wu.c
*
* DC-API functions to handle DC_Workunit data type
*
* (c) Daniel Drotos, 2006
*/
#include <glib.h>
#include <stdio.h>
@ -427,3 +431,7 @@ _DC_wu_check_client_messages(DC_Workunit *wu)
/* End of condor/condor_wu.c */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/condor_wu.h
*
* DC-API functions to handle DC_Workunit data type
*
* (c) Daniel Drotos, 2006
*/
#ifndef _DC_API_CONDOR_WU_H_
#define _DC_API_CONDOR_WU_H_
@ -48,3 +52,7 @@ extern DC_MasterEvent *_DC_wu_check_client_messages(DC_Workunit *wu);
#endif
/* End of condor/condor_wu.h */
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,3 +1,11 @@
/*
* condor/tc.c
*
* DC-API test application, utility for both sides
*
* (c) Daniel Drotos, 2006
*/
#include <stdio.h>
#include <stdlib.h>
@ -6,41 +14,45 @@
void
create_file(char *fn, char *what)
{
FILE *f= fopen(fn, "w");
if (f)
{
if (what)
fprintf(f, "%s", what);
fclose(f);
}
FILE *f= fopen(fn, "w");
if (f)
{
if (what)
fprintf(f, "%s", what);
fclose(f);
}
}
char *
get_file(char *fn)
{
FILE *f;
char *buf= NULL;
FILE *f;
char *buf= NULL;
if ((f= fopen(fn, "r")) != NULL)
{
int bs= 100, i;
char c;
buf= malloc(bs);
i= 0;
buf[i]= '\0';
while ((c= fgetc(f)) != EOF)
if ((f= fopen(fn, "r")) != NULL)
{
if (i > bs-2)
{
bs+= 100;
buf= realloc(buf, bs);
}
buf[i]= c;
i++;
buf[i]= '\0';
int bs= 100, i;
char c;
buf= malloc(bs);
i= 0;
buf[i]= '\0';
while ((c= fgetc(f)) != EOF)
{
if (i > bs-2)
{
bs+= 100;
buf= realloc(buf, bs);
}
buf[i]= c;
i++;
buf[i]= '\0';
}
fclose(f);
}
fclose(f);
}
return(buf);
return(buf);
}
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,3 +1,10 @@
/*
* condor/tc.h
*
* DC-API test application, utility for both sides
*
* (c) Daniel Drotos, 2006
*/
#ifndef TC_H
#define TC_H
@ -5,3 +12,7 @@ extern void create_file(char *fn, char *what);
extern char *get_file(char *fn);
#endif
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/tm.c
*
* DC-API test application, master
*
* (c) Daniel Drotos, 2006
*/
#include <stdio.h>
#include <string.h>
@ -262,3 +266,7 @@ main(int argc, char *argv[])
return 0;
}
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,6 +1,10 @@
/* Local variables: */
/* c-file-style: "linux" */
/* End: */
/*
* condor/ts.c
*
* DC-API test application, slave
*
* (c) Daniel Drotos, 2006
*/
#include "dc_client.h"
@ -155,3 +159,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode
return main(argc, argv);
}
#endif
/* Local variables: */
/* c-file-style: "linux" */
/* End: */

View File

@ -1,3 +1,11 @@
/*
* condor/tss.c
*
* DC-API test application, slave
*
* (c) Daniel Drotos, 2006
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@ -15,137 +23,141 @@ int msg= 0;
static void
send_subresult(int c)
{
char l[100];
char p[100];
char s[100];
char l[100];
char p[100];
char s[100];
printf("cyc=%d Sending subresult...\n", c);
sprintf(l, "l_%d", c);
sprintf(p, "p_%d", c);
sprintf(s, "subresult %d", c);
create_file(p, s);
DC_sendResult(l, p, DC_FILE_REGULAR);
printf("cyc=%d Sending subresult...\n", c);
sprintf(l, "l_%d", c);
sprintf(p, "p_%d", c);
sprintf(s, "subresult %d", c);
create_file(p, s);
DC_sendResult(l, p, DC_FILE_REGULAR);
}
static void
mk_checkpoint(int c)
{
char *fn;
char buf[100];
char *fn;
char buf[100];
printf("cyc=%d Making checkpoint...\n", c);
fn= DC_resolveFileName(DC_FILE_OUT, DC_CHECKPOINT_FILE);
if (fn)
{
sprintf(buf, "%d\n", c);
create_file(fn, buf);
printf("Checkpoint created in file %s\n", fn);
DC_checkpointMade(fn);
free(fn);
}
else
printf("Failed\n");
printf("cyc=%d Making checkpoint...\n", c);
fn= DC_resolveFileName(DC_FILE_OUT, DC_CHECKPOINT_FILE);
if (fn)
{
sprintf(buf, "%d\n", c);
create_file(fn, buf);
printf("Checkpoint created in file %s\n", fn);
DC_checkpointMade(fn);
free(fn);
}
else
printf("Failed\n");
}
static void
send_message(int c)
{
char s[100];
char s[100];
printf("cyc=%d Sending message...\n", c);
sprintf(s, "Message=%d, cyc=%d", msg, c);
DC_sendMessage(s);
printf("cyc=%d Sending message...\n", c);
sprintf(s, "Message=%d, cyc=%d", msg, c);
DC_sendMessage(s);
}
int
main(int argc, char *argv[])
{
DC_initClient();
int i;
DC_initClient();
int i;
if (argc > 1)
{
cyc= strtol(argv[1], 0, 0);
printf("cyc defined= %d\n", cyc);
}
if (argc > 2)
{
sub= strtol(argv[2], 0, 0);
printf("sub defined= %d\n", sub);
}
if (argc > 3)
{
ckp= strtol(argv[3], 0, 0);
printf("ckp defined= %d\n", ckp);
}
if (argc > 4)
{
msg= strtol(argv[4], 0, 0);
printf("msg defined= %d\n", msg);
}
i= 0;
{
char *fn= DC_resolveFileName(DC_FILE_IN, DC_CHECKPOINT_FILE);
if (fn)
{
char *s= get_file(fn);
printf("Checkpoint file found %s\n", fn);
printf("Content: \"%s\"\n", s);
i= strtol(s, 0, 0);
printf("Continuing from cycle %d\n", i);
cyc-= i;
free(s);
free(fn);
}
else
printf("No checkpoint file found, start from the beginning...\n");
}
while (cyc)
{
cyc--;
i++;
printf("\nCycle %d. starting...\n", i);
{
DC_ClientEvent *e= DC_checkClientEvent();
if (e)
{
switch (e->type)
{
case DC_CLIENT_CHECKPOINT:
{
break;
}
case DC_CLIENT_FINISH:
{
break;
}
case DC_CLIENT_MESSAGE:
{
printf("At cyc=%d got a message: \"%s\"\n", i,
e->message);
break;
}
}
DC_destroyClientEvent(e);
}
}
sleep(1);
if (sub &&
i%sub == 0)
send_subresult(i);
if (ckp &&
i%ckp == 0)
mk_checkpoint(i);
if (msg)
if (argc > 1)
{
send_message(i);
msg--;
cyc= strtol(argv[1], 0, 0);
printf("cyc defined= %d\n", cyc);
}
if (argc > 2)
{
sub= strtol(argv[2], 0, 0);
printf("sub defined= %d\n", sub);
}
if (argc > 3)
{
ckp= strtol(argv[3], 0, 0);
printf("ckp defined= %d\n", ckp);
}
if (argc > 4)
{
msg= strtol(argv[4], 0, 0);
printf("msg defined= %d\n", msg);
}
printf("Done, remaining cycles: %d\n", cyc);
}
DC_finishClient(0);
i= 0;
{
char *fn= DC_resolveFileName(DC_FILE_IN, DC_CHECKPOINT_FILE);
if (fn)
{
char *s= get_file(fn);
printf("Checkpoint file found %s\n", fn);
printf("Content: \"%s\"\n", s);
i= strtol(s, 0, 0);
printf("Continuing from cycle %d\n", i);
cyc-= i;
free(s);
free(fn);
}
else
printf("No checkpoint file found, start from the beginning...\n");
}
while (cyc)
{
cyc--;
i++;
printf("\nCycle %d. starting...\n", i);
{
DC_ClientEvent *e= DC_checkClientEvent();
if (e)
{
switch (e->type)
{
case DC_CLIENT_CHECKPOINT:
{
break;
}
case DC_CLIENT_FINISH:
{
break;
}
case DC_CLIENT_MESSAGE:
{
printf("At cyc=%d got a message: \"%s\"\n", i,
e->message);
break;
}
}
DC_destroyClientEvent(e);
}
}
sleep(1);
if (sub &&
i%sub == 0)
send_subresult(i);
if (ckp &&
i%ckp == 0)
mk_checkpoint(i);
if (msg)
{
send_message(i);
msg--;
}
printf("Done, remaining cycles: %d\n", cyc);
}
DC_finishClient(0);
}
/* Local variables: */
/* c-file-style: "linux" */
/* End: */